mirror of
https://github.com/tailix/kernel.git
synced 2024-10-30 12:03:52 -04:00
35 lines
911 B
C
35 lines
911 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 $0x0");
|
|
asm volatile ("int $0x3");
|
|
asm volatile ("int $0x4");
|
|
asm volatile ("int $0xF");
|
|
asm volatile ("int $0x10");
|
|
asm volatile ("int $0x1F");
|
|
|
|
logger_warn("Nothing to do.");
|
|
logger_fail("Halt.");
|
|
}
|