isolate POSIX builds from the host UCRT, wire lwext4 and ntfs-3g as ext4.sys and ntfs.sys, split the FAT driver into directory/file/async/driver/mount units, add posixsrv and dwm plus input/console/desktop syscall clients and a pile of new smoke targets, rename serial.sys to cereal.sys, name HDA/USB/lwIP/AHCI workers, harden ATA probing/reset/removal around actual hardware deadlines, absent-channel detection, diagnostics and explicit worker lifetime, redo ACPI S5 shutdown around GAS/MMIO and HW-reduced firmware, scan SSDTs for _S5 and deal with Intel SMI sleep trapping, make serial and SMP timeouts use real monotonic deadlines, add thread names and fix terminal thread teardown, scheduler and APC prepare/commit races, make advisory file locks queryable and preserve split ranges and add mutable file append state, add shared-memory pipes with kernel-assisted wait/wake, introduce capability-scoped input and display managers, split surface map rights into read/write, add explicit unmap and replace present with commit/generation/damage tracking while keeping physical presentation under the display manager, decouple native exception classes from Win32 exception numbers and translate them in kernel32, add opaque process startup data, bump the resource protocol to v3 with namespace directories, symlinks and enumeration and service control to v2 with generic READY handle exports, add the new POSIX errno/status surface and rebuild fds around posixsrv-owned shared open descriptions, descriptor-local flags, exact inheritance snapshots, dup/fcntl/record locks and shared-ring pipes, add waitpid, POSIX credentials/groups/sessions/passwd/group lookups and move sockets onto stable open descriptions, port the shells and apps to the new console/input services and surface commit API, teach init to load services.ini and start/supervise RSSRV, DWM and generic services under restricted capabilities while publishing their endpoints through RSSRV, split RSSRV into namespace, volume, display, session, input, console and resource components and make /SystemRoot a real symlink to the independently published system volume, shift the syscall table again, expand lock/resource/surface/POSIX/service/thread smoke coverage, make docs scream ASK QUESTIONS and DISCUSS at LLMs, replace MIT No Attribution with WTFPL+.

This commit is contained in:
maksw committed 2026-09-16 10:33:20 +02:00
1 parent 3dacbd32c8
commit 73abd6f90d
441 files changed
+187073 -6549

No files matched your search

+15 -14
View File
@@ -9,6 +9,8 @@
#include <string.h>
#include <intrin.h>
#include <ntlite/syscall.h>
#include <ntlite/console_service.h>
#include <ntlite/input_service.h>
#include <ntlite/path.h>
#include "doom_audio.h"
@@ -23,8 +25,7 @@ int _fltused;
// ---------------------------------------------------------------------------
static void doom_print_wrapper(const char* msg)
{
SYS_WRITE_CONSOLE_REQUEST req = { sizeof(SYS_WRITE_CONSOLE_REQUEST), SysSvFromCstr(msg) };
SysWriteConsole(&req);
if (msg) (void)NtlConsoleWrite(SYS_HANDLE_INVALID, msg, strlen(msg), NULL);
}
// ---------------------------------------------------------------------------
@@ -275,7 +276,7 @@ static const KeyMap g_keymap[] = {
static bool g_prev_key[KEYMAP_COUNT];
// Returns whether one key bit is set in a global input snapshot.
static bool ntlite_snapshot_key_down(const SYS_GLOBAL_INPUT_STATE* state, INPUT_KEY key)
static bool ntlite_snapshot_key_down(const NTL_INPUT_STATE* state, INPUT_KEY key)
{
if (!state || key >= 256u) return false;
return (state->KeyDown[key >> 3] & (uint8_t)(1u << (key & 7u))) != 0;
@@ -283,12 +284,12 @@ static bool ntlite_snapshot_key_down(const SYS_GLOBAL_INPUT_STATE* state, INPUT_
static void poll_input(void)
{
SYS_GLOBAL_INPUT_STATE input;
NTL_INPUT_STATE input;
memset(&input, 0, sizeof(input));
input.Size = sizeof(input);
input.Flags = SYS_GLOBAL_INPUT_STATE_FLAG_NONE;
input.Flags = NTL_INPUT_STATE_FLAG_NONE;
if (SysQueryGlobalInputState(&input) != NTLSTATUS_SUCCESS)
if (NtlInputQueryDefaultState(&input) != NTLSTATUS_SUCCESS)
return;
for (int i = 0; i < (int)KEYMAP_COUNT; i++) {
@@ -334,7 +335,8 @@ static void init_surface(void)
void* base = 0;
uint32_t pitchBytes = 0;
s = SysMapSurface(g_surface_handle, &base, &pitchBytes);
s = SysMapSurface(g_surface_handle, SYS_SURFACE_MAP_READ | SYS_SURFACE_MAP_WRITE,
&base, &pitchBytes);
if (s != NTLSTATUS_SUCCESS || !base || pitchBytes < DISP_W * sizeof(uint32_t)) {
doom_print_wrapper("doom: SysMapSurface failed\n");
SysExitProcess(1);
@@ -390,10 +392,9 @@ static void render_frame(const uint8_t* rgba)
}
DISPLAY_RECT rect = { 0, 0, DISP_W, DISP_H };
uint32_t code = SysPresentSurface(g_surface_handle, &rect, 1);
if (code != NTLSTATUS_SUCCESS) {
uint32_t code = SysCommitSurface(g_surface_handle, &rect, 1, 0);
if (code != NTLSTATUS_SUCCESS)
SysExitProcess(code);
}
}
static int build_argv_from_command_line(const char* cmdline, char* storage, size_t storageSize,
@@ -465,7 +466,7 @@ int main(void)
{
const char* cmdline = SysGetPeb()->CommandLine.Data;
do { SYS_WRITE_CONSOLE_REQUEST req = { sizeof(SYS_WRITE_CONSOLE_REQUEST), SYS_SV_LITERAL("doom: starting\n") }; SysWriteConsole(&req); } while (0);
(void)NtlConsoleWrite(SYS_HANDLE_INVALID, "doom: starting\n", sizeof("doom: starting\n") - 1u, NULL);
// Wire up PureDOOM core mechanics
doom_set_print(doom_print_wrapper);
@@ -503,12 +504,12 @@ int main(void)
doom_print_wrapper("doom: parsed argc <= 0\n");
init_surface();
init_display_clock();
do { SYS_WRITE_CONSOLE_REQUEST req = { sizeof(SYS_WRITE_CONSOLE_REQUEST), SYS_SV_LITERAL("doom: starting doom\n") }; SysWriteConsole(&req); } while (0);
(void)NtlConsoleWrite(SYS_HANDLE_INVALID, "doom: starting doom\n", sizeof("doom: starting doom\n") - 1u, NULL);
doom_init(argc, argv, 0);
do { SYS_WRITE_CONSOLE_REQUEST req = { sizeof(SYS_WRITE_CONSOLE_REQUEST), SYS_SV_LITERAL("doom: starting audio\n") }; SysWriteConsole(&req); } while (0);
(void)NtlConsoleWrite(SYS_HANDLE_INVALID, "doom: starting audio\n", sizeof("doom: starting audio\n") - 1u, NULL);
DoomAudioStart();
do { SYS_WRITE_CONSOLE_REQUEST req = { sizeof(SYS_WRITE_CONSOLE_REQUEST), SYS_SV_LITERAL("doom: entering game loop\n") }; SysWriteConsole(&req); } while (0);
(void)NtlConsoleWrite(SYS_HANDLE_INVALID, "doom: entering game loop\n", sizeof("doom: entering game loop\n") - 1u, NULL);
// Core execution loop. Doom advances at TICRATE, so rendering duplicate
// frames as fast as possible only amplifies scheduler and input jitter.
+3 -2
View File
@@ -6,6 +6,7 @@
#include <string.h>
#include <intrin.h>
#include <ntlite/syscall.h>
#include <ntlite/console_service.h>
#include <ntlite/path.h>
#include "doom_audio.h"
@@ -213,8 +214,7 @@ 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 = { sizeof(SYS_WRITE_CONSOLE_REQUEST), SysSvFromCstr(text) };
(void)SysWriteConsole(&request);
if (text) (void)NtlConsoleWrite(SYS_HANDLE_INVALID, text, strlen(text), NULL);
}
// Opens the default available native render endpoint.
@@ -755,6 +755,7 @@ void DoomAudioStart(void) {
}
memset(&thread, 0, sizeof(thread));
thread.Size = sizeof(thread);
thread.Entry = (uintptr_t)DoomAudioSynthLoader;
thread.Priority = DOOM_AUDIO_SYNTH_LOADER_PRIORITY;
thread.ThreadHandleOut = &g_doomAudio.SynthLoaderHandle;