Skip to main content

Driver

Driver API

Driver Information Structure​

typedef struct ethereal_driver_metadata {
char name[256]; // Driver name
char author[256]; // Author
} ethereal_driver_metadata_t;

typedef struct ethereal_driver {
pid_t id; // Driver ID
char filename[256]; // Exact filename of the driver
uintptr_t base; // Base address in memory
size_t size; // Size in memory
ethereal_driver_metadata_t metadata; // Exact metadata copy
} ethereal_driver_t;

ethereal_loadDriver​

pid_t ethereal_loadDriver(char *filename, int priority, char **argv);

Load a new driver into the Hexahedron kernel.

Tries to load the driver at filename with priority priority and arguments argp into the kernel.

On success, the driver ID is returned. On failure, an error is set

Root permission is required for this function.

ethereal_unloadDriver​

int ethereal_unloadDriver(pid_t id);

Unload a driver from the Hexahedron kernel.

Root permission is required for this function.

ethereal_getDriver​

ethereal_driver_t *ethereal_getDriver(pid_t id);

Get the corresponding driver for id.

On success, the driver structure is returned. On failure, an error is set.

Root permission is required for this function.