add ntfs.sys standalone driver target, change default usb vhd layout formatting to ntfs, implement Fat32CreateDir for directory creation support in the fat32 file system driver, add a dedicated HAL serial output endpoint for COM1 writes in hal_serial.c and subscribe serial to HAL text streams, introduce waitable kernel timers with KeTimerCreate, KeTimerSet, and KeTimerCancel alongside spinlock-protected global timer list initialization and scheduler tick tracking, implement SyscallWriteFileAsync system call for asynchronous non-blocking file writes, refactor NetSocketConnect and NetSocketSendTo to use generic SYS_SOCKET_ADDRESS_K structures instead of being hardcoded to IPv4, update gethostbyname and DNS name resolution to support IPv6 parsing via ResolveNameFamily, update tcpserve.exe with -4 and -6 command-line flags to accept and display IPv6 addresses, append size and version headers to all kernel telemetry and statistics structures including SYS_PMM_STATS, SYS_CPU_STATS, and SYS_SCHEDULER_STATS, update winmm timeGetTime to look up high-resolution hardware frequencies via SysGetTickFrequency, integrate 14 native smoke test applications.
This commit is contained in:
1 parent
2c4a68a75f
commit
ed3d065abd
156 files changed
+10509
-2643
No files matched your search
@@ -73,36 +73,44 @@ static uint32_t create_temp(uint32_t* fileOut, const char** pathOut) {
|
||||
for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); ++i) {
|
||||
uint32_t h = 0;
|
||||
delete_path(paths[i]);
|
||||
SYS_PATH_HANDLE_REQUEST req = { SysSvFromCstr(paths[i]), &h };
|
||||
uint32_t s = SysCreateFile(&req);
|
||||
if (s == SYS_STATUS_SUCCESS) {
|
||||
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);
|
||||
if (s == STATUS_SUCCESS) {
|
||||
*fileOut = h;
|
||||
if (pathOut) *pathOut = paths[i];
|
||||
return SYS_STATUS_SUCCESS;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
}
|
||||
return SYS_STATUS_NOT_FOUND;
|
||||
return STATUS_NOT_FOUND;
|
||||
}
|
||||
|
||||
static uint32_t open_path(const char* path, uint32_t* fileOut) {
|
||||
uint32_t h = 0;
|
||||
SYS_PATH_HANDLE_REQUEST req = { SysSvFromCstr(path), &h };
|
||||
SYS_OPEN_FILE_REQUEST req = SysMakeOpenFileRequest(SysSvFromCstr(path),
|
||||
SYS_FILE_ACCESS_READ | SYS_FILE_ACCESS_WRITE | SYS_FILE_ACCESS_QUERY,
|
||||
SYS_FILE_OPEN_EXISTING,
|
||||
SYS_FILE_FLAG_NONE,
|
||||
&h);
|
||||
uint32_t s = SysOpenFile(&req);
|
||||
if (s == SYS_STATUS_SUCCESS)
|
||||
if (s == STATUS_SUCCESS)
|
||||
*fileOut = h;
|
||||
return s;
|
||||
}
|
||||
|
||||
static void checked_seek(uint32_t file, uint64_t offset, const char* what) {
|
||||
uint32_t s = SysSeekFile(file, offset);
|
||||
if (s != SYS_STATUS_SUCCESS) fail_status(what, s);
|
||||
if (s != STATUS_SUCCESS) fail_status(what, s);
|
||||
}
|
||||
|
||||
static void checked_write(uint32_t file, const void* buffer, size_t size, const char* what) {
|
||||
size_t done = 0;
|
||||
SYS_FILE_IO_REQUEST req = SysMakeFileIoRequest(file, buffer, size, &done);
|
||||
uint32_t s = SysWriteFile(&req);
|
||||
if (s != SYS_STATUS_SUCCESS) fail_status(what, s);
|
||||
if (s != STATUS_SUCCESS) fail_status(what, s);
|
||||
if (done != size) fail("short write");
|
||||
}
|
||||
|
||||
@@ -111,7 +119,7 @@ static void checked_read(uint32_t file, void* buffer, size_t size, size_t* gotOu
|
||||
memset(buffer, 0xCC, size);
|
||||
SYS_FILE_IO_REQUEST req = SysMakeFileIoRequest(file, buffer, size, &got);
|
||||
uint32_t s = SysReadFile(&req);
|
||||
if (s != SYS_STATUS_SUCCESS) fail_status(what, s);
|
||||
if (s != STATUS_SUCCESS) fail_status(what, s);
|
||||
if (gotOut) *gotOut = got;
|
||||
}
|
||||
|
||||
@@ -129,7 +137,7 @@ int main(void) {
|
||||
uint32_t file = 0;
|
||||
const char* path = 0;
|
||||
uint32_t s = create_temp(&file, &path);
|
||||
if (s != SYS_STATUS_SUCCESS) fail_status("create temp", s);
|
||||
if (s != STATUS_SUCCESS) fail_status("create temp", s);
|
||||
|
||||
print("shared_mmap: creating temporary file ");
|
||||
print(path ? path : "<unknown>");
|
||||
@@ -137,16 +145,16 @@ int main(void) {
|
||||
|
||||
checked_write(file, gInitial, TEST_SIZE, "initial write");
|
||||
s = SysFlushFile(file);
|
||||
if (s != SYS_STATUS_SUCCESS) fail_status("initial flush", s);
|
||||
if (s != STATUS_SUCCESS) fail_status("initial flush", s);
|
||||
|
||||
uint32_t mapping = 0;
|
||||
s = SysCreateFileMapping(file, SYS_VM_READWRITE, SYS_MAP_FLAG_NONE, TEST_SIZE, &mapping);
|
||||
if (s != SYS_STATUS_SUCCESS) fail_status("create mapping", s);
|
||||
if (s != STATUS_SUCCESS) fail_status("create mapping", s);
|
||||
|
||||
uint8_t* view = 0;
|
||||
s = SysMapFile(mapping, 0, TEST_SIZE, SYS_MAP_ACCESS_READ | SYS_MAP_ACCESS_WRITE,
|
||||
SYS_MAP_FLAG_NONE, (void**)&view);
|
||||
if (s != SYS_STATUS_SUCCESS) fail_status("map shared write", s);
|
||||
if (s != STATUS_SUCCESS) fail_status("map shared write", s);
|
||||
|
||||
for (size_t i = 128; i < 128 + 3000; ++i) {
|
||||
view[i] = (uint8_t)(0xA0u + (uint8_t)i);
|
||||
@@ -159,12 +167,12 @@ int main(void) {
|
||||
|
||||
SYS_FILE_CACHE_STATS beforeFlush;
|
||||
SYS_FILE_CACHE_STATS afterFlush;
|
||||
if (query_cache(&beforeFlush) != SYS_STATUS_SUCCESS) fail("pre-flush stats failed");
|
||||
if (query_cache(&beforeFlush) != STATUS_SUCCESS) fail("pre-flush stats failed");
|
||||
|
||||
s = SysFlushFile(file);
|
||||
if (s != SYS_STATUS_SUCCESS) fail_status("flush mapped writes", s);
|
||||
if (s != STATUS_SUCCESS) fail_status("flush mapped writes", s);
|
||||
|
||||
if (query_cache(&afterFlush) != SYS_STATUS_SUCCESS) fail("post-flush stats failed");
|
||||
if (query_cache(&afterFlush) != STATUS_SUCCESS) fail("post-flush stats failed");
|
||||
if (afterFlush.MappedDirtyPages <= beforeFlush.MappedDirtyPages)
|
||||
fail("mapped dirty pages were not harvested");
|
||||
if (afterFlush.WritebackBytes <= beforeFlush.WritebackBytes)
|
||||
@@ -183,18 +191,18 @@ int main(void) {
|
||||
|
||||
s = SysFreeVm(view);
|
||||
view = 0;
|
||||
if (s != SYS_STATUS_SUCCESS) fail_status("unmap", s);
|
||||
if (s != STATUS_SUCCESS) fail_status("unmap", s);
|
||||
|
||||
s = SysCloseHandle(mapping);
|
||||
mapping = 0;
|
||||
if (s != SYS_STATUS_SUCCESS) fail_status("close mapping", s);
|
||||
if (s != STATUS_SUCCESS) fail_status("close mapping", s);
|
||||
|
||||
s = SysCloseHandle(file);
|
||||
file = 0;
|
||||
if (s != SYS_STATUS_SUCCESS) fail_status("close file", s);
|
||||
if (s != STATUS_SUCCESS) fail_status("close file", s);
|
||||
|
||||
s = open_path(path, &file);
|
||||
if (s != SYS_STATUS_SUCCESS) fail_status("reopen", s);
|
||||
if (s != STATUS_SUCCESS) fail_status("reopen", s);
|
||||
|
||||
checked_read(file, gReadback, TEST_SIZE, &got, "read after close");
|
||||
if (got != TEST_SIZE) fail("read after close size mismatch");
|
||||
@@ -202,7 +210,7 @@ int main(void) {
|
||||
|
||||
s = SysCloseHandle(file);
|
||||
file = 0;
|
||||
if (s != SYS_STATUS_SUCCESS) fail_status("close reopened", s);
|
||||
if (s != STATUS_SUCCESS) fail_status("close reopened", s);
|
||||
delete_path(path);
|
||||
|
||||
print("shared_mmap: mapped-dirty-pages+=");
|
||||
|
||||
Reference in new issue
Block a user