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

+96
View File
@@ -0,0 +1,96 @@
// Native resource-service protocol and client helpers.
#pragma once
#include <stdint.h>
#include <ntlite/handle.h>
#include <ntlite/status.h>
#include <ntlite/string_view.h>
#define NTL_RESOURCE_PROTOCOL_VERSION 2u
#define NTL_RESOURCE_PATH_MAX 1024u
#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_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
// Request header followed immediately by PathLength bytes of canonical native resource path.
typedef struct NTL_RESOURCE_REQUEST {
uint32_t Size;
uint32_t Version;
uint32_t Operation;
uint32_t Flags;
SYS_RIGHTS Rights;
SYS_RIGHTS ExportRights;
uint32_t Kind;
uint32_t PathLength;
uint32_t Reserved;
} NTL_RESOURCE_REQUEST;
// Every resource request receives one fixed-size reply. Successful lookup additionally transfers one handle.
typedef struct NTL_RESOURCE_REPLY {
uint32_t Size;
uint32_t Version;
uint32_t Operation;
uint32_t Flags;
KSTATUS Status;
uint32_t Kind;
uint32_t ResolvedLength;
uint32_t Reserved;
} NTL_RESOURCE_REPLY;
#if defined(NTL_SYSCALL_STATIC)
#define NTL_RESOURCE_API
#elif defined(NTL_SYSCALL_BUILD)
#define NTL_RESOURCE_API __declspec(dllexport)
#else
#define NTL_RESOURCE_API
#endif
// Connects one session to the globally registered resource service.
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.
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.
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
// path, after one optional '/', is relative to the returned volume/directory capability.
NTL_RESOURCE_API KSTATUS NtlResourceResolve(SYS_HANDLE session,
SYS_STRING_VIEW path,
uint32_t flags,
SYS_HANDLE* rootHandleOut,
uint32_t* kindOut,
uint32_t* resolvedLengthOut);
// 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,
uint32_t kind,
SYS_HANDLE resourceHandle,
SYS_RIGHTS namespaceRights,
SYS_RIGHTS exportRights);
// Removes one name from an administrative resource session. Existing looked-up capabilities remain valid.
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);
#undef NTL_RESOURCE_API