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

+150
View File
@@ -0,0 +1,150 @@
// Public nt-lite Port IPC declarations. Payload pointers are syscall-local only; queued messages never retain them.
#pragma once
#include <stddef.h>
#include <stdint.h>
#include <ntlite/handle.h>
// Larger transfers should pass a mapping/file-mapping capability instead of enlarging inline messages.
#define SYS_PORT_MAX_INLINE_BYTES 4096u
#define SYS_PORT_MAX_TRANSFER_HANDLES 8u
#define SYS_PORT_DEFAULT_BACKLOG 16u
#define SYS_PORT_MAX_BACKLOG 64u
#define SYS_PORT_QUEUE_MESSAGE_LIMIT 64u
#define SYS_PORT_QUEUE_BYTE_LIMIT (64u * 1024u)
#define SYS_PORT_QUEUE_HANDLE_LIMIT 128u
#define SYS_PORT_TIMEOUT_INFINITE UINT64_MAX
#define SYS_PORT_FLAG_NONE 0u
#define SYS_PORT_MESSAGE_NOTIFICATION 1u
#define SYS_PORT_MESSAGE_REQUEST 2u
#define SYS_PORT_MESSAGE_REPLY 3u
// With no flag, DesiredRights creates an attenuated alias of the source grant.
// SAME_RIGHTS requires DesiredRights=0. DERIVE creates a revocable child grant.
#define SYS_PORT_TRANSFER_FLAG_NONE 0u
#define SYS_PORT_TRANSFER_FLAG_SAME_RIGHTS 0x00000001u
#define SYS_PORT_TRANSFER_FLAG_DERIVE 0x00000002u
#define SYS_PORT_ACCEPT_FLAG_NONE 0u
#define SYS_PORT_CONNECT_FLAG_NONE 0u
// Port-specific capability rights.
#define SYS_PORT_RIGHT_CONNECT 0x00000100u
#define SYS_PORT_RIGHT_ACCEPT 0x00000200u
#define SYS_PORT_RIGHT_SEND 0x00000400u
#define SYS_PORT_RIGHT_RECEIVE 0x00000800u
#define SYS_PORT_RIGHT_CALL 0x00001000u
#define SYS_PORT_RIGHT_REPLY 0x00002000u
#define SYS_PORT_RIGHT_DISCONNECT 0x00004000u
// Describes one capability that accompanies a Port message.
typedef struct SYS_PORT_HANDLE_TRANSFER {
SYS_HANDLE Handle;
SYS_RIGHTS DesiredRights;
uint32_t Flags;
} SYS_PORT_HANDLE_TRANSFER;
// Describes one delivered Port message. Sender identity is always kernel-stamped.
typedef struct SYS_PORT_MESSAGE_INFO {
uint32_t Size;
uint32_t Flags;
uint32_t MessageId;
uint32_t Type;
uint32_t PayloadLength;
uint32_t HandleCount;
uint32_t SenderProcessId;
uint32_t SenderThreadId;
uint32_t SenderSecurityId;
} SYS_PORT_MESSAGE_INFO;
// Describes the client that created one accepted Port connection.
typedef struct SYS_PORT_CONNECTION_INFO {
uint32_t Size;
uint32_t Flags;
uint32_t ClientProcessId;
uint32_t ClientThreadId;
uint32_t ClientSecurityId;
} SYS_PORT_CONNECTION_INFO;
// Creates one connection-listener Port.
typedef struct SYS_CREATE_PORT_REQUEST {
uint32_t Size;
uint32_t Flags;
uint32_t Backlog;
SYS_HANDLE* HandleOut;
} SYS_CREATE_PORT_REQUEST;
// Connects to one listener capability directly.
typedef struct SYS_CONNECT_PORT_REQUEST {
uint32_t Size;
SYS_HANDLE ListenerHandle;
uint32_t Flags;
SYS_HANDLE* EndpointHandleOut;
} SYS_CONNECT_PORT_REQUEST;
// Accepts one queued connection from a listener.
typedef struct SYS_ACCEPT_PORT_REQUEST {
uint32_t Size;
SYS_HANDLE ListenerHandle;
uint32_t Flags;
uint64_t TimeoutMilliseconds;
SYS_HANDLE* EndpointHandleOut;
SYS_PORT_CONNECTION_INFO* ConnectionInfoOut;
} SYS_ACCEPT_PORT_REQUEST;
// Sends one one-way notification to the peer endpoint.
typedef struct SYS_SEND_PORT_REQUEST {
uint32_t Size;
SYS_HANDLE EndpointHandle;
uint32_t Flags;
const void* Payload;
uint32_t PayloadLength;
const SYS_PORT_HANDLE_TRANSFER* Handles;
uint32_t HandleCount;
uint64_t TimeoutMilliseconds;
} SYS_SEND_PORT_REQUEST;
// Receives one request or notification from the endpoint.
typedef struct SYS_RECEIVE_PORT_REQUEST {
uint32_t Size;
SYS_HANDLE EndpointHandle;
uint32_t Flags;
void* Payload;
uint32_t PayloadCapacity;
SYS_HANDLE* HandlesOut;
uint32_t HandleCapacity;
SYS_PORT_MESSAGE_INFO* InfoOut;
uint64_t TimeoutMilliseconds;
} SYS_RECEIVE_PORT_REQUEST;
// Sends a synchronous request and receives its reply. Timeout zero returns WOULD_BLOCK without sending.
typedef struct SYS_CALL_PORT_REQUEST {
uint32_t Size;
SYS_HANDLE EndpointHandle;
uint32_t Flags;
const void* RequestPayload;
uint32_t RequestLength;
const SYS_PORT_HANDLE_TRANSFER* RequestHandles;
uint32_t RequestHandleCount;
void* ReplyPayload;
uint32_t ReplyCapacity;
SYS_HANDLE* ReplyHandlesOut;
uint32_t ReplyHandleCapacity;
SYS_PORT_MESSAGE_INFO* ReplyInfoOut;
uint64_t TimeoutMilliseconds;
} SYS_CALL_PORT_REQUEST;
// Replies to one synchronous request identified by MessageId.
typedef struct SYS_REPLY_PORT_REQUEST {
uint32_t Size;
SYS_HANDLE EndpointHandle;
uint32_t MessageId;
uint32_t Flags;
const void* Payload;
uint32_t PayloadLength;
const SYS_PORT_HANDLE_TRANSFER* Handles;
uint32_t HandleCount;
} SYS_REPLY_PORT_REQUEST;