|
FreeNOS
|
Abstraction class of various executable formats. More...
#include <ExecutableFormat.h>
Data Structures | |
| struct | Region |
| Memory region. More... | |
Public Types | |
| enum | Result { Success, NotFound, InvalidFormat, OutOfMemory } |
| Result code. More... | |
| typedef struct ExecutableFormat::Region | Region |
| Memory region. More... | |
Public Member Functions | |
| ExecutableFormat (const u8 *image, const Size size) | |
| Class constructor. More... | |
| virtual | ~ExecutableFormat () |
| Class destructor. More... | |
| virtual Result | regions (Region *regions, Size *count) const =0 |
| Memory regions a program needs at runtime. More... | |
| virtual Result | entry (Address *entry) const =0 |
| Lookup the program entry point. More... | |
Static Public Member Functions | |
| static Result | find (const u8 *image, const Size size, ExecutableFormat **fmt) |
| Find a ExecutableFormat which can handle the given format. More... | |
Protected Attributes | |
| const u8 * | m_image |
| Input image raw data. More... | |
| const Size | m_size |
| Input image size in bytes. More... | |
Abstraction class of various executable formats.
Definition at line 48 of file ExecutableFormat.h.
| typedef struct ExecutableFormat::Region ExecutableFormat::Region |
Memory region.
Result code.
| Enumerator | |
|---|---|
| Success | |
| NotFound | |
| InvalidFormat | |
| OutOfMemory | |
Definition at line 68 of file ExecutableFormat.h.
Class constructor.
| image | Pointer to program image. |
| size | Size of the program image. |
Definition at line 22 of file ExecutableFormat.cpp.
|
virtual |
Class destructor.
Definition at line 28 of file ExecutableFormat.cpp.
Lookup the program entry point.
| entry | Entry point on output. |
Implemented in ELF.
Referenced by CoreServer::prepareCoreInfo(), BootImageCreate::readBootSymbols(), RecoveryServer::rewriteProgram(), and spawn().
|
static |
Find a ExecutableFormat which can handle the given format.
| image | Program image to read. |
| size | Program image size. |
| fmt | ExecutableFormat object pointer on output. |
Definition at line 32 of file ExecutableFormat.cpp.
References ELF::detect().
Referenced by CoreServer::loadKernel(), BootImageCreate::readBootSymbols(), RecoveryServer::rewriteProgram(), and spawn().
Memory regions a program needs at runtime.
| regions | Memory regions to fill. |
| count | On input, the maximum number of regions to read. On output, the actual number of regions read. |
Implemented in ELF.
Referenced by CoreServer::loadKernel(), BootImageCreate::readBootSymbols(), RecoveryServer::rewriteProgram(), and spawn().
|
protected |
Input image raw data.
Definition at line 126 of file ExecutableFormat.h.
Referenced by ELF::entry(), and ELF::regions().
|
protected |
Input image size in bytes.
Definition at line 129 of file ExecutableFormat.h.
1.8.17