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

+126
View File
@@ -0,0 +1,126 @@
// RSSRV display authority. This component owns session display metadata, modeset, and transitional console authority.
#include "rssrv_internal.h"
#include <string.h>
// Initializes RSSRV display authority from the attenuated bootstrap manager capability.
KSTATUS RssrvDisplayInitialize(RSSRV_DISPLAY_STATE* display, RSSRV_NAMESPACE* namespaceState, SYS_HANDLE manager) {
if (!display || !namespaceState || manager == SYS_HANDLE_INVALID)
return NTLSTATUS_INVALID_PARAMETER;
memset(display, 0, sizeof(*display));
display->Manager = manager;
display->Namespace = namespaceState;
return NTLSTATUS_SUCCESS;
}
// Publishes read-only display metadata while keeping mode and transitional console authority private to RSSRV.
KSTATUS RssrvDisplayPublishDevice(RSSRV_DISPLAY_STATE* display) {
if (!display || !display->Namespace || display->Manager == SYS_HANDLE_INVALID)
return NTLSTATUS_INVALID_PARAMETER;
SYS_HANDLE deviceHandle = SYS_HANDLE_INVALID;
SYS_DERIVE_HANDLE_REQUEST derive;
memset(&derive, 0, sizeof(derive));
derive.Size = sizeof(derive);
derive.SourceHandle = display->Manager;
derive.DesiredRights = SYS_RIGHT_TRANSFER | SYS_RIGHT_QUERY | SYS_DISPLAY_MANAGER_RIGHT_ENUMERATE;
derive.DerivedHandleOut = &deviceHandle;
KSTATUS status = SysDeriveHandle(&derive);
if (!KSUCCESS(status)) return status;
status = RssrvNamespaceBindOwned(display->Namespace,
"/Device/Display0",
sizeof("/Device/Display0") - 1u,
NTL_RESOURCE_KIND_DEVICE,
deviceHandle,
SYS_RIGHT_QUERY | SYS_DISPLAY_MANAGER_RIGHT_ENUMERATE);
if (!KSUCCESS(status)) (void)SysCloseHandle(deviceHandle);
return status;
}
// Queries the primary display through RSSRV's delegated manager capability.
KSTATUS RssrvDisplayQueryInfo(RSSRV_DISPLAY_STATE* display, SYS_DISPLAY_INFO* infoOut) {
if (!display || display->Manager == SYS_HANDLE_INVALID || !infoOut)
return NTLSTATUS_INVALID_PARAMETER;
return SysQueryDisplayManagerInfo(display->Manager, infoOut);
}
// Writes text through RSSRV's delegated legacy-console bridge.
KSTATUS RssrvDisplayWriteConsole(RSSRV_DISPLAY_STATE* display, const char* data, size_t length) {
if (!display || display->Manager == SYS_HANDLE_INVALID || (length && !data))
return NTLSTATUS_INVALID_PARAMETER;
SYS_WRITE_CONSOLE_REQUEST request;
memset(&request, 0, sizeof(request));
request.Size = sizeof(request);
request.Text = SysSvFromParts(data, length);
return SysWriteDisplayManagerConsole(display->Manager, &request);
}
// Queries the kernel-backed console state during the RSSRV migration period.
KSTATUS RssrvDisplayQueryConsoleInfo(RSSRV_DISPLAY_STATE* display, SYS_CONSOLE_INFO* infoOut) {
if (!display || display->Manager == SYS_HANDLE_INVALID || !infoOut)
return NTLSTATUS_INVALID_PARAMETER;
return SysQueryDisplayManagerConsoleInfo(display->Manager, infoOut);
}
// Updates the kernel-backed console cursor through delegated authority.
KSTATUS RssrvDisplaySetConsoleCursor(RSSRV_DISPLAY_STATE* display, int x, int y) {
if (!display || display->Manager == SYS_HANDLE_INVALID)
return NTLSTATUS_INVALID_PARAMETER;
return SysSetDisplayManagerConsoleCursor(display->Manager, x, y);
}
// Fills kernel-backed console characters through delegated authority.
KSTATUS RssrvDisplayFillConsoleCharacter(RSSRV_DISPLAY_STATE* display, char character,
int x, int y, size_t length, size_t* writtenOut) {
if (!display || display->Manager == SYS_HANDLE_INVALID)
return NTLSTATUS_INVALID_PARAMETER;
SYS_FILL_CONSOLE_CHARACTER_REQUEST request;
memset(&request, 0, sizeof(request));
request.Size = sizeof(request);
request.Character = character;
request.X = x;
request.Y = y;
request.Length = length;
request.WrittenOut = writtenOut;
return SysFillDisplayManagerConsoleCharacter(display->Manager, &request);
}
// Fills kernel-backed console attributes through delegated authority.
KSTATUS RssrvDisplayFillConsoleAttribute(RSSRV_DISPLAY_STATE* display, uint16_t attribute,
int x, int y, size_t length, size_t* writtenOut) {
if (!display || display->Manager == SYS_HANDLE_INVALID)
return NTLSTATUS_INVALID_PARAMETER;
SYS_FILL_CONSOLE_ATTRIBUTE_REQUEST request;
memset(&request, 0, sizeof(request));
request.Size = sizeof(request);
request.Attribute = attribute;
request.X = x;
request.Y = y;
request.Length = length;
request.WrittenOut = writtenOut;
return SysFillDisplayManagerConsoleAttribute(display->Manager, &request);
}
// Draws one explicit glyph through delegated console authority.
KSTATUS RssrvDisplayPutConsoleCharacter(RSSRV_DISPLAY_STATE* display, char character,
int x, int y, uint32_t foreground, uint32_t background) {
if (!display || display->Manager == SYS_HANDLE_INVALID)
return NTLSTATUS_INVALID_PARAMETER;
SYS_PUT_SCREEN_CHAR_REQUEST request;
memset(&request, 0, sizeof(request));
request.Size = sizeof(request);
request.Character = character;
request.X = x;
request.Y = y;
request.Foreground = foreground;
request.Background = background;
return SysPutDisplayManagerConsoleCharacter(display->Manager, &request);
}
// Clears the current console target through delegated console authority.
KSTATUS RssrvDisplayClearConsole(RSSRV_DISPLAY_STATE* display, uint32_t color) {
if (!display || display->Manager == SYS_HANDLE_INVALID)
return NTLSTATUS_INVALID_PARAMETER;
return SysClearDisplayManagerConsole(display->Manager, color);
}