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:
1 parent
4add6789ba
commit
f882d339fb
232 files changed
+20934
-8898
No files matched your search
@@ -1,15 +1,16 @@
|
||||
// Native syscall contract smoke test.
|
||||
// Verifies public tick units and process exit-code round trips.
|
||||
// Verifies public syscall ABI contracts, tick units, and process exit-code round trips.
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <ntlite/syscall.h>
|
||||
#include <ntlite/process_loader.h>
|
||||
|
||||
#define CHILD_EXIT_CODE ((int32_t)-1234567)
|
||||
|
||||
// Prints one NUL-terminated string to the kernel console.
|
||||
static void print(const char* s) {
|
||||
SYS_WRITE_CONSOLE_REQUEST req = { SysSvFromCstr(s) };
|
||||
SYS_WRITE_CONSOLE_REQUEST req = { sizeof(SYS_WRITE_CONSOLE_REQUEST), SysSvFromCstr(s) };
|
||||
SysWriteConsole(&req);
|
||||
}
|
||||
|
||||
@@ -27,7 +28,7 @@ static void print_u64(uint64_t v) {
|
||||
}
|
||||
while (i--) {
|
||||
char c = buf[i];
|
||||
SYS_WRITE_CONSOLE_REQUEST req = { SysSvFromParts(&c, 1) };
|
||||
SYS_WRITE_CONSOLE_REQUEST req = { sizeof(SYS_WRITE_CONSOLE_REQUEST), SysSvFromParts(&c, 1) };
|
||||
SysWriteConsole(&req);
|
||||
}
|
||||
}
|
||||
@@ -89,13 +90,17 @@ static void check_exit_code_contract(void) {
|
||||
if (!peb || !peb->ImagePath.Data || peb->ImagePath.Length == 0) fail("missing image path");
|
||||
|
||||
uint32_t child = 0;
|
||||
SYS_CREATE_PROCESS_REQUEST req = {
|
||||
peb->ImagePath,
|
||||
SysSvFromCstr("child"),
|
||||
&child,
|
||||
};
|
||||
NTL_CREATE_SYSTEM_PROCESS_REQUEST req;
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.Size = sizeof(req);
|
||||
req.Flags = NTL_PROCESS_LOAD_FLAG_NONE;
|
||||
req.Path = peb->ImagePath;
|
||||
req.CommandLine = SysSvFromCstr("child");
|
||||
req.SecurityContext = SYS_SECURITY_CONTEXT_CURRENT;
|
||||
req.ResolveModuleName = NtlResolveSystemModuleName;
|
||||
req.ProcessHandleOut = &child;
|
||||
|
||||
uint32_t s = SysCreateProcess(&req);
|
||||
uint32_t s = NtlCreateSystemProcess(&req);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("create child", s);
|
||||
|
||||
s = SysWait(child, SYS_WAIT_FLAG_NONE);
|
||||
@@ -109,6 +114,22 @@ static void check_exit_code_contract(void) {
|
||||
SysCloseHandle(child);
|
||||
}
|
||||
|
||||
// Verifies request structures reject stale layouts instead of accepting compatibility prefixes.
|
||||
static void check_request_size_contract(void) {
|
||||
SYS_PRINT_DEBUG_REQUEST request = {
|
||||
sizeof(SYS_PRINT_DEBUG_REQUEST) - 1u,
|
||||
SysSvFromCstr("size check must not print"),
|
||||
};
|
||||
uint32_t s = SysPrintDebug(&request);
|
||||
if (s != NTLSTATUS_INVALID_PARAMETER)
|
||||
fail_status("undersized request was accepted", s);
|
||||
|
||||
request.Size = sizeof(SYS_PRINT_DEBUG_REQUEST) + 8u;
|
||||
s = SysPrintDebug(&request);
|
||||
if (s != NTLSTATUS_INVALID_PARAMETER)
|
||||
fail_status("oversized request was accepted", s);
|
||||
}
|
||||
|
||||
// Runs the syscall ABI contract smoke test.
|
||||
int main(void) {
|
||||
SYS_PEB* peb = SysGetPeb();
|
||||
@@ -118,6 +139,7 @@ int main(void) {
|
||||
|
||||
print("syscall_contract_smoke: start\n");
|
||||
check_tick_contract();
|
||||
check_request_size_contract();
|
||||
check_exit_code_contract();
|
||||
print("syscall_contract_smoke: PASS\n");
|
||||
exit_now(0);
|
||||
|
||||
Reference in new issue
Block a user