mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
Prematurely jumping into kernel_main
This commit is contained in:
@@ -5,22 +5,24 @@ SECTIONS
|
||||
|
||||
.text : {
|
||||
code = .;
|
||||
*(.text.entry)
|
||||
*(.text)
|
||||
. = ALIGN(4096);
|
||||
}
|
||||
|
||||
.data : {
|
||||
.data ALIGN(0x1000) : {
|
||||
data = .;
|
||||
*(.data)
|
||||
*(.rodata)
|
||||
. = ALIGN(4096);
|
||||
}
|
||||
|
||||
.bss : {
|
||||
.bss ALIGN(0x1000) : {
|
||||
bss = .;
|
||||
*(.bss)
|
||||
. = ALIGN(4096);
|
||||
}
|
||||
|
||||
end = .;
|
||||
.note ALIGN(0x1000) : {
|
||||
*(.note.*)
|
||||
}
|
||||
|
||||
end = ALIGN(4096);
|
||||
}
|
||||
|
||||
@@ -43,6 +43,9 @@ efi_main (EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
|
||||
Print(L" %u bytes at 0x%x", kernel_length, kernel_image);
|
||||
con_status_ok();
|
||||
|
||||
void (*kernel_main)() = kernel_image;
|
||||
kernel_main();
|
||||
|
||||
/*
|
||||
con_status_begin(L"Virtualizing memory...");
|
||||
status = memory_virtualize();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
__attribute__((used))
|
||||
int kernel_main() {
|
||||
return 42;
|
||||
__attribute__((section(".text.entry")))
|
||||
void kernel_main() {
|
||||
volatile int foo = 13;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user