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:
maksw committed 2026-06-26 15:18:48 +02:00
1 parent 2c4a68a75f
commit ed3d065abd
156 files changed
+10509 -2643

No files matched your search

@@ -73,16 +73,20 @@ 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 void fill_patterns(void) {
@@ -96,7 +100,7 @@ static void checked_write(uint32_t file, const void* buffer, size_t size, const
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");
}
@@ -105,7 +109,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;
}
@@ -116,7 +120,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("pcache_invalidate: using ");
print(path ? path : "<unknown>");
@@ -125,7 +129,7 @@ int main(void) {
checked_write(file, gOriginal, sizeof(gOriginal), "write original");
s = SysSeekFile(file, 0);
if (s != SYS_STATUS_SUCCESS) fail_status("seek fill", s);
if (s != STATUS_SUCCESS) fail_status("seek fill", s);
SYS_FILE_CACHE_STATS before;
SYS_FILE_CACHE_STATS afterFill;
@@ -133,44 +137,44 @@ int main(void) {
SYS_FILE_CACHE_STATS afterWrite;
SYS_FILE_CACHE_STATS afterRewriteRead;
SYS_FILE_CACHE_STATS afterTruncate;
if (query_cache(&before) != SYS_STATUS_SUCCESS) fail("initial stats query failed");
if (query_cache(&before) != STATUS_SUCCESS) fail("initial stats query failed");
size_t got = 0;
checked_read(file, gReadback, sizeof(gReadback), &got, "first read");
if (got != sizeof(gOriginal)) fail("first read size mismatch");
if (memcmp(gReadback, gOriginal, sizeof(gOriginal)) != 0) fail("first read data mismatch");
if (query_cache(&afterFill) != SYS_STATUS_SUCCESS) fail("fill stats query failed");
if (query_cache(&afterFill) != STATUS_SUCCESS) fail("fill stats query failed");
if (afterFill.Loads <= before.Loads) fail("initial read did not populate cache");
s = SysSeekFile(file, 0);
if (s != SYS_STATUS_SUCCESS) fail_status("seek second", s);
if (s != STATUS_SUCCESS) fail_status("seek second", s);
checked_read(file, gReadback, sizeof(gReadback), &got, "second read");
if (got != sizeof(gOriginal)) fail("second read size mismatch");
if (memcmp(gReadback, gOriginal, sizeof(gOriginal)) != 0) fail("second read data mismatch");
if (query_cache(&afterSecond) != SYS_STATUS_SUCCESS) fail("second stats query failed");
if (query_cache(&afterSecond) != STATUS_SUCCESS) fail("second stats query failed");
// Do not require this second read to hit: the cache is intentionally
// bounded and pcache_pressure.exe may have left it at the soft limit, so
// the newly-populated temp pages are eligible for immediate pressure
// eviction. This test is about write/truncate freshness; mmap/read reuse
// eviction. This test is about write/truncate freshness; mmap/read reuse
// is covered by pcache_mmap_read_reuse.exe.
s = SysSeekFile(file, 0);
if (s != SYS_STATUS_SUCCESS) fail_status("seek rewrite", s);
if (s != STATUS_SUCCESS) fail_status("seek rewrite", s);
checked_write(file, gReplacement, sizeof(gReplacement), "rewrite first page");
if (query_cache(&afterWrite) != SYS_STATUS_SUCCESS) fail("post-write stats query failed");
if (query_cache(&afterWrite) != STATUS_SUCCESS) fail("post-write stats query failed");
if (afterWrite.Invalidations <= afterSecond.Invalidations) fail("write did not invalidate cached page");
uint32_t mapping = 0;
s = SysCreateFileMapping(file, SYS_VM_READ, SYS_MAP_FLAG_NONE, sizeof(gReplacement), &mapping);
if (s != SYS_STATUS_SUCCESS) fail_status("create mapping after rewrite", s);
if (s != STATUS_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);
SysCloseHandle(mapping);
if (s != SYS_STATUS_SUCCESS) fail_status("map after rewrite", s);
if (s != STATUS_SUCCESS) fail_status("map after rewrite", s);
if (!mappedBase) fail("map after rewrite returned null");
volatile uint8_t* mappedView = (volatile uint8_t*)mappedBase;
@@ -181,27 +185,30 @@ int main(void) {
fail("stale mmap data after write invalidation");
}
s = SysFreeVm(mappedBase);
if (s != SYS_STATUS_SUCCESS) fail_status("unmap after rewrite", s);
if (s != STATUS_SUCCESS) fail_status("unmap after rewrite", s);
s = SysSeekFile(file, 0);
if (s != SYS_STATUS_SUCCESS) fail_status("seek verify rewrite", s);
if (s != STATUS_SUCCESS) fail_status("seek verify rewrite", s);
checked_read(file, gReadback, sizeof(gReadback), &got, "read after rewrite");
if (got != sizeof(gOriginal)) fail("rewrite read size mismatch");
if (memcmp(gReadback, gReplacement, sizeof(gReplacement)) != 0) fail("stale data after write invalidation");
if (memcmp(gReadback + sizeof(gReplacement), gOriginal + sizeof(gReplacement),
sizeof(gOriginal) - sizeof(gReplacement)) != 0) fail("unwritten page changed after rewrite");
if (query_cache(&afterRewriteRead) != SYS_STATUS_SUCCESS) fail("rewrite-read stats query failed");
if (query_cache(&afterRewriteRead) != STATUS_SUCCESS) fail("rewrite-read stats query failed");
s = SysTruncateFile(file, TRUNC_SIZE);
if (s != SYS_STATUS_SUCCESS) fail_status("truncate", s);
if (SysGetFileSize(file) != TRUNC_SIZE) fail("truncate size mismatch");
if (s != STATUS_SUCCESS) fail_status("truncate", s);
uint64_t truncatedSize = 0;
s = SysGetFileSize(file, &truncatedSize);
if (s != STATUS_SUCCESS) fail_status("get truncated size", s);
if (truncatedSize != TRUNC_SIZE) fail("truncate size mismatch");
if (query_cache(&afterTruncate) != SYS_STATUS_SUCCESS) fail("truncate stats query failed");
if (query_cache(&afterTruncate) != STATUS_SUCCESS) fail("truncate stats query failed");
if (afterTruncate.Invalidations <= afterRewriteRead.Invalidations) fail("truncate did not invalidate cached tail");
s = SysSeekFile(file, 0);
if (s != SYS_STATUS_SUCCESS) fail_status("seek truncated", s);
if (s != STATUS_SUCCESS) fail_status("seek truncated", s);
checked_read(file, gReadback, sizeof(gReadback), &got, "read truncated");
if (got != TRUNC_SIZE) fail("truncated read length mismatch");
if (memcmp(gReadback, gReplacement, TRUNC_SIZE) != 0) fail("truncated data mismatch");