1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2024-10-30 12:03:52 -04:00
kernel/arch/main.c
2017-11-01 10:25:30 +00:00

31 lines
785 B
C

#include <kernelmq/multiboot.h>
#include "logger.h"
#include "gdt.h"
#include "idt.h"
void main(unsigned int multiboot_magic)
{
logger_initialize();
if (multiboot_magic == KERNELMQ_MULTIBOOT_1_MAGIC) {
logger_info("Loaded with Multiboot-compliant bootloader, specification version 1.");
}
else if (multiboot_magic == KERNELMQ_MULTIBOOT_2_MAGIC) {
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();
idt_initialize();
asm volatile ("int $0x3");
asm volatile ("int $0x4");
logger_warn("Nothing to do.");
logger_fail("Halt.");
}