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

@@ -12,29 +12,6 @@ static void print(const char* text) {
}
// Builds one /Device/HarddiskVolumeN resource path.
static SYS_STRING_VIEW make_volume_path(uint32_t index, char* buffer, size_t capacity) {
static const char prefix[] = "/Device/HarddiskVolume";
size_t prefixLength = sizeof(prefix) - 1u;
if (!index || !buffer || capacity <= prefixLength)
return SysSvFromParts((const char*)0, 0);
char digits[10];
size_t digitCount = 0;
do {
digits[digitCount++] = (char)('0' + (index % 10u));
index /= 10u;
} while (index && digitCount < sizeof(digits));
if (prefixLength + digitCount + 1u > capacity)
return SysSvFromParts((const char*)0, 0);
memcpy(buffer, prefix, prefixLength);
for (size_t i = 0; i < digitCount; ++i)
buffer[prefixLength + i] = digits[digitCount - 1u - i];
buffer[prefixLength + digitCount] = '\0';
return SysSvFromParts(buffer, prefixLength + digitCount);
}
static int fail(const char* what, KSTATUS status) {
(void)status;
print("resource_service_smoke: FAIL ");
@@ -49,25 +26,61 @@ int main(void) {
if (!KSUCCESS(status)) return fail("connect", status);
uint32_t kind = NTL_RESOURCE_KIND_INVALID;
status = NtlResourceQuery(session, SYS_SV_LITERAL("/"), &kind);
if (!KSUCCESS(status) || kind != NTL_RESOURCE_KIND_NAMESPACE_DIRECTORY)
return fail("query namespace root", status);
status = NtlResourceQuery(session, SYS_SV_LITERAL("/Device"), &kind);
if (!KSUCCESS(status) || kind != NTL_RESOURCE_KIND_NAMESPACE_DIRECTORY)
return fail("query /Device", status);
status = NtlResourceQuery(session, SYS_SV_LITERAL("/SystemRoot"), &kind);
if (!KSUCCESS(status) || kind != NTL_RESOURCE_KIND_VOLUME)
return fail("query /SystemRoot", status);
if (!KSUCCESS(status) || kind != NTL_RESOURCE_KIND_SYMBOLIC_LINK)
return fail("query /SystemRoot link", status);
// Root enumeration exposes namespace directories and symbolic links without transferring authority.
NTL_RESOURCE_ENUM_CURSOR rootCursor;
memset(&rootCursor, 0, sizeof(rootCursor));
uint32_t sawDevice = 0;
uint32_t sawSessions = 0;
uint32_t sawServices = 0;
uint32_t sawSystemRoot = 0;
for (;;) {
NTL_RESOURCE_ENUM_ENTRY entry;
status = NtlResourceEnumerate(session, SYS_SV_LITERAL("/"), &rootCursor, &entry);
if (status == NTLSTATUS_NO_MORE_FILES) break;
if (!KSUCCESS(status)) return fail("enumerate namespace root", status);
if (strcmp(entry.Name, "Device") == 0 && entry.Kind == NTL_RESOURCE_KIND_NAMESPACE_DIRECTORY) sawDevice = 1;
if (strcmp(entry.Name, "Sessions") == 0 && entry.Kind == NTL_RESOURCE_KIND_NAMESPACE_DIRECTORY) sawSessions = 1;
if (strcmp(entry.Name, "Services") == 0 && entry.Kind == NTL_RESOURCE_KIND_NAMESPACE_DIRECTORY) sawServices = 1;
if (strcmp(entry.Name, "SystemRoot") == 0 && entry.Kind == NTL_RESOURCE_KIND_SYMBOLIC_LINK) sawSystemRoot = 1;
}
if (!sawDevice || !sawSessions || !sawServices || !sawSystemRoot)
return fail("root enumeration contents", NTLSTATUS_NOT_FOUND);
// RSSRV assigns its own monotonic /Device/HarddiskVolumeN names to mounted IO_VOLUME instances.
uint32_t publishedVolumes = 0;
uint32_t systemVolumePublished = 0;
for (uint32_t index = 1; index <= 32; ++index) {
NTL_RESOURCE_ENUM_CURSOR deviceCursor;
memset(&deviceCursor, 0, sizeof(deviceCursor));
for (;;) {
NTL_RESOURCE_ENUM_ENTRY entry;
status = NtlResourceEnumerate(session, SYS_SV_LITERAL("/Device"), &deviceCursor, &entry);
if (status == NTLSTATUS_NO_MORE_FILES) break;
if (!KSUCCESS(status)) return fail("enumerate /Device", status);
if (entry.Kind != NTL_RESOURCE_KIND_VOLUME || strncmp(entry.Name, "HarddiskVolume", 14) != 0)
continue;
char volumePathBuffer[48];
SYS_STRING_VIEW volumePath = make_volume_path(index, volumePathBuffer, sizeof(volumePathBuffer));
if (!volumePath.Data)
return fail("build dynamic volume path", NTLSTATUS_FAILURE);
size_t nameLength = strlen(entry.Name);
if (sizeof("/Device/") - 1u + nameLength + 1u > sizeof(volumePathBuffer))
return fail("dynamic volume name too long", NTLSTATUS_FAILURE);
memcpy(volumePathBuffer, "/Device/", sizeof("/Device/") - 1u);
memcpy(volumePathBuffer + sizeof("/Device/") - 1u, entry.Name, nameLength + 1u);
SYS_STRING_VIEW volumePath = SysSvFromCstr(volumePathBuffer);
SYS_HANDLE published = SYS_HANDLE_INVALID;
status = NtlResourceLookup(session, volumePath, SYS_RIGHT_QUERY | SYS_VOLUME_RIGHT_OPEN, &published);
if (status == NTLSTATUS_NOT_FOUND)
continue;
if (!KSUCCESS(status))
return fail("lookup dynamic volume", status);
return fail("lookup enumerated volume", status);
publishedVolumes++;
SYS_HANDLE probe = SYS_HANDLE_INVALID;