aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/src/boot
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2024-10-17 13:12:29 +0200
committerMatteo Gmür <matteo.gmuer1@ost.ch>2024-10-17 13:12:29 +0200
commitb865b36b38d951de28cc4df5fa67338b8245a1c3 (patch)
tree694825047086e18855bdb34fc24698292f6258ff /arch/x86_64/src/boot
parentd539ed1f4f26a42959bcae6ea3050b7f99f5f872 (diff)
downloadteachos-b865b36b38d951de28cc4df5fa67338b8245a1c3.tar.xz
teachos-b865b36b38d951de28cc4df5fa67338b8245a1c3.zip
Implement support for `std::terminate` via `::abort`
Diffstat (limited to 'arch/x86_64/src/boot')
-rw-r--r--arch/x86_64/src/boot/boot.s13
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/x86_64/src/boot/boot.s b/arch/x86_64/src/boot/boot.s
index 2aa30c6..710d4ce 100644
--- a/arch/x86_64/src/boot/boot.s
+++ b/arch/x86_64/src/boot/boot.s
@@ -82,6 +82,7 @@ global_descriptor_table_pointer:
* We are going to print some messages in case we panic during boot, so we are
* going to store them here as well
*/
+.global message_prefix_panic
message_prefix_panic:
.string "TeachOS Panic: "
message_not_loaded_by_multiboot2:
@@ -109,6 +110,12 @@ vga_buffer_pointer: .long 0xb8000
.align 16
.code32
+.global halt
+halt:
+1:
+ hlt
+ jmp 1b
+
/**
* Print a given panic message and then halt the machine.
*
@@ -129,7 +136,7 @@ _panic:
call _print
add $8, %esp
- hlt
+ call halt
/**
* Print a message via the VGA buffer.
@@ -189,7 +196,7 @@ _start:
lgdt (global_descriptor_table_pointer)
jmp $global_descriptor_table_code,$_transition_to_long_mode
- hlt
+ call halt
/**
* Assert that the CPU supports going into long mode.
@@ -354,4 +361,4 @@ _transition_to_long_mode:
call _init
call kernel_main
- hlt
+ call halt