acadia/zion/zion.cpp

36 lines
731 B
C++
Raw Normal View History

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