mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-11 13:35:03 -04:00
Initialize logging earlier
This commit is contained in:
parent
3d61d91765
commit
1ba2207c6c
@ -31,14 +31,18 @@
|
|||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
|
void _init();
|
||||||
|
|
||||||
void __cxa_pure_virtual(){
|
void __cxa_pure_virtual(){
|
||||||
k_print_line("A pure virtual function has been called");
|
k_print_line("A pure virtual function has been called");
|
||||||
suspend_kernel();
|
suspend_kernel();
|
||||||
}
|
}
|
||||||
|
|
||||||
void _init();
|
} //end of extern "C"
|
||||||
|
|
||||||
void kernel_main(){
|
void kernel_main() __attribute__((section(".start")));
|
||||||
|
|
||||||
|
void kernel_main(){
|
||||||
//Make sure stack is aligned to 16 byte boundary
|
//Make sure stack is aligned to 16 byte boundary
|
||||||
asm volatile("and rsp, -16");
|
asm volatile("and rsp, -16");
|
||||||
|
|
||||||
@ -46,14 +50,15 @@ void kernel_main(){
|
|||||||
|
|
||||||
gdt::flush_tss();
|
gdt::flush_tss();
|
||||||
|
|
||||||
interrupt::setup_interrupts();
|
|
||||||
|
|
||||||
// Necessary for logging with Qemu
|
// Necessary for logging with Qemu
|
||||||
serial::init();
|
serial::init();
|
||||||
|
|
||||||
//Starting from here, the logging system can stop saving early logs
|
//Starting from here, the logging system can stop saving early logs
|
||||||
logging::finalize();
|
logging::finalize();
|
||||||
|
|
||||||
|
// Setup interrupts
|
||||||
|
interrupt::setup_interrupts();
|
||||||
|
|
||||||
//Compute virtual addresses for paging
|
//Compute virtual addresses for paging
|
||||||
paging::early_init();
|
paging::early_init();
|
||||||
|
|
||||||
@ -125,8 +130,6 @@ void kernel_main(){
|
|||||||
scheduler::start();
|
scheduler::start();
|
||||||
}
|
}
|
||||||
|
|
||||||
} //end of extern "C"
|
|
||||||
|
|
||||||
void suspend_boot(){
|
void suspend_boot(){
|
||||||
k_print_line("Impossible to continue boot...");
|
k_print_line("Impossible to continue boot...");
|
||||||
suspend_kernel();
|
suspend_kernel();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user