tBinaryType Struct Reference

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.

Detailed Description

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.


Field Documentation

int(* tBinaryType::GetSymbol)(void *Base, char *Name, Uint *Dest)

Gets a symbol's address from a loaded binary.

Note:
The binary pointed to by Base may not have been through tBinaryType.Relocate at this time, so the driver should accomodate this.

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.

Read a binary from a file.

Parameters:
FD VFS File handle to file to load
Returns:
Pointer to a tBinary that describes how to load the file

This function reads a binary file and returns a tBinary pointer that tells the core binary loader how to read the data from the file and where to map it to.

struct sBinaryType* tBinaryType::Next

Pointer used by the kernel.

Note:
Should not be touched by the driver (initialise to NULL)
int(* tBinaryType::Relocate)(void *Base)

Prepares a mapped binary for execution at this address.

Parameters:
Base Binary loaded in memory
Returns:
Boolean Success
Note:
This pointer can be NULL, but then the binary cannot be used to load a kernel module.

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.


The documentation for this struct was generated from the following file:
Generated on Mon Feb 14 15:21:31 2011 for Acess2 by  doxygen 1.6.3