acadia/zion/zion.cpp
Drew Galbraith 629dca278b Enable the PIC and add a timer.
This causes a GP fault after the timer runs for some time.
2023-05-29 21:52:01 -07:00

35 lines
731 B
C++

#include <stdint.h>
#include "common/gdt.h"
#include "debug/debug.h"
#include "interrupt/interrupt.h"
#include "interrupt/timer.h"
#include "loader/init_loader.h"
#include "memory/kernel_heap.h"
#include "memory/paging_util.h"
#include "memory/physical_memory.h"
#include "scheduler/scheduler.h"
#include "syscall/syscall.h"
extern "C" void zion() {
InitGdt();
InitIdt();
InitPaging();
phys_mem::InitBootstrapPageAllocation();
KernelHeap heap(0xFFFFFFFF'40000000, 0xFFFFFFFF'80000000);
phys_mem::InitPhysicalMemoryManager();
InitSyscall();
SetFrequency(/* hertz= */ 2000);
sched::InitScheduler();
sched::EnableScheduler();
LoadInitProgram();
sched::Yield();
dbgln("Sleeping!");
while (1)
;
}