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
@@ -5,6 +5,7 @@
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <ntlite/syscall.h>
|
||||
#include <ntlite/path.h>
|
||||
|
||||
#define TEST_SIZE 8192u
|
||||
#define TRUNC_SIZE 1024u
|
||||
@@ -14,7 +15,7 @@ static uint8_t gReplacement[4096];
|
||||
static uint8_t gReadback[TEST_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);
|
||||
}
|
||||
|
||||
@@ -58,27 +59,22 @@ static uint32_t query_cache(SYS_FILE_CACHE_STATS* out) {
|
||||
}
|
||||
|
||||
static void delete_path(const char* path) {
|
||||
SYS_PATH_REQUEST req = { SysSvFromCstr(path) };
|
||||
(void)SysDeleteFile(&req);
|
||||
(void)NtlDeleteFile(SysSvFromCstr(path));
|
||||
}
|
||||
|
||||
static uint32_t create_temp(uint32_t* fileOut, const char** pathOut) {
|
||||
static const char* paths[] = {
|
||||
"pcache_invalidate.tmp",
|
||||
"/pcache_invalidate.tmp",
|
||||
"1:/pcache_invalidate.tmp",
|
||||
"0:/pcache_invalidate.tmp",
|
||||
};
|
||||
|
||||
for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); ++i) {
|
||||
uint32_t h = 0;
|
||||
delete_path(paths[i]);
|
||||
SYS_OPEN_FILE_REQUEST req = SysMakeOpenFileRequest(SysSvFromCstr(paths[i]),
|
||||
SYS_FILE_ACCESS_READ | SYS_FILE_ACCESS_WRITE | SYS_FILE_ACCESS_QUERY,
|
||||
SYS_FILE_CREATE_NEW,
|
||||
SYS_FILE_FLAG_NONE,
|
||||
&h);
|
||||
uint32_t s = SysOpenFile(&req);
|
||||
uint32_t s = NtlOpenFile(SysSvFromCstr(paths[i]),
|
||||
SYS_FILE_ACCESS_READ | SYS_FILE_ACCESS_WRITE | SYS_FILE_ACCESS_QUERY,
|
||||
SYS_FILE_CREATE_NEW,
|
||||
SYS_FILE_FLAG_NONE,
|
||||
&h);
|
||||
if (s == NTLSTATUS_SUCCESS) {
|
||||
*fileOut = h;
|
||||
if (pathOut) *pathOut = paths[i];
|
||||
@@ -169,11 +165,19 @@ int main(void) {
|
||||
if (afterWrite.DirtyMarks <= afterSecond.DirtyMarks) fail("rewrite did not dirty cached page");
|
||||
|
||||
uint32_t mapping = 0;
|
||||
s = SysCreateFileMapping(file, SYS_VM_READ, SYS_MAP_FLAG_NONE, sizeof(gReplacement), &mapping);
|
||||
SYS_CREATE_FILE_MAPPING_REQUEST createMapping = {
|
||||
sizeof(SYS_CREATE_FILE_MAPPING_REQUEST), file, SYS_VM_READ,
|
||||
SYS_MAP_FLAG_NONE, sizeof(gReplacement), &mapping
|
||||
};
|
||||
s = SysCreateFileMapping(&createMapping);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("create mapping after rewrite", s);
|
||||
|
||||
void* mappedBase = 0;
|
||||
s = SysMapFile(mapping, 0, sizeof(gReplacement), SYS_MAP_ACCESS_READ, SYS_MAP_FLAG_NONE, &mappedBase);
|
||||
SYS_MAP_FILE_REQUEST mapFile = {
|
||||
sizeof(SYS_MAP_FILE_REQUEST), mapping, SYS_MAP_ACCESS_READ,
|
||||
SYS_MAP_FLAG_NONE, 0, sizeof(gReplacement), &mappedBase
|
||||
};
|
||||
s = SysMapFile(&mapFile);
|
||||
SysCloseHandle(mapping);
|
||||
if (s != NTLSTATUS_SUCCESS) fail_status("map after rewrite", s);
|
||||
if (!mappedBase) fail("map after rewrite returned null");
|
||||
|
||||
Reference in new issue
Block a user