2024-09-21 06:17:27 -04:00
|
|
|
#include "alloc.h"
|
2024-09-10 14:03:33 -04:00
|
|
|
#include "gdt.h"
|
2024-09-19 11:04:35 -04:00
|
|
|
#include "kprintf.h"
|
2024-09-18 11:14:06 -04:00
|
|
|
#include "memory.h"
|
2024-09-10 14:03:33 -04:00
|
|
|
#include "shell.h"
|
2024-09-19 11:04:35 -04:00
|
|
|
#include "string.h"
|
2024-09-07 06:11:38 -04:00
|
|
|
#include "terminal.h"
|
2024-09-06 19:44:40 -04:00
|
|
|
|
2024-09-06 17:36:07 -04:00
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
/* Check if the compiler thinks you are targeting the wrong operating system. */
|
|
|
|
#if defined(__linux__)
|
|
|
|
#error \
|
|
|
|
"You are not using a cross-compiler, you will most certainly run into trouble"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* This tutorial will only work for the 32-bit ix86 targets. */
|
|
|
|
#if !defined(__i386__)
|
|
|
|
#error "This tutorial needs to be compiled with a ix86-elf compiler"
|
|
|
|
#endif
|
|
|
|
|
2024-09-07 06:11:38 -04:00
|
|
|
void kernel_main(void)
|
|
|
|
{
|
|
|
|
terminal_initialize();
|
2024-09-17 05:10:41 -04:00
|
|
|
init_gdt();
|
2024-09-18 11:14:06 -04:00
|
|
|
init_memory();
|
2024-09-20 06:40:36 -04:00
|
|
|
kprintf(KERN_CRIT "KERN_CRIT\n");
|
|
|
|
kprintf(KERN_ALERT "KERN_ALERT\n");
|
|
|
|
kprintf(KERN_WARNING "KERN_WARNING\n");
|
|
|
|
kprintf(KERN_NOTICE "KERN_NOTICE\n");
|
|
|
|
kprintf(KERN_INFO "KERN_INFO\n");
|
|
|
|
kprintf(KERN_DEBUG "KERN_DEBUG\n");
|
2024-09-10 14:03:33 -04:00
|
|
|
shell_init();
|
2024-09-06 17:36:07 -04:00
|
|
|
}
|