WonderWitch/IL
From WSdev Wiki
Jump to navigationJump to search
Indirect libraries (IL) are a FreyaOS feature designed to work around the 64KB segment limit of applications by offloading helper functionality to separate library binaries.
Traditionally, ILs use a file system name prefixed with @
; for example, @proc
for ProcIL.
Calling convention
All functions exposed by an IL use the standard 8086 C calling convention - cdecl.
- The stack is allocated and cleaned by the caller.
AX
,BX
,CX
,DX
can be modified freely by the callee. All other registers must be restored before returning to its caller.
Note that DS
is not changed upon entry and points to the caller function's data segment.
Format
Header
The location of the IL header is provided by the file entry.
Offset | Length | Contents |
---|---|---|
0 | 4 | TODO |
4 | 2 | Number of functions, including get_info .
|
6 | 4 | Far pointer to the function ILinfo __far *get_info(void); .
The function returns a pointer to the IL information structure with a valid segment (for example, sourced from CS). |
10... | 4... | Further instruction pointers according to the IL's specification. |
IL information
Offset | Length | Contents |
---|---|---|
0 | 4 | Far pointer to a zero-terminated string containing the IL class name; the segment is ignored. |
4 | 4 | Far pointer to a zero-terminated string containing the IL name; the segment is ignored. |
8 | 4 | Far pointer to a zero-terminated string containing the IL version; the segment is ignored. |
12 | 4 | Far pointer to a zero-terminated string containing the IL description; the segment is ignored. |
16 | 4 | Far pointer to an array of far pointers to zero-terminated strings containing the IL dependency list; the segment is ignored. |
List of ILs
Built-in ILs
These ILs are included in FreyaOS.
SDK-provided ILs
These ILs are not included in FreyaOS, but are provided on the WonderWitch disc.