From ca36e0ad0e6b5a7cfbc11937d638d0c3283f91aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lov=C3=A9n?= Date: Tue, 31 Oct 2017 09:00:16 +0100 Subject: [PATCH] Indicate multiboot version on boot --- src/kernel/boot/boot.S | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/kernel/boot/boot.S b/src/kernel/boot/boot.S index 1fcb671..b4a0a83 100644 --- a/src/kernel/boot/boot.S +++ b/src/kernel/boot/boot.S @@ -7,11 +7,27 @@ _start: cli -# Save the multiboot magic number mov ecx, eax -// Print a red exclamation mark in top left corner -mov eax, 0x0421 -mov short [0xB8000], ax -// and loop infinitely +// Print a red digit in the upper left corner to indicate the multiboot version +// If not loaded by multiboot, print an exclamation mark +cmp eax, MBOOT1_REPLY +je mboot1 +cmp eax, MBOOT2_REPLY +je mboot2 +mov eax, 0x0421 // Red exclamation point +jmp print + +mboot1: +mov eax, 0x0431 // Red 1 +jmp print + +mboot2: +mov eax, 0x0432 // Red 2 +jmp print + +print: +mov short [0xB8000], ax // Place in upper left corner + +// loop infinitely jmp $