Kernel: Implement basic module unloading :^)

Kernel modules can now be unloaded via a syscall. They get a chance to
run some code of course. Before deallocating them, we call their
"module_fini" symbol.
This commit is contained in:
Andreas Kling 2019-11-28 21:07:22 +01:00
commit a43b115a6c
Notes: sideshowbarker 2024-07-19 11:02:26 +09:00
6 changed files with 43 additions and 14 deletions

View file

@ -4,10 +4,13 @@
#include <AK/Vector.h>
#include <Kernel/KBuffer.h>
typedef void* (*ModuleInitPtr)();
typedef void* (*ModuleFiniPtr)();
struct Module {
String name;
Vector<KBuffer> sections;
};
typedef void* (*ModuleInitPtr)();
typedef void* (*ModuleFiniPtr)();
ModuleInitPtr module_init { nullptr };
ModuleFiniPtr module_fini { nullptr };
};