move keyboard and mouse out of HAL into a standalone ps2.sys driver, implement usb stack with xhci controller discovery, hid keyboard/mouse, and bulk-only mass storage, add pci msi support with capability chain walking and software irq vector allocation (slots 16-23), rewrite user virtual memory as a USER_VA_REGION descriptor arena with per-process ownership tracking and guard page support, replacing the old bump allocator and top-down image region, add MmCreateUserRegion/MmDestroyAllUserRegions so process teardown reclaims all user va in one pass, allocate a pool-backed shadow framebuffer in hal_screen to fix cursor tearing and scroll corruption, reserve ap trampoline page below 1mb in uefi bootloader before boot services exit, rewrite memset/memcpy/memmove/memcmp with __stosq/__movsq intrinsics, promote driver flag literals to macros and add multi-tu STANDALONE_DRIVERS table to build.c, split rtl8139/rtl816x into header+source, rename KbReadScancode to KbReadKey, improve page fault output with MmDebugDescribeAddress and user region dump, fix %p to %016llX throughout.

This commit is contained in:
maksw committed 2026-06-02 00:01:20 +02:00
1 parent b970d7f59c
commit b838f8d83d
130 files changed
+8137 -2932

No files matched your search

+19 -1
View File
@@ -20,6 +20,7 @@
#include <ntlite/boot_info.h>
#include <ntlite/memory_map.h>
#include <common/ini_parser.h>
#pragma intrinsic(_disable)
int _fltused = 0;
@@ -287,6 +288,21 @@ static void DriversIniCb(const char* section, const char* key,
// ---------------------------------------------------------------------------
// EFI Memory Map -> MEMORY_MAP conversion
// ---------------------------------------------------------------------------
static EFI_PHYSICAL_ADDRESS AllocateApTrampolinePageBelow1M(void) {
// AP startup via SIPI requires the first instruction page to live below
// 1 MiB. Some real UEFI firmware exposes no ConventionalMemory below
// 640 KiB after ExitBootServices, so reserve a loader-data page here while
// boot services can still satisfy AllocateMaxAddress.
EFI_PHYSICAL_ADDRESS phys = 0x0009F000ULL;
EFI_STATUS st = gBS->AllocatePages(AllocateMaxAddress, EfiLoaderData, 1, &phys);
if (EFI_ERROR(st) || phys == 0 || phys >= 0x000A0000ULL || (phys & 0xFFFULL)) {
return 0;
}
gBS->SetMem((VOID*)phys, PAGE_SIZE, 0);
return phys;
}
static void ConvertMemoryMap(MEMORY_MAP* out) {
UINTN mapSize = 0, descSz = 0, mapKey; UINT32 descVer;
gBS->GetMemoryMap(&mapSize, NULL, &mapKey, &descSz, &descVer);
@@ -738,6 +754,8 @@ EFI_STATUS EFIAPI UefiMain(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE* SystemTable
//Print(L"7\n");
bi->ApTrampolinePhys = (uintptr_t)AllocateApTrampolinePageBelow1M();
// --- Map physical RAM as direct window AND identity map ---
UINTN mapSize = 0, descSz = 0, mapKey; UINT32 descVer;
gBS->GetMemoryMap(&mapSize, NULL, &mapKey, &descSz, &descVer);
@@ -880,7 +898,7 @@ EFI_STATUS EFIAPI UefiMain(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE* SystemTable
}
// Print it out to verify the bootloader actually found it before launching the kernel
//Print(L"Found RSDP at: 0x%llx\n", bi->RsdpPhysical);
//Print(L"Found RSDP at: 0x%016llX\n", bi->RsdpPhysical);
bi->PhysicalMapBase = PHYS_MAP_BASE;
bi->Debug = (UINT32)ps.debug;