mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-11 09:18:05 +03:00
ef32c71683
This will show up in /proc/modules, and is also the name you can pass to the module_unload() syscall for unloading the module.
22 lines
495 B
C++
22 lines
495 B
C++
#include <Kernel/kstdio.h>
|
|
#include <Kernel/Process.h>
|
|
|
|
extern "C" const char module_name[] = "TestModule";
|
|
|
|
extern "C" void module_init()
|
|
{
|
|
kprintf("TestModule has booted!\n");
|
|
|
|
for (int i = 0; i < 3; ++i) {
|
|
kprintf("i is now %d\n", i);
|
|
}
|
|
|
|
kprintf("current pid: %d\n", current->process().sys$getpid());
|
|
kprintf("current process name: %s\n", current->process().name().characters());
|
|
}
|
|
|
|
extern "C" void module_fini()
|
|
{
|
|
kprintf("TestModule is being removed!\n");
|
|
}
|