add a realtime scheduler class and priority-inheritance mutexes with timeouts and abandonment, add an HDA audio driver and a SYS_AUDIO_* syscall family, flesh out kernel32 with Win32 threads, events, mutexes, critical sections, and condition variables, add SYS_RESUME_THREAD for suspended thread creation, add KeInitializeMemoryTypes to reprogram MTRRs and install a canonical PAT for WB/WC/UC control, rework the display pipeline with a pitched present path and console output flush, bring back disk.vhd with mtools since vvfat fucking sucks, harden AHCI with serialized cache flush, USB mass storage with SCSI sense-data decoding, and xHCI with cleaner DMA teardown, fix the last stray for(;;) in HalStopProcessor to while(true), pile on smoke tests for audio, win32 sync primitives, and thread suspend, implement AHCI timeout, kill readahead since it was desperetaly trying to murder me, fix doom sound x2.

This commit is contained in:
maksw committed 2026-08-11 18:38:36 +02:00
1 parent 8b254f84f4
commit 4add6789ba
177 files changed
+22565 -3070

No files matched your search

+23 -27
View File
@@ -12,6 +12,7 @@
#include <ntlite/time.h>
#include <ntlite/display.h>
#include <ntlite/status.h>
#include <ntlite/audio.h>
// Syscall ABI convention: status-returning calls use KSTATUS. New or revised
// operations use a request struct when they need five or more logical arguments
@@ -494,6 +495,9 @@ typedef struct SYS_CREATE_THREAD_REQUEST {
uint32_t* ThreadIdOut;
} SYS_CREATE_THREAD_REQUEST;
#define SYS_CREATE_THREAD_FLAG_NONE 0x00000000u
#define SYS_CREATE_THREAD_FLAG_SUSPENDED 0x00000001u
void SysExitProcess(int32_t exitCode);
void SysExitThread(int32_t exitCode);
KSTATUS SysCreateProcess(const SYS_CREATE_PROCESS_REQUEST* request);
@@ -533,6 +537,10 @@ KSTATUS SysKillProcess(uint32_t processHandle, int32_t exitCode);
#define SYS_THREAD_STATE_RUNNING 1u
#define SYS_THREAD_STATE_WAITING 2u
#define SYS_THREAD_STATE_DEAD 3u
#define SYS_THREAD_STATE_SUSPENDED 4u
#define SYS_SCHEDULING_NORMAL 0u
#define SYS_SCHEDULING_REALTIME 1u
#define SYS_THREAD_FLAG_CURRENT 0x00000001u
#define SYS_THREAD_FLAG_IDLE 0x00000002u
@@ -569,7 +577,11 @@ typedef struct SYS_THREAD_INFO {
uint32_t ThreadId;
uint32_t State;
uint32_t Priority;
uint32_t BaseSchedulingClass;
uint32_t BasePriority;
uint32_t EffectiveSchedulingClass;
uint32_t EffectivePriority;
uint32_t Flags;
uint32_t RunningCpu;
uint32_t LastCpu;
@@ -674,6 +686,7 @@ KSTATUS SysGetModuleExport(const SYS_GET_MODULE_EXPORT_REQUEST* request);
KSTATUS SysGetModuleList(SYS_MODULE_INFO* modulesOut, size_t maxCount, size_t* countOut);
KSTATUS SysCreateThread(const SYS_CREATE_THREAD_REQUEST* request);
KSTATUS SysResumeThread(uint32_t threadHandle, uint32_t* previousSuspendCountOut);
uint32_t SysGetCurrentTid(void);
uint32_t SysGetCurrentPid(void);
KSTATUS SysSetThreadPriority(uint32_t priority);
@@ -771,7 +784,8 @@ KSTATUS SysCloseHandle(uint32_t handle);
#define SYS_HANDLE_RIGHT_QUERY 0x00000020u
#define SYS_HANDLE_RIGHT_TERMINATE 0x00000040u
#define SYS_HANDLE_RIGHT_LOCK 0x00000080u
#define SYS_HANDLE_RIGHT_ALL 0x000000FFu
#define SYS_HANDLE_RIGHT_RESUME 0x00000100u
#define SYS_HANDLE_RIGHT_ALL 0x000001FFu
#define SYS_DUPLICATE_HANDLE_FLAG_NONE 0x00000000u
#define SYS_DUPLICATE_HANDLE_FLAG_SAME_RIGHTS 0x00000001u
@@ -1080,7 +1094,7 @@ KSTATUS SysRecvSocket(uint32_t socket, void* buffer, size_t length, uint32_t fla
KSTATUS SysShutdownSocket(uint32_t socket, uint32_t how);
KSTATUS SysSendToSocket(uint32_t socket, const SYS_SOCKET_SEND_TO_REQUEST* request);
KSTATUS SysRecvFromSocket(uint32_t socket, const SYS_SOCKET_RECV_FROM_REQUEST* request);
KSTATUS SysResolveHost(const SYS_RESOLVE_HOST_REQUEST* request); // Cry some more, microkernel purists!
KSTATUS SysResolveHost(const SYS_RESOLVE_HOST_REQUEST* request); // Cry about it.
KSTATUS SysSetSocketOption(uint32_t socket, const SYS_SOCKET_OPTION_REQUEST* request);
KSTATUS SysGetSocketOption(uint32_t socket, const SYS_SOCKET_OPTION_REQUEST* request);
KSTATUS SysPoll(const SYS_POLL_REQUEST* request);
@@ -1147,6 +1161,12 @@ typedef struct SYS_SCHEDULER_STATS {
uint64_t CpuBurstDemotions;
uint64_t SmtSiblingDeferrals;
uint64_t SmtPrimaryPokes;
uint64_t RealtimeDispatches;
uint64_t RealtimePreemptions;
uint64_t PriorityInheritanceBoosts;
uint64_t PriorityInheritanceDrops;
uint64_t PriorityInheritancePropagations;
uint64_t PriorityInheritanceMaxDepth;
} SYS_SCHEDULER_STATS;
typedef struct SYS_PMM_STATS {
@@ -1310,19 +1330,6 @@ typedef struct SYS_FILE_CACHE_STATS {
uint64_t DropFailures;
uint64_t StandbyTransitions;
uint64_t StandbyHits;
uint64_t ReadAheadRequests;
uint64_t ReadAheadPagesRequested;
uint64_t ReadAheadPagesQueued;
uint64_t ReadAheadPagesLoaded;
uint64_t ReadAheadPagesSkipped;
uint64_t ReadAheadFailures;
uint64_t ReadAheadPagesThrottled;
uint64_t MaxReadAheadPagesPerRequest;
uint64_t BatchReads;
uint64_t BatchPagesRequested;
uint64_t BatchPagesLoaded;
uint64_t MaxBatchPagesRequested;
uint64_t MaxBatchPagesLoaded;
uint64_t ResidentPages;
uint64_t ActivePages;
uint64_t StandbyPages;
@@ -1360,17 +1367,6 @@ typedef struct SYS_DISK_STATS {
uint64_t WriteSectors;
uint64_t MaxReadSectors;
uint64_t MaxWriteSectors;
uint64_t ReadaheadHits;
uint64_t ReadaheadMisses;
uint64_t ReadaheadStores;
uint64_t ReadaheadInvalidations;
uint64_t ReadaheadBytesServed;
uint64_t ReadaheadSectorsLoaded;
uint64_t ReadaheadSequentialDetections;
uint64_t ReadaheadSuppressed;
uint64_t ReadaheadAllocFailures;
uint64_t ReadaheadReadFailures;
uint64_t MaxReadaheadSectors;
} SYS_DISK_STATS;
#define SYS_NET_IRP_OPERATION_COUNT 16u