diff options
Diffstat (limited to 'src/kernel/arch/i386/boot.s')
-rw-r--r-- | src/kernel/arch/i386/boot.s | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/kernel/arch/i386/boot.s b/src/kernel/arch/i386/boot.s index 0101b40..9fd7d5d 100644 --- a/src/kernel/arch/i386/boot.s +++ b/src/kernel/arch/i386/boot.s @@ -7,6 +7,16 @@ _start: push %ebx // address of the Multiboot struct call kmain_early +.global cpu_shutdown +.type cpu_shutdown, @function +cpu_shutdown: +/* This quits QEMU. While I couldn't find this officially documented anywhere, + * it is used by QEMU in tests/tcg/i386/system/boot.S (as of commit 40d6ee), so + * I assume that this is safe-ish to use */ + mov $0x604, %edx + mov $0x2000, %eax + outw %ax, %dx + .global halt_cpu .type halt_cpu, @function halt_cpu: |