Prematurely jumping into kernel_main

This commit is contained in:
Justin C. Miller
2018-03-19 17:04:35 -07:00
parent e4bd24bfe3
commit 47ebdc7f41
4 changed files with 19 additions and 12 deletions

View File

@@ -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);
}

View File

@@ -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();

View File

@@ -1,4 +1,5 @@
__attribute__((used))
int kernel_main() {
return 42;
__attribute__((section(".text.entry")))
void kernel_main() {
volatile int foo = 13;
return;
}