2023-05-17 20:20:53 -07:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2023-05-17 21:41:08 -07:00
|
|
|
#include "common/gdt.h"
|
2023-05-17 20:42:59 -07:00
|
|
|
#include "debug/debug.h"
|
2023-05-17 22:54:37 -07:00
|
|
|
#include "interrupt/interrupt.h"
|
2023-05-29 00:32:54 -07:00
|
|
|
#include "loader/init_loader.h"
|
2023-05-18 09:46:41 -07:00
|
|
|
#include "memory/kernel_heap.h"
|
2023-05-18 01:18:51 -07:00
|
|
|
#include "memory/paging_util.h"
|
2023-05-18 11:00:05 -07:00
|
|
|
#include "memory/physical_memory.h"
|
2023-05-18 12:43:53 -07:00
|
|
|
#include "scheduler/scheduler.h"
|
2023-05-18 16:03:09 -07:00
|
|
|
#include "syscall/syscall.h"
|
2023-05-17 20:20:53 -07:00
|
|
|
|
|
|
|
extern "C" void zion() {
|
2023-05-17 21:41:08 -07:00
|
|
|
InitGdt();
|
2023-05-17 22:54:37 -07:00
|
|
|
InitIdt();
|
2023-05-18 01:18:51 -07:00
|
|
|
InitPaging();
|
2023-05-18 01:16:53 -07:00
|
|
|
|
2023-05-18 11:00:05 -07:00
|
|
|
phys_mem::InitBootstrapPageAllocation();
|
2023-05-18 09:46:41 -07:00
|
|
|
KernelHeap heap(0xFFFFFFFF'40000000, 0xFFFFFFFF'80000000);
|
2023-05-18 11:34:45 -07:00
|
|
|
phys_mem::InitPhysicalMemoryManager();
|
2023-05-18 12:43:53 -07:00
|
|
|
|
2023-05-18 16:03:09 -07:00
|
|
|
InitSyscall();
|
|
|
|
|
2023-05-18 12:43:53 -07:00
|
|
|
sched::InitScheduler();
|
2023-05-18 13:24:02 -07:00
|
|
|
sched::EnableScheduler();
|
2023-05-29 00:32:54 -07:00
|
|
|
|
|
|
|
LoadInitProgram();
|
2023-05-18 13:24:02 -07:00
|
|
|
sched::Yield();
|
2023-05-17 20:20:53 -07:00
|
|
|
|
2023-05-18 11:00:05 -07:00
|
|
|
dbgln("Sleeping!");
|
2023-05-17 20:20:53 -07:00
|
|
|
while (1)
|
|
|
|
;
|
|
|
|
}
|