Binary Interface - s-ol/HowDoIOS GitHub Wiki

This entry is deprecated! whilst most of it will still be right after I am done with Drivers, some of it will change. Be advised.

All Applications and drivers that have to be loaded after boot time have to confirm to this standard (until some other binary interface is supported).

Header

field size notes
magic number 1w 0x4110. magic number that makes the file recognizable as an executable.
header version 1w MMMMMMMMmmmmmmmm: Major, minor.
This version is 1.0, represented as 0x0100
header size 1w full header size
code + data size 1w full file size, including all pre-allocated memory
flags 1w 111111111111111s
Semaphore-like: only one process may use the exports at a time
entry point 1w entry point for executable relative to start of code section, default 0
0xffff for export-only binaries
relocation table 1..Nw see below
exports table 1..Nw see below
imports table 1..Nw see below

Relocation Table

The code relocation table is a list of fixups. Every label you use should be on this list. Note that short literals are not supported.

field size notes
num fixups 1w number of entries (or 0)
fixup address 0..Nw word that should be fixed. Fixing is done by adding the binary's offset from 0x0000 to this word

Exports table

Export tables are used to give other processess the ability to interact with the spawned process via Interfaces (see Driver for more info). All routines in this table must confirm too the Calling Convention

field size notes
num entries 1w number of entries
interfaces 0..Nw ids of the interfaces implemented, ommited if num entries is 0
interface exports 0..Nw exports of each interface, ommited if num entries is 0

Interface Exports:

field size notes
num entries 1w number of entries for corresponding interface; 0 if interface is virtual
routine address 0-Nw word that should be jumped too

Imports Table

The imports table describes what requirements have to be met to be able to execute the process. This usually includes interfaces like the FILESYSTEM driver or HARDWARE virtual interface.

field size notes
num entries 1w number of entries; 0 if "dependency-less"
interfaces 0..Nw ids of the interfaces implemented, ommited if num entries is 0
⚠️ **GitHub.com Fallback** ⚠️