mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2025-03-14 12:05:07 +00:00
ZealBooter: Add minimal code to get kernel address
This commit is contained in:
parent
69f0f37b9b
commit
325160e13b
1 changed files with 12 additions and 0 deletions
|
@ -6,6 +6,11 @@
|
||||||
// the compiler does not optimise them away, so, usually, they should
|
// the compiler does not optimise them away, so, usually, they should
|
||||||
// be made volatile or equivalent.
|
// be made volatile or equivalent.
|
||||||
|
|
||||||
|
static volatile struct limine_module_request module_request = {
|
||||||
|
.id = LIMINE_MODULE_REQUEST,
|
||||||
|
.revision = 0
|
||||||
|
};
|
||||||
|
|
||||||
static volatile struct limine_terminal_request terminal_request = {
|
static volatile struct limine_terminal_request terminal_request = {
|
||||||
.id = LIMINE_TERMINAL_REQUEST,
|
.id = LIMINE_TERMINAL_REQUEST,
|
||||||
.revision = 0
|
.revision = 0
|
||||||
|
@ -17,6 +22,10 @@ static void done(void) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct CKernel {
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
// The following will be our kernel's entry point.
|
// The following will be our kernel's entry point.
|
||||||
void _start(void) {
|
void _start(void) {
|
||||||
// Ensure we got a terminal
|
// Ensure we got a terminal
|
||||||
|
@ -30,6 +39,9 @@ void _start(void) {
|
||||||
struct limine_terminal *terminal = terminal_request.response->terminals[0];
|
struct limine_terminal *terminal = terminal_request.response->terminals[0];
|
||||||
terminal_request.response->write(terminal, "Hello World", 11);
|
terminal_request.response->write(terminal, "Hello World", 11);
|
||||||
|
|
||||||
|
struct limine_file *kernel = module_request.response->modules[0];
|
||||||
|
struct CKernel *CKernel = kernel->address;
|
||||||
|
|
||||||
// We're done, just hang...
|
// We're done, just hang...
|
||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue