Restructuration part 2: libc, programs

This commit is contained in:
xamidev
2024-07-19 17:40:53 +02:00
parent 014b0d2b50
commit b8faf9dd8e
24 changed files with 17 additions and 12 deletions

36
src/kernel/kmain.c Normal file
View File

@@ -0,0 +1,36 @@
#include "../libc/stdio.h"
#include "serial.h"
#include "gdt.h"
#include "idt.h"
#include "system.h"
int kmain(int retvalue)
{
init_serial();
log("serial connection established", 3);
gdt_install();
log("initialized GDT entries", 2);
idt_install();
log("initialized IDT", 2);
isr_install();
log("initialized ISRs", 2);
irq_install();
__asm__ __volatile__("sti");
log("initialized IRQs", 2),
log("kernel started", 2);
clear();
colorputs("Blank OS version 1 iteration 3 minor 20\n", 10);
// TODO: Serial printf to dump registers on kernel panic
// TODO: Fix scrolling bug (framebuffer driver)
// TODO: Fix keyboard driver bug (some keys mapped weirdly) + add suport for SHIFT and backspace (deleting character)
// TODO: Grub modules to load programs
//timer_install();
keyboard_install();
return retvalue;
}