mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-07 16:40:59 +00:00
a43b115a6c
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.
16 lines
264 B
C++
16 lines
264 B
C++
#include <Kernel/kstdio.h>
|
|
|
|
extern "C" void module_init()
|
|
{
|
|
kprintf("TestModule has booted!\n");
|
|
|
|
for (int i = 0; i < 99; ++i) {
|
|
kprintf("i is now %d\n", i);
|
|
}
|
|
}
|
|
|
|
extern "C" void module_fini()
|
|
{
|
|
kprintf("TestModule is being removed!\n");
|
|
}
|