#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
{
/**
* \note Used to uniquely identify the loaded binary to reduce in-memory
* duplication.
*/
- char *TruePath;
+ const char *TruePath;
/**
* \brief Interpreter used to load the file
* \note This can be either requested by the individual file, or a per-driver option
*/
- char *Interpreter;
+ const char *Interpreter;
/**
* \brief Entrypoint of the binary (at requested base);
*/
*/
Uint32 Ident;
Uint32 Mask; //!< Mask value for tBinaryType.Ident
- char *Name; //!< Name of this executable type (for debug purpouses)
+ const char *Name; //!< Name of this executable type (for debug purpouses)
/**
* \brief Read a binary from a file
* \param FD VFS File handle to file to load
* tBinaryType.Relocate at this time, so the driver should
* accomodate this.
*/
- int (*GetSymbol)(void *Base, char *Name, Uint *Dest);
+ int (*GetSymbol)(void *Base, const char *Name, Uint *Dest);
} tBinaryType;
/**
*/
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