X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Finclude%2Fbinary.h;h=77ccdd74833ed59de46b960e849ee8e598524553;hb=de2ae10743172075f2d527780bdfd890ccddb8e7;hp=a12655157b755df787e8262e93ba87fc9b0c9294;hpb=38e4b28d370c5f9284b285a71518ae2b6bce125c;p=tpg%2Facess2.git diff --git a/Kernel/include/binary.h b/Kernel/include/binary.h index a1265515..77ccdd74 100644 --- a/Kernel/include/binary.h +++ b/Kernel/include/binary.h @@ -7,6 +7,13 @@ #define _BINARY_H // === TYPES === +/** + * \brief Representation of a page in a binary file + * + * Tells the binary loader where the page data resides on disk and where + * to load it to (relative to the binary base). Once the data is read, + * the \a Physical field contains the physical address of the page. + */ typedef struct sBinaryPage { /** @@ -21,6 +28,19 @@ typedef struct sBinaryPage Uint16 Flags; //!< Load Flags } __attribute__ ((packed)) tBinaryPage; +/** + * \brief Flags for ::tBinaryPage.Flags + * \name Binary Page Flags + * \{ + */ +//! \brief Read-only +#define BIN_PAGEFLAG_RO 0x0001 +//! \brief Executable +#define BIN_PAGEFLAG_EXEC 0x0002 +/** + * \} + */ + /** * \brief Defines a binary file * @@ -144,4 +164,17 @@ typedef struct sBinaryType */ extern char *Binary_RegInterp(char *Path); +/** + * \brief Registers a binary type with the kernel's loader + * \param Type Pointer to the loader's type structure + * \return Boolean success + * \note The structure \a Type must be persistant (usually it will be a + * constant global variable) + * + * This function tells the binary loader about a new file type, and gives + * it the functions to read the type into a ::tBinary structure, relocate + * it and to find the value of symbols defined within the binary. + */ +extern int Binary_RegisterType(tBinaryType *Type); + #endif