kernel - v0.7 beta

+ acpi: add acpi support
+ lapic: add lapic support
+ ioapic: add ioapic support
+ arch/x86_64: add support for "syscall"/"sysret"
This commit is contained in:
RaphProductions 2025-05-15 18:49:09 +02:00
parent 4d52bac946
commit a8e919b033
53 changed files with 772 additions and 331 deletions

View file

@ -0,0 +1,29 @@
#include "arch//x86_64/idt.h"
#include "sched/sched.h"
#include <stdint.h>
#include <sys/log.h>
#include <arch//x86_64/idt.h>
#include <arch//x86_64/pit.h>
uint32_t tick = 0;
void pit_handler(registers_t *regs) {
//log("PIT");
tick++;
schedule(regs);
}
void pit_init() {
outb(0x43, 0x36);
uint16_t div = (uint16_t)(1193180 / 1000);
outb(0x40, (uint8_t)div);
outb(0x40, (uint8_t)(div >> 8));
idt_register_irq(0, pit_handler);
}
void pit_sleep(uint32_t ms) {
uint64_t start = tick;
while (tick - start < ms) {
__asm__ volatile ("nop");
}
}