1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 19:05:06 +00:00
serenity/Userland/modload.cpp
Andreas Kling 6b150c794a Kernel: Implement very simple kernel module loading
It's now possible to load a .o file into the kernel via a syscall.
The kernel will perform all the necessary ELF relocations, and then
call the "module_init" symbol in the loaded module.
2019-11-28 20:59:11 +01:00

15 lines
284 B
C++

#include <serenity.h>
#include <string.h>
int main(int argc, char** argv)
{
(void)argc;
(void)argv;
const char* path = "/TestModule.o";
int rc = module_load(path, strlen(path));
if (rc < 0) {
perror("module_load");
return 1;
}
return 0;
}