AMCX file format

From AMC-OS Developers
Jump to navigation Jump to search

Introduction

The AMCX file format is used for all executable files used in AMC-OS, including kernel itself. They are equivalent to PE for DOS/Windows, ELF for Unix and so on.

Linking of object files to build an AMCX file is done by the AMC-OS Linker.

API

To manipulate AMCX files, structures are defined in :

  • CORE\INC\AMCOSEXE.ASH for ASM files
  • linker\amcos_linker\amcos_linker.h for C files

Header

Header of an AMCX file
Offset Description Type Notes
+00H Magic Number char[4] 'AMCX'
+04H Header size __uint32
+08H Subheader size __uint32
+0CH Checksum __uint16
+0EH Header version __uint16
+10H reserved for future use __uint32
+14H Application short name char[32]
+34H Application version __uint32
+38H Offset of application info structure __uint32
+3CH Required CPU __uint32
+40H Required OS version __uint32
+44H reserved for future use __uint32
+48H Offset of segments list __uint32
+4CH Number of segments in segments list __uint32
+50H Offset of imported symbols list __uint32
+54H Number of imported symbols __uint32
+58H Offset of exported symbols list __uint32 Symbols exported in DLL
+5CH Number of exported symbols __uint32
+60H Offset of relocations list __uint32
+64H Number of relocations __uint32
+68H Offset of entry point __uint32 Offset in first code segment found
+6CH Default thread stack size __uint32