
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.
15 lines
264 B
C++
15 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");
|
|
}
|