mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 20:18:12 +00:00
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.
This commit is contained in:
parent
c10a5ac4ad
commit
6b150c794a
11 changed files with 198 additions and 3 deletions
15
Userland/modload.cpp
Normal file
15
Userland/modload.cpp
Normal file
|
@ -0,0 +1,15 @@
|
|||
#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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue