1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2025-04-14 17:33:13 -04:00

Check for Multiboot bootloader

This commit is contained in:
Braiden Vasco 2017-11-01 08:25:39 +00:00
parent fe422cfb09
commit 68c0958bee
2 changed files with 13 additions and 1 deletions

View file

@ -22,6 +22,7 @@ stack_top:
.type _start, @function
_start:
mov $stack_top, %esp
push %eax // uint32_t multiboot_magic
call main
cli
1:

View file

@ -2,9 +2,20 @@
#include "gdt.h"
#include "idt.h"
void main()
void main(uint32_t multiboot_magic)
{
logger_initialize();
if (multiboot_magic == 0x2BADB002) {
logger_info("Loaded with Multiboot-compliant bootloader, specification version 1.");
}
else if (multiboot_magic == 0x36d76289) {
logger_info("Loaded with Multiboot-compliant bootloader, specification version 2.");
}
else {
logger_warn("Loaded with no Multiboot-compliant bootloader.");
}
logger_info("Kernel initialization started.");
gdt_initialize();