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:
parent
fe422cfb09
commit
68c0958bee
2 changed files with 13 additions and 1 deletions
|
@ -22,6 +22,7 @@ stack_top:
|
|||
.type _start, @function
|
||||
_start:
|
||||
mov $stack_top, %esp
|
||||
push %eax // uint32_t multiboot_magic
|
||||
call main
|
||||
cli
|
||||
1:
|
||||
|
|
13
arch/main.c
13
arch/main.c
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue