// SPDX-License-Identifier: GPL-3.0-or-later // Copyright (c) 2026 0xKSor #include "../Common/bootinfo.h" #include #include #include #include #include #include #include #include #include #include #include void KernelMain(Bootinfo* bootinfo) { OSLog("Kernel started.\n"); if (bootinfo->magic != BOOTINFO_MAGIC) { OSPanic("Invalid bootinfo magic"); } VMBootMemoryMap bootMap = {0}; bootMap.reservedCount = 0; DTBParse(bootinfo->dtb, &bootMap); PMMInitialize(&bootMap); VMMInitialize(&bootMap, bootinfo); SerialUpdate(VMPhysToHHDM(bootMap.UART.base)); HeapInitialize(); GICInitialize( (Pointer)VMPhysToHHDM(bootMap.GIC.GICD.base), (Pointer)VMPhysToHHDM(bootMap.GIC.GICC.base) ); TimerInitialize(); CPUEnableInterrupts(); SchedulerInitialize(); OSLog("Kernel initialized.\n"); }