kmod: prepare for kernel module loading
This commit is contained in:
parent
30017592ad
commit
d017412af5
3 changed files with 31 additions and 4 deletions
|
@ -9,9 +9,12 @@ The Soaplin kernel is a new Unix-like operating system kernel.
|
|||
* ELF loader
|
||||
* ACPI
|
||||
* Symetric Multiprocessing (It runs code, but the scheduler is running on 1 processor.)
|
||||
* Recovers from a faulty userspace process.
|
||||
|
||||
## Nearly done
|
||||
* Virtual File System
|
||||
|
||||
## In the works
|
||||
* Virtual File System
|
||||
* FPU support
|
||||
|
||||
## To come
|
||||
|
@ -21,9 +24,6 @@ The Soaplin kernel is a new Unix-like operating system kernel.
|
|||
* TAR-based init ram disk
|
||||
* Video driver for Bochs graphics adapter, and the VMware display adapter.
|
||||
|
||||
## Known bugs
|
||||
* If a user process calls the syscall handler by using interrupts, the system may crash due to a Page Fault.
|
||||
|
||||
## Building
|
||||
To build Soaplin, you must ensure you have these:
|
||||
* The Netwide Assembler (nasm)
|
||||
|
|
|
@ -57,6 +57,11 @@ SECTIONS
|
|||
.data : {
|
||||
data_start_ld = .;
|
||||
*(.data .data.*)
|
||||
|
||||
/* Exported kernel symbols */
|
||||
__start_ksyms = .;
|
||||
KEEP(*(.ksyms))
|
||||
__stop_ksyms = .;
|
||||
} :data
|
||||
|
||||
/* NOTE: .bss needs to be the last thing mapped to :data, otherwise lots of */
|
||||
|
|
22
kernel/src/dbg/export.h
Normal file
22
kernel/src/dbg/export.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// At Soaplin, we aren't doing module racism based on the license. (Ḭ̸̡̢̨̧̨̛͍͚̙̺̦̩͕̮̙̙̳̮͉̝̙̜͓̪͇̠̪̣̻̰͕̲̲̘̖̦͖͕͎̲̹͖̮̳̻̞̌͋̋̆͛̉͆ ̸̨͕͎̣̥͖͔̳̫̳͚̯̬̙̘͓̹̼̻̼̈̓̉ͅͅs̶̟͉̠̣̞͎͍̘̟̝̱̩̃͛̽͛̆͌̆̒̔̈́̎̿̐̈́͐̓̓͒͌̈̀̓͗̋̕͜͜͝͠͝͠ͅȩ̸̡̛͔̦̲̦̼̹̙̲͖͎̼̝̯̦̞̜͍̀̈́̈́͂̈́̍́̆̆̔͗́̆̀͑̀̔͆̄͐͐̆͠ę̸̨̢̢̧̛̛͕̱̯̲̦͕͖̦̝̯̮̤̫͙͔̲̬̯̗̗͈̬̳̙͙̼͉̩͚̼̮͚̖̰̗̤͓̘͂̾̒͋̀͂̏́̂̋̅̆̋̈̔̈́̀̔̈́̊̓͂͌̋̂́̍̀͒͊͊̓͌̃̚͘͜͝͠ ̸̧̡̧͍̼̹͇̞̘͇̯̞̣̝̲̳̦̟̱͇̥͈̟̝̹̳̫͕̜̬̥̯̬̟̤̖̹̙̩̰̈͗͆͌̊̽̾͝͝ͅy̵̡̡̢̞̭͔̰͔͔̖̥͕̙̳̯͍͉̦̦͓̥̞̝͖͕̰̼͖̲̮͚̲̜̰̱̘̯̤̌́̏̄̏́̈́̓ͅỡ̵̢̢̢̖̠͉̖̺̻̣̜̬̮͓̫͎͖͎̤̪̝̗̰͕͍͖̖̟͙͍̻̑͊̃̃̒̍̆̎̋̿͐̋̉̇̾͆̿̌̃̏̽̊̀͒̇̏̓̾̏̈́̓̿̏̚͠͝͝͝ͅu̸̧͕̟͉͉͖̰̝͕̞̪̖͙͙̅̒̅̂̑́,̶̢̡̡̧̛̲̬̞̘̻̗̩̫̗͓̪̬͚̗̖͕̰̣͙͍̯͇̩̭͎̖̝̬̻͖̟̩̙̩̝͓̤́̄̆̍̂̈̊̄͆̽̑̑̊̓̋͐̔̉̍͌̏̀̿͘͜͜͜ͅͅ ̴̢̛̛͈͚̳̣̮̬̲̲͈̮͓̭̗̈́̽̄͌̾̒́̔̌̐̽͋̓̄̉̆̑̃́̏̉̔̓̂̽̊͆̽̎̍̈͑́̌͑̍̕͘͘͝͠ͅL̵̙̯̦̬̱͍̣̹̱̝̓̒i̵̢̨̨̧̨̛̗̲͍͇̖̥̯͔̙̪̱͓̝̦̼̭̬̟̞̩̭͙̐̐͊̒͑̊͌̽̂̉͊̈́̌͒̆̐͐͒̉̀́̑́̅͛͐̕̕͝͝ͅͅņ̵̛͓̲͆̏̃̊̒̇̑̑̾̽͊̃͌̔́̌̈́̈́͛͆̒̀̿̎͒̑̃̈́̈́͂͐͂̕̚̕͘͜͠͠ư̸̧̯̤̲͚͖̯͖͈̠̽̏̈́̄̀͒̐̅̽̋̓̂̑̋̽͒̄̑̇̈́̆̈͛͆̿̈̉͆͗͊̎͂̇̽̋̅͊̀̚̚͝ś̶̛̗̥͇̖̠͓͆̀̅̓̓͆͆̐́̄͛̃͑̔̑̒͒͋͂̂́͋͂́͗̐͆̐̕͝͝͠)
|
||||
|
||||
typedef struct {
|
||||
const char* name;
|
||||
uint64_t addr;
|
||||
uint64_t size;
|
||||
} kernel_symbol_t;
|
||||
|
||||
#define EXPORT_SYMBOL(sym) \
|
||||
static const kernel_symbol_t __ksym_##sym \
|
||||
__attribute__((section(".ksyms"), used)) = { \
|
||||
.name = #sym, \
|
||||
.addr = (uint64_t)&sym, \
|
||||
.size = sizeof(sym) \
|
||||
}
|
||||
|
||||
extern const kernel_symbol_t __start_ksyms[];
|
||||
extern const kernel_symbol_t __stop_ksyms[];
|
Loading…
Add table
Add a link
Reference in a new issue