My Kernel v0.1.0
Executable file format
Collaboration diagram for Executable file format:

Modules

 Executable and Linkable Format (ELF)
 

Data Structures

struct  execfmt
 An executable file format. More...
 
struct  executable
 Represents a loaded executable. More...
 
struct  exec_params
 Executable parameters. More...
 

Functions

error_t execfmt_register (struct execfmt *)
 Register a new executable file format.
 
error_t execfmt_execute (const struct exec_params *)
 Execute a given executable file's content. More...
 

Detailed Description

Executable file format

Similarily to the Linux kernel's, the binary format (execfmt) API is used to define supported executable file format.

When executing a file from userland, it is matched against all registered execfmt entries. If no matching binary format is found the file is deemed 'unexecutable'. Else, the execfmt's callback are used to parse/load the file in memory (if necessary), and execute it.

See also
Linux Kernel functions and structures's execfmt API

Function Documentation

◆ execfmt_execute()

error_t execfmt_execute ( const struct exec_params params)

Prior to being executed, the file is matched against all known (aka supported) executable file formats, and loaded into memory. If any of these steps fail, this function returns the failing step's error value.