redo boot around an explicit system volume and fixed kernel/HAL images, redo volumes and filesystem paths around capabilities instead of drive numbers and kernel CWD state, add a capability/security model with derived and revocable handles and security contexts, add port IPC and rssrv to manage the userspace resource namespace and publish the system volume, move process, dll and path loading to userspace and add process builder syscalls, init now supervises rssrv and the session process, redo the syscall ABI around request structs and four arguments, add a volume manager and proper partition arrival/removal handling so FAT and NTFS mount dynamically, clean up the HAL/DDK boundary so drivers don't depend on HAL internals, save fpu state properly now, the serial driver doesn't hang on a missing port, fix AHCI startup races, fix timeout accounting, fix shared mmap writeback, more smoke tests

This commit is contained in:
maksw committed 2026-08-20 12:33:17 +02:00
1 parent 4add6789ba
commit f882d339fb
232 files changed
+20934 -8898

No files matched your search

+8 -11
View File
@@ -9,6 +9,7 @@
#include <string.h>
#include <intrin.h>
#include <ntlite/syscall.h>
#include <ntlite/path.h>
#include "doom_audio.h"
@@ -22,7 +23,7 @@ int _fltused;
// ---------------------------------------------------------------------------
static void doom_print_wrapper(const char* msg)
{
SYS_WRITE_CONSOLE_REQUEST req = { SysSvFromCstr(msg) };
SYS_WRITE_CONSOLE_REQUEST req = { sizeof(SYS_WRITE_CONSOLE_REQUEST), SysSvFromCstr(msg) };
SysWriteConsole(&req);
}
@@ -66,12 +67,8 @@ static void* doom_open_wrapper(const char* path, const char* mode)
access |= SYS_FILE_ACCESS_READ;
}
SYS_OPEN_FILE_REQUEST req = SysMakeOpenFileRequest(SysSvFromCstr(path),
access,
disposition,
SYS_FILE_FLAG_NONE,
&handle);
result = SysOpenFile(&req);
result = NtlOpenFile(SysSvFromCstr(path), access, disposition,
SYS_FILE_FLAG_NONE, &handle);
if (result != 0) return 0;
DOOM_FILE_HANDLE* f = (DOOM_FILE_HANDLE*)malloc(sizeof(DOOM_FILE_HANDLE));
@@ -468,7 +465,7 @@ int main(void)
{
const char* cmdline = SysGetPeb()->CommandLine.Data;
do { SYS_WRITE_CONSOLE_REQUEST req = { SYS_SV_LITERAL("doom: starting\n") }; SysWriteConsole(&req); } while (0);
do { SYS_WRITE_CONSOLE_REQUEST req = { sizeof(SYS_WRITE_CONSOLE_REQUEST), SYS_SV_LITERAL("doom: starting\n") }; SysWriteConsole(&req); } while (0);
// Wire up PureDOOM core mechanics
doom_set_print(doom_print_wrapper);
@@ -506,12 +503,12 @@ int main(void)
doom_print_wrapper("doom: parsed argc <= 0\n");
init_surface();
init_display_clock();
do { SYS_WRITE_CONSOLE_REQUEST req = { SYS_SV_LITERAL("doom: starting doom\n") }; SysWriteConsole(&req); } while (0);
do { SYS_WRITE_CONSOLE_REQUEST req = { sizeof(SYS_WRITE_CONSOLE_REQUEST), SYS_SV_LITERAL("doom: starting doom\n") }; SysWriteConsole(&req); } while (0);
doom_init(argc, argv, 0);
do { SYS_WRITE_CONSOLE_REQUEST req = { SYS_SV_LITERAL("doom: starting audio\n") }; SysWriteConsole(&req); } while (0);
do { SYS_WRITE_CONSOLE_REQUEST req = { sizeof(SYS_WRITE_CONSOLE_REQUEST), SYS_SV_LITERAL("doom: starting audio\n") }; SysWriteConsole(&req); } while (0);
DoomAudioStart();
do { SYS_WRITE_CONSOLE_REQUEST req = { SYS_SV_LITERAL("doom: entering game loop\n") }; SysWriteConsole(&req); } while (0);
do { SYS_WRITE_CONSOLE_REQUEST req = { sizeof(SYS_WRITE_CONSOLE_REQUEST), SYS_SV_LITERAL("doom: entering game loop\n") }; SysWriteConsole(&req); } while (0);
// Core execution loop. Doom advances at TICRATE, so rendering duplicate
// frames as fast as possible only amplifies scheduler and input jitter.
+18 -14
View File
@@ -6,6 +6,7 @@
#include <string.h>
#include <intrin.h>
#include <ntlite/syscall.h>
#include <ntlite/path.h>
#include "doom_audio.h"
#include "PureDOOM.h"
@@ -212,12 +213,12 @@ static DOOM_AUDIO_STATE g_doomAudio;
// Writes one complete diagnostic line to the process console.
static void DoomAudioPrint(const char* text) {
SYS_WRITE_CONSOLE_REQUEST request = { SysSvFromCstr(text) };
SYS_WRITE_CONSOLE_REQUEST request = { sizeof(SYS_WRITE_CONSOLE_REQUEST), SysSvFromCstr(text) };
(void)SysWriteConsole(&request);
}
// Opens the default available native render endpoint.
static KSTATUS DoomAudioFindEndpoint(uint64_t* endpointIdOut) {
static KSTATUS DoomAudioFindEndpoint(uint32_t* endpointIdOut) {
SYS_AUDIO_ENDPOINT_INFO endpoints[SYS_AUDIO_MAX_ENDPOINTS];
SYS_AUDIO_ENUMERATE_ENDPOINTS_REQUEST request;
uint32_t count = 0;
@@ -278,13 +279,9 @@ static KSTATUS DoomAudioMapSoundFont(void** dataOut, uint32_t* sizeOut) {
*dataOut = NULL;
*sizeOut = 0;
SYS_OPEN_FILE_REQUEST open = SysMakeOpenFileRequest(
SysSvFromCstr(DOOM_AUDIO_SOUNDFONT_PATH),
SYS_FILE_ACCESS_QUERY | SYS_FILE_ACCESS_READ,
SYS_FILE_OPEN_EXISTING,
SYS_FILE_FLAG_NONE,
&fileHandle);
status = SysOpenFile(&open);
status = NtlOpenFile(SysSvFromCstr(DOOM_AUDIO_SOUNDFONT_PATH),
SYS_FILE_ACCESS_QUERY | SYS_FILE_ACCESS_READ,
SYS_FILE_OPEN_EXISTING, SYS_FILE_FLAG_NONE, &fileHandle);
if (status != NTLSTATUS_SUCCESS)
return status;
@@ -296,15 +293,21 @@ static KSTATUS DoomAudioMapSoundFont(void** dataOut, uint32_t* sizeOut) {
return status == NTLSTATUS_SUCCESS ? NTLSTATUS_INVALID_PARAMETER : status;
}
status = SysCreateFileMapping(fileHandle, SYS_VM_READ, SYS_MAP_FLAG_NONE,
fileSize, &mappingHandle);
SYS_CREATE_FILE_MAPPING_REQUEST createMapping = {
sizeof(SYS_CREATE_FILE_MAPPING_REQUEST), fileHandle, SYS_VM_READ,
SYS_MAP_FLAG_NONE, fileSize, &mappingHandle
};
status = SysCreateFileMapping(&createMapping);
if (status != NTLSTATUS_SUCCESS || !mappingHandle) {
(void)SysCloseHandle(fileHandle);
return status == NTLSTATUS_SUCCESS ? NTLSTATUS_FAILURE : status;
}
status = SysMapFile(mappingHandle, 0, (size_t)fileSize,
SYS_MAP_ACCESS_READ, SYS_MAP_FLAG_NONE, &base);
SYS_MAP_FILE_REQUEST mapFile = {
sizeof(SYS_MAP_FILE_REQUEST), mappingHandle, SYS_MAP_ACCESS_READ,
SYS_MAP_FLAG_NONE, 0, (size_t)fileSize, &base
};
status = SysMapFile(&mapFile);
(void)SysCloseHandle(mappingHandle);
(void)SysCloseHandle(fileHandle);
if (status != NTLSTATUS_SUCCESS || !base)
@@ -695,7 +698,7 @@ static void DoomAudioReleaseResources(void) {
// Starts one process-owned audio stream and its exclusive producer thread.
void DoomAudioStart(void) {
uint64_t endpointId = 0;
uint32_t endpointId = 0;
uint32_t streamHandle = 0;
KSTATUS status;
@@ -739,6 +742,7 @@ void DoomAudioStart(void) {
SYS_CREATE_THREAD_REQUEST thread;
memset(&thread, 0, sizeof(thread));
thread.Size = sizeof(thread);
thread.Entry = (uintptr_t)DoomAudioWorker;
thread.Priority = DOOM_AUDIO_WORKER_PRIORITY;
thread.ThreadHandleOut = &g_doomAudio.WorkerHandle;