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
+23
-14
@@ -133,9 +133,9 @@ static bool parse_u32(const char* s, uint32_t* out) {
|
||||
// Implements the resolve host operation.
|
||||
static uint32_t resolve_host(const char* host, uint8_t ip[4]) {
|
||||
if (parse_ipv4(host, ip))
|
||||
return SYS_STATUS_SUCCESS;
|
||||
return STATUS_SUCCESS;
|
||||
|
||||
SYS_SOCKET_ADDRESS_IPV4 resolved;
|
||||
SYS_SOCKET_ADDRESS resolved;
|
||||
size_t resolvedSize = sizeof(resolved);
|
||||
SYS_RESOLVE_HOST_REQUEST req;
|
||||
memset(&resolved, 0, sizeof(resolved));
|
||||
@@ -146,16 +146,16 @@ static uint32_t resolve_host(const char* host, uint8_t ip[4]) {
|
||||
req.AddressSizeInOut = &resolvedSize;
|
||||
|
||||
uint32_t st = SysResolveHost(&req);
|
||||
if (st != SYS_STATUS_SUCCESS)
|
||||
if (st != STATUS_SUCCESS)
|
||||
return st;
|
||||
if (resolved.Family != SYS_AF_INET)
|
||||
return SYS_STATUS_NOT_FOUND;
|
||||
return STATUS_NOT_FOUND;
|
||||
|
||||
ip[0] = resolved.Address[0];
|
||||
ip[1] = resolved.Address[1];
|
||||
ip[2] = resolved.Address[2];
|
||||
ip[3] = resolved.Address[3];
|
||||
return SYS_STATUS_SUCCESS;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
// Implements the icmp checksum operation.
|
||||
@@ -258,7 +258,7 @@ int main(void) {
|
||||
|
||||
uint8_t ip[4];
|
||||
uint32_t st = resolve_host(host, ip);
|
||||
if (st != SYS_STATUS_SUCCESS) {
|
||||
if (st != STATUS_SUCCESS) {
|
||||
print("ping: resolve failed "); print_u64(st); print(" for "); print(host); print("\n");
|
||||
SysExitProcess(1);
|
||||
}
|
||||
@@ -268,7 +268,7 @@ int main(void) {
|
||||
|
||||
uint32_t sock = 0;
|
||||
st = SysCreateSocket(SYS_AF_INET, SYS_SOCK_RAW, SYS_IPPROTO_ICMP, &sock);
|
||||
if (st != SYS_STATUS_SUCCESS) {
|
||||
if (st != STATUS_SUCCESS) {
|
||||
print("ping: SysCreateSocket(raw icmp) failed "); print_u64(st); print("\n");
|
||||
SysExitProcess(1);
|
||||
}
|
||||
@@ -281,8 +281,17 @@ int main(void) {
|
||||
opt.ValueSize = sizeof(timeout);
|
||||
(void)SysSetSocketOption(sock, &opt);
|
||||
|
||||
SYS_SOCKET_ADDRESS_IPV4 remote;
|
||||
uint64_t tickFrequency = 0;
|
||||
st = SysGetTickFrequency(&tickFrequency);
|
||||
if (st != STATUS_SUCCESS || !tickFrequency) {
|
||||
print("ping: SysGetTickFrequency failed "); print_u64(st); print("\n");
|
||||
SysCloseHandle(sock);
|
||||
SysExitProcess(1);
|
||||
}
|
||||
|
||||
SYS_SOCKET_ADDRESS remote;
|
||||
memset(&remote, 0, sizeof(remote));
|
||||
remote.Size = sizeof(remote);
|
||||
remote.Family = SYS_AF_INET;
|
||||
remote.Port = 0;
|
||||
remote.Address[0] = ip[0];
|
||||
@@ -314,7 +323,7 @@ int main(void) {
|
||||
|
||||
uint64_t start = SysGetTick();
|
||||
st = SysSendToSocket(sock, &sendReq);
|
||||
if (st != SYS_STATUS_SUCCESS) {
|
||||
if (st != STATUS_SUCCESS) {
|
||||
print("ping: send failed seq="); print_u64(seq); print(" status="); print_u64(st); print("\n");
|
||||
if (i + 1 < count) SysSleep(1000);
|
||||
continue;
|
||||
@@ -325,7 +334,7 @@ int main(void) {
|
||||
uint8_t lastType = 0, lastCode = 0;
|
||||
for (;;) {
|
||||
uint8_t recvBuf[512];
|
||||
SYS_SOCKET_ADDRESS_IPV4 from;
|
||||
SYS_SOCKET_ADDRESS from;
|
||||
size_t fromSize = sizeof(from);
|
||||
size_t got = 0;
|
||||
SYS_SOCKET_RECV_FROM_REQUEST recvReq;
|
||||
@@ -337,9 +346,9 @@ int main(void) {
|
||||
recvReq.ReceivedOut = &got;
|
||||
|
||||
st = SysRecvFromSocket(sock, &recvReq);
|
||||
if (st == SYS_STATUS_TIMEOUT)
|
||||
if (st == STATUS_TIMEOUT)
|
||||
break;
|
||||
if (st != SYS_STATUS_SUCCESS) {
|
||||
if (st != STATUS_SUCCESS) {
|
||||
print("ping: recv failed status="); print_u64(st); print("\n");
|
||||
break;
|
||||
}
|
||||
@@ -347,7 +356,7 @@ int main(void) {
|
||||
size_t icmpLen = 0;
|
||||
if (parse_echo_reply(recvBuf, got, ident, seq, &icmpLen, &lastType, &lastCode)) {
|
||||
uint64_t end = SysGetTick();
|
||||
uint64_t deltaUs = end >= start ? end - start : 0;
|
||||
uint64_t deltaUs = end >= start ? SysTicksToMicroseconds(end - start, tickFrequency) : 0;
|
||||
receivedPackets++;
|
||||
sumUs += deltaUs;
|
||||
if (receivedPackets == 1 || deltaUs < minUs) minUs = deltaUs;
|
||||
@@ -361,7 +370,7 @@ int main(void) {
|
||||
}
|
||||
|
||||
uint64_t now = SysGetTick();
|
||||
if (now - start >= ((uint64_t)PING_TIMEOUT_MS * US_PER_MS))
|
||||
if (SysTicksToMilliseconds(now - start, tickFrequency) >= PING_TIMEOUT_MS)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user