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

+48
View File
@@ -0,0 +1,48 @@
// ps2.h - shared i8042/PS/2 driver internals.
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include <intrin.h>
#include <ntlite/status.h>
#include <ntlite/ddi/hal_api.h>
#include <ntlite/ddi/input_device.h>
#include <kernel/ke_debug.h>
#include <kernel/ke_irq.h>
#include <kernel/ke_dpc.h>
#define PS2_DATA 0x60u
#define PS2_STAT 0x64u
#define PS2_CMD 0x64u
#define PS2_STAT_OUT_FULL 0x01u
#define PS2_STAT_IN_FULL 0x02u
#define PS2_IRQ_KEYBOARD 1u
#define PS2_IRQ_MOUSE 12u
#define SC1_BREAK_BIT 0x80u
#define SC1_MAKE_MASK 0x7Fu
#define SC1_EXT_PREFIX 0xE0u
#define MOUSE_DPC_QUEUE_SIZE 64u
#define MOUSE_DPC_QUEUE_MASK (MOUSE_DPC_QUEUE_SIZE - 1u)
typedef struct PS2_MOUSE_PACKET {
int dx;
int dy;
uint8_t buttons;
} PS2_MOUSE_PACKET;
void Ps2Pause(void);
void Ps2WaitInput(void);
bool Ps2WaitOutput(void);
void Ps2FlushOutput(void);
uint8_t Ps2ReadData(void);
void Ps2WriteCommand(uint8_t command);
void Ps2WriteData(uint8_t data);
uint8_t Ps2ReadCommandByte(void);
void Ps2WriteCommandByte(uint8_t commandByte);
bool Ps2SendKeyboard(uint8_t byte);
bool Ps2SendMouse(uint8_t byte);