mirror of
https://github.com/subhobhai943/SUB-OS.git
synced 2026-10-25 16:52:29 +00:00
29 lines
679 B
C
29 lines
679 B
C
#ifndef _KERNEL_MODULE_H
|
|
#define _KERNEL_MODULE_H
|
|
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
#include <stdbool.h>
|
|
|
|
#define MODULE_NAME_LEN 32
|
|
#define MAX_MODULES 16
|
|
|
|
typedef struct kernel_module {
|
|
char name[MODULE_NAME_LEN];
|
|
char description[64];
|
|
char author[32];
|
|
char version[16];
|
|
size_t size;
|
|
int (*init)(void);
|
|
void (*cleanup)(void);
|
|
bool loaded;
|
|
} kernel_module_t;
|
|
|
|
void module_init_subsystem(void);
|
|
int module_load(const char* name, int (*init_fn)(void), void (*cleanup_fn)(void), size_t size);
|
|
int module_unload(const char* name);
|
|
size_t module_get_count(void);
|
|
const kernel_module_t* module_get(size_t index);
|
|
|
|
#endif // _KERNEL_MODULE_H
|