Indicate multiboot version on boot

This commit is contained in:
Thomas Lovén 2017-10-31 09:00:16 +01:00
parent a44d0d7500
commit ca36e0ad0e

View File

@ -7,11 +7,27 @@
_start: _start:
cli cli
# Save the multiboot magic number
mov ecx, eax mov ecx, eax
// Print a red exclamation mark in top left corner // Print a red digit in the upper left corner to indicate the multiboot version
mov eax, 0x0421 // If not loaded by multiboot, print an exclamation mark
mov short [0xB8000], ax cmp eax, MBOOT1_REPLY
// and loop infinitely 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 $ jmp $