AMCX file format: Difference between revisions

From AMC-OS Developers
Jump to navigation Jump to search
(Initial creation)
 
m (Added links to wiki)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Introduction==
==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.
The AMCX file format is used for all executable files used in AMC-OS, including kernel itself. They are equivalent to [http://en.wikipedia.org/wiki/Portable_Executable PE for DOS/Windows], [http://en.wikipedia.org/wiki/Executable_and_Linkable_Format ELF for Unix] and so on.


Linking of object files to build an AMCX file is done by the [[AMC-OS Linker]].
Linking of object files to build an AMCX file is done by the [[AMC-OS Linker]].
Line 7: Line 7:


To manipulate AMCX files, structures are defined in :
To manipulate AMCX files, structures are defined in :
* <code>INC\AMCOSEXE.ASH</code> for ASM files
* <code>CORE\INC\AMCOSEXE.ASH</code> for ASM files
* <code>linker\amcos_linker\amcos_linker.h</code> for C files
* <code>linker\amcos_linker\amcos_linker.h</code> for C files


Line 29: Line 29:
| <code>+0EH</code> || Header version || __uint16 ||
| <code>+0EH</code> || Header version || __uint16 ||
|-
|-
| <code>+10H</code> || reserved for future use || __uint32 ||
| <code>+10H</code> || ''reserved for future use'' || __uint32 ||
|-
|-
| <code>+14H</code> || Application short name || char[32] ||
| <code>+14H</code> || Application short name || char[32] ||
Line 41: Line 41:
| <code>+40H</code> || Required OS version || __uint32 ||
| <code>+40H</code> || Required OS version || __uint32 ||
|-
|-
| <code>+44H</code> || reserved for future use || __uint32 ||
| <code>+44H</code> || ''reserved for future use'' || __uint32 ||
|-
|-
| <code>+48H</code> || Offset of segments list || __uint32 ||
| <code>+48H</code> || Offset of segments list || __uint32 ||
Line 51: Line 51:
| <code>+54H</code> || Number of imported symbols || __uint32 ||
| <code>+54H</code> || Number of imported symbols || __uint32 ||
|-
|-
| <code>+58H</code> || Offset of exported symbols list || __uint32 ||
| <code>+58H</code> || Offset of exported symbols list || __uint32 || Symbols exported in DLL
|-
|-
| <code>+5CH</code> || Number of exported symbols || __uint32 ||
| <code>+5CH</code> || Number of exported symbols || __uint32 ||
Line 59: Line 59:
| <code>+64H</code> || Number of relocations || __uint32 ||
| <code>+64H</code> || Number of relocations || __uint32 ||
|-
|-
| <code>+68H</code> || Offset of entry point || __uint32 ||
| <code>+68H</code> || Offset of entry point || __uint32 || Offset in first code segment found
|-
|-
| <code>+6CH</code> || Default thread stack size || __uint32 ||
| <code>+6CH</code> || Default thread stack size || __uint32 ||
|}
|}

Latest revision as of 23:25, 14 August 2012

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