From c65797d89f167747f0087fbbb0395fe45502a9c7 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Mon, 17 Aug 2015 15:06:29 +0200 Subject: [PATCH] Add an 64-bit error function --- src/arch/x86_64/long_mode_init.asm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/arch/x86_64/long_mode_init.asm b/src/arch/x86_64/long_mode_init.asm index a8193beb..4640c0b1 100644 --- a/src/arch/x86_64/long_mode_init.asm +++ b/src/arch/x86_64/long_mode_init.asm @@ -25,3 +25,13 @@ long_mode_start: mov rax, 0x2f592f412f4b2f4f mov qword [0xb8000], rax hlt + +; Prints `ERROR: ` and the given error code to screen and hangs. +; parameter: error code (in ascii) in al +error: + mov rbx, 0x4f4f4f524f524f45 + mov [0xb8000], rbx + mov rbx, 0x4f204f204f3a4f52 + mov [0xb8008], rbx + mov byte [0xb800e], al + hlt