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
@@ -4,13 +4,14 @@
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <ntlite/syscall.h>
|
||||
#include <ntlite/path.h>
|
||||
|
||||
#define TEST_MAP_SIZE 8192u
|
||||
|
||||
static uint8_t gExpected[TEST_MAP_SIZE];
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -58,24 +59,19 @@ static void fail_msg(const char* msg) {
|
||||
static uint32_t open_first_existing(uint32_t* fileOut, const char** pathOut) {
|
||||
static const char* candidates[] = {
|
||||
"mmap_smoke.exe",
|
||||
"/apps/mmap_smoke.exe",
|
||||
"0:/apps/mmap_smoke.exe",
|
||||
"1:/apps/mmap_smoke.exe",
|
||||
"/SystemRoot/apps/mmap_smoke.exe",
|
||||
|
||||
"/system/init.exe",
|
||||
"0:/system/init.exe",
|
||||
"1:/system/init.exe",
|
||||
"/SystemRoot/system/init.exe",
|
||||
"system/init.exe",
|
||||
};
|
||||
|
||||
for (size_t i = 0; i < sizeof(candidates) / sizeof(candidates[0]); ++i) {
|
||||
uint32_t file = 0;
|
||||
SYS_OPEN_FILE_REQUEST openReq = SysMakeOpenFileRequest(SysSvFromCstr(candidates[i]),
|
||||
SYS_FILE_ACCESS_READ | SYS_FILE_ACCESS_QUERY,
|
||||
SYS_FILE_OPEN_EXISTING,
|
||||
SYS_FILE_FLAG_NONE,
|
||||
&file);
|
||||
uint32_t s = SysOpenFile(&openReq);
|
||||
uint32_t s = NtlOpenFile(SysSvFromCstr(candidates[i]),
|
||||
SYS_FILE_ACCESS_READ | SYS_FILE_ACCESS_QUERY,
|
||||
SYS_FILE_OPEN_EXISTING,
|
||||
SYS_FILE_FLAG_NONE,
|
||||
&file);
|
||||
if (s == NTLSTATUS_SUCCESS) {
|
||||
*fileOut = file;
|
||||
if (pathOut)
|
||||
@@ -113,11 +109,11 @@ int main(void) {
|
||||
print("mmap_smoke: baseline read OK\n");
|
||||
|
||||
uint32_t mapping = 0;
|
||||
s = SysCreateFileMapping(file,
|
||||
SYS_VM_READ,
|
||||
SYS_MAP_FLAG_NONE,
|
||||
sizeof(gExpected),
|
||||
&mapping);
|
||||
SYS_CREATE_FILE_MAPPING_REQUEST createMapping = {
|
||||
sizeof(SYS_CREATE_FILE_MAPPING_REQUEST), file, SYS_VM_READ,
|
||||
SYS_MAP_FLAG_NONE, sizeof(gExpected), &mapping
|
||||
};
|
||||
s = SysCreateFileMapping(&createMapping);
|
||||
if (s != NTLSTATUS_SUCCESS)
|
||||
fail_status("create file mapping", s);
|
||||
|
||||
@@ -131,12 +127,11 @@ int main(void) {
|
||||
print("mmap_smoke: source handle closed\n");
|
||||
|
||||
void* base = 0;
|
||||
s = SysMapFile(mapping,
|
||||
0,
|
||||
sizeof(gExpected),
|
||||
SYS_MAP_ACCESS_READ,
|
||||
SYS_MAP_FLAG_NONE,
|
||||
&base);
|
||||
SYS_MAP_FILE_REQUEST mapFile = {
|
||||
sizeof(SYS_MAP_FILE_REQUEST), mapping, SYS_MAP_ACCESS_READ,
|
||||
SYS_MAP_FLAG_NONE, 0, sizeof(gExpected), &base
|
||||
};
|
||||
s = SysMapFile(&mapFile);
|
||||
|
||||
SysCloseHandle(mapping);
|
||||
mapping = 0;
|
||||
|
||||
Reference in new issue
Block a user