Binary type definition. More...
#include <binary.h>
Data Fields | |
| struct sBinaryType * | Next |
| Pointer used by the kernel. | |
| Uint32 | Ident |
| Identifying DWord. | |
| Uint32 | Mask |
| Mask value for tBinaryType.Ident. | |
| char * | Name |
| Name of this executable type (for debug purpouses). | |
| tBinary *(* | Load )(int FD) |
| Read a binary from a file. | |
| int(* | Relocate )(void *Base) |
| Prepares a mapped binary for execution at this address. | |
| int(* | GetSymbol )(void *Base, char *Name, Uint *Dest) |
| Gets a symbol's address from a loaded binary. | |
Binary type definition.
This structure is used to define a loader for a specific binary type so that the kernel's core binary loader can understand that type. The tBinaryType.Relocate and tBinaryType.GetSymbol need only be non-NULL if the binary type is to be used for kernel modules, otherwise it will only be able to load binaries for user space.
| int(* tBinaryType::GetSymbol)(void *Base, char *Name, Uint *Dest) |
Gets a symbol's address from a loaded binary.
Identifying DWord.
If he first 32-bits of the file match this value (when ANDed with tBinaryType.Mask), this binary loader will be used to load the file.
| tBinary*(* tBinaryType::Load)(int FD) |
| struct sBinaryType* tBinaryType::Next |
Pointer used by the kernel.
| int(* tBinaryType::Relocate)(void *Base) |
Prepares a mapped binary for execution at this address.
| Base | Binary loaded in memory |
tBinaryType.Relocate takes a binary that was loaded according to tBinaryType.Load and prepares it to run at the address it is loaded to, attempting to satisfy any external unresolved symbols required, if a symbol cannot be located, the function will return zero.
1.6.3