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

+49 -20
View File
@@ -7,25 +7,31 @@
#include <ntlite/status.h>
#include <ntlite/string_view.h>
#define NTL_RESOURCE_PROTOCOL_VERSION 2u
#define NTL_RESOURCE_PROTOCOL_VERSION 3u
#define NTL_RESOURCE_PATH_MAX 1024u
#define NTL_RESOURCE_NAME_MAX 255u
#define NTL_RESOURCE_FLAG_NONE 0x00000000u
#define NTL_RESOURCE_RESOLVE_FLAG_MODIFY 0x00000001u
#define NTL_RESOURCE_OP_LOOKUP 1u
#define NTL_RESOURCE_OP_QUERY 2u
#define NTL_RESOURCE_OP_BIND 3u
#define NTL_RESOURCE_OP_UNBIND 4u
#define NTL_RESOURCE_OP_RESOLVE 5u
#define NTL_RESOURCE_OP_LOOKUP 1u
#define NTL_RESOURCE_OP_QUERY 2u
#define NTL_RESOURCE_OP_BIND 3u
#define NTL_RESOURCE_OP_UNBIND 4u
#define NTL_RESOURCE_OP_RESOLVE 5u
#define NTL_RESOURCE_OP_ENUMERATE 6u
#define NTL_RESOURCE_OP_CREATE_DIRECTORY 7u
#define NTL_RESOURCE_OP_CREATE_SYMBOLIC_LINK 8u
#define NTL_RESOURCE_KIND_INVALID 0u
#define NTL_RESOURCE_KIND_CAPABILITY 1u
#define NTL_RESOURCE_KIND_VOLUME 2u
#define NTL_RESOURCE_KIND_DIRECTORY 3u
#define NTL_RESOURCE_KIND_DEVICE 4u
#define NTL_RESOURCE_KIND_INVALID 0u
#define NTL_RESOURCE_KIND_CAPABILITY 1u
#define NTL_RESOURCE_KIND_VOLUME 2u
#define NTL_RESOURCE_KIND_DIRECTORY 3u
#define NTL_RESOURCE_KIND_DEVICE 4u
#define NTL_RESOURCE_KIND_NAMESPACE_DIRECTORY 5u
#define NTL_RESOURCE_KIND_SYMBOLIC_LINK 6u
// Request header followed immediately by PathLength bytes of canonical native resource path.
// Request header followed by PathLength bytes of canonical native resource path and AuxLength operation-specific bytes.
typedef struct NTL_RESOURCE_REQUEST {
uint32_t Size;
uint32_t Version;
@@ -35,10 +41,10 @@ typedef struct NTL_RESOURCE_REQUEST {
SYS_RIGHTS ExportRights;
uint32_t Kind;
uint32_t PathLength;
uint32_t Reserved;
uint32_t AuxLength;
} NTL_RESOURCE_REQUEST;
// Every resource request receives one fixed-size reply. Successful lookup additionally transfers one handle.
// Every ordinary resource request receives one fixed-size reply. Enumeration appends NameLength bytes of one child name.
typedef struct NTL_RESOURCE_REPLY {
uint32_t Size;
uint32_t Version;
@@ -47,9 +53,21 @@ typedef struct NTL_RESOURCE_REPLY {
KSTATUS Status;
uint32_t Kind;
uint32_t ResolvedLength;
uint32_t Reserved;
uint32_t NameLength;
} NTL_RESOURCE_REPLY;
// Stateless lexicographic enumeration cursor. Callers zero-initialize it before the first request.
typedef struct NTL_RESOURCE_ENUM_CURSOR {
uint32_t NameLength;
char Name[NTL_RESOURCE_NAME_MAX + 1u];
} NTL_RESOURCE_ENUM_CURSOR;
// One immediate child of an RSSRV namespace directory.
typedef struct NTL_RESOURCE_ENUM_ENTRY {
uint32_t Kind;
char Name[NTL_RESOURCE_NAME_MAX + 1u];
} NTL_RESOURCE_ENUM_ENTRY;
#if defined(NTL_SYSCALL_STATIC)
#define NTL_RESOURCE_API
#elif defined(NTL_SYSCALL_BUILD)
@@ -63,17 +81,17 @@ NTL_RESOURCE_API KSTATUS NtlResourceConnect(SYS_HANDLE* sessionOut);
NTL_RESOURCE_API KSTATUS NtlResourceOpenSystemRoot(SYS_RIGHTS desiredRights, SYS_HANDLE* handleOut);
// Connects one session through an explicitly delegated resource-listener capability.
NTL_RESOURCE_API KSTATUS NtlResourceConnectListener(SYS_HANDLE listenerHandle, SYS_HANDLE* sessionOut);
// Resolves one canonical global resource name to an attenuated capability.
// Resolves one canonical global resource name to an attenuated capability. Symbolic links are followed.
NTL_RESOURCE_API KSTATUS NtlResourceLookup(SYS_HANDLE session,
SYS_STRING_VIEW path,
SYS_RIGHTS desiredRights,
SYS_HANDLE* handleOut);
// Queries resource metadata without transferring the resource capability.
// Queries the exact namespace node without following the final symbolic link.
NTL_RESOURCE_API KSTATUS NtlResourceQuery(SYS_HANDLE session,
SYS_STRING_VIEW path,
uint32_t* kindOut);
// Resolves the longest bound resource prefix of one canonical absolute path.
// ResolvedLength receives the byte length of the matched resource name; the remaining
// Resolves the longest bound resource prefix of one canonical absolute path, following namespace symbolic links.
// ResolvedLength receives the byte length consumed from the caller's original resource path; the remaining
// path, after one optional '/', is relative to the returned volume/directory capability.
NTL_RESOURCE_API KSTATUS NtlResourceResolve(SYS_HANDLE session,
SYS_STRING_VIEW path,
@@ -81,6 +99,17 @@ NTL_RESOURCE_API KSTATUS NtlResourceResolve(SYS_HANDLE session,
SYS_HANDLE* rootHandleOut,
uint32_t* kindOut,
uint32_t* resolvedLengthOut);
// Enumerates immediate children in stable bytewise-name order using a caller-owned stateless cursor.
NTL_RESOURCE_API KSTATUS NtlResourceEnumerate(SYS_HANDLE session,
SYS_STRING_VIEW directoryPath,
NTL_RESOURCE_ENUM_CURSOR* cursor,
NTL_RESOURCE_ENUM_ENTRY* entryOut);
// Creates one empty namespace directory through an administrative session.
NTL_RESOURCE_API KSTATUS NtlResourceCreateDirectory(SYS_HANDLE session, SYS_STRING_VIEW path);
// Creates one absolute namespace symbolic link through an administrative session.
NTL_RESOURCE_API KSTATUS NtlResourceCreateSymbolicLink(SYS_HANDLE session,
SYS_STRING_VIEW path,
SYS_STRING_VIEW target);
// Binds one capability into an administrative session with an explicit namespace-rights grant and export ceiling.
NTL_RESOURCE_API KSTATUS NtlResourceBind(SYS_HANDLE session,
SYS_STRING_VIEW path,
@@ -88,7 +117,7 @@ NTL_RESOURCE_API KSTATUS NtlResourceBind(SYS_HANDLE session,
SYS_HANDLE resourceHandle,
SYS_RIGHTS namespaceRights,
SYS_RIGHTS exportRights);
// Removes one name from an administrative resource session. Existing looked-up capabilities remain valid.
// Removes one non-root namespace node through an administrative session. Namespace directories must be empty.
NTL_RESOURCE_API KSTATUS NtlResourceUnbind(SYS_HANDLE session, SYS_STRING_VIEW path);
// Disconnects and closes one resource session endpoint.
NTL_RESOURCE_API KSTATUS NtlResourceClose(SYS_HANDLE session);