37 lines
960 B
C
37 lines
960 B
C
#include "alloc.h"
|
|
#include "gdt.h"
|
|
#include "kprintf.h"
|
|
#include "memory.h"
|
|
#include "shell.h"
|
|
#include "string.h"
|
|
#include "terminal.h"
|
|
|
|
#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
|
|
|
|
void kernel_main(void)
|
|
{
|
|
terminal_initialize();
|
|
init_gdt();
|
|
init_memory();
|
|
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");
|
|
shell_init();
|
|
}
|