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
@@ -25,6 +25,7 @@ typedef struct HAL_SCREEN {
|
||||
KSTATUS (*GetFramebuffer)(HAL_FRAMEBUFFER_INFO* outInfo);
|
||||
void (*Scroll)(int lines);
|
||||
void (*PutChar)(char c, int x, int y, uint32_t fg, uint32_t bg);
|
||||
// Writes only to the boot framebuffer text console. Stream routing belongs to HAL_OUTPUT_ROUTER.
|
||||
void (*PrintChar)(char c, uint32_t fg, uint32_t bg);
|
||||
// Legacy software cursor hooks kept for early-boot/panic fallback only.
|
||||
// Normal input cursor ownership lives in ke_display.
|
||||
@@ -32,14 +33,69 @@ typedef struct HAL_SCREEN {
|
||||
void (*EraseCursor)(void);
|
||||
} HAL_SCREEN;
|
||||
|
||||
// Output streams describe the producer's intent. Endpoints subscribe by mask.
|
||||
#define HAL_OUTPUT_STREAM_DEBUG 0x00000001u
|
||||
#define HAL_OUTPUT_STREAM_CONSOLE 0x00000002u
|
||||
#define HAL_OUTPUT_STREAM_CRASH 0x00000004u
|
||||
#define HAL_OUTPUT_STREAM_PANIC 0x00000008u
|
||||
#define HAL_OUTPUT_STREAM_ALL 0x0000000Fu
|
||||
|
||||
// Emergency writes bypass endpoints that cannot run without scheduler services.
|
||||
#define HAL_OUTPUT_WRITE_EMERGENCY 0x00000001u
|
||||
#define HAL_OUTPUT_ENDPOINT_PANIC_SAFE 0x00000001u
|
||||
#define HAL_OUTPUT_ENDPOINT_INVALID UINT32_MAX
|
||||
|
||||
typedef struct HAL_OUTPUT_RECORD {
|
||||
// Exactly one HAL_OUTPUT_STREAM_* value.
|
||||
uint32_t Stream;
|
||||
// HAL_OUTPUT_WRITE_* flags.
|
||||
uint32_t Flags;
|
||||
// X8R8G8B8 text color hints.
|
||||
uint32_t Foreground;
|
||||
uint32_t Background;
|
||||
// The buffer remains valid only for the duration of Write().
|
||||
const char* Buffer;
|
||||
size_t Length;
|
||||
} HAL_OUTPUT_RECORD;
|
||||
|
||||
// Endpoint callbacks consume or copy the record synchronously and must not retain Buffer.
|
||||
typedef void (*HAL_OUTPUT_ENDPOINT_WRITE)(void* context, const HAL_OUTPUT_RECORD* record);
|
||||
|
||||
typedef struct HAL_OUTPUT_ENDPOINT {
|
||||
// The name remains stable for the endpoint lifetime.
|
||||
const char* Name;
|
||||
uint32_t StreamMask;
|
||||
uint32_t Capabilities;
|
||||
HAL_OUTPUT_ENDPOINT_WRITE Write;
|
||||
void* Context;
|
||||
} HAL_OUTPUT_ENDPOINT;
|
||||
|
||||
typedef struct HAL_OUTPUT_STATS {
|
||||
uint64_t RecordCount;
|
||||
uint64_t ByteCount;
|
||||
uint64_t EndpointWriteCount;
|
||||
uint64_t EmergencyRecordCount;
|
||||
uint32_t EndpointCount;
|
||||
} HAL_OUTPUT_STATS;
|
||||
|
||||
typedef struct HAL_OUTPUT_ROUTER {
|
||||
// Registration is append-only; endpoint callbacks and context remain valid until shutdown.
|
||||
KSTATUS (*RegisterEndpoint)(const HAL_OUTPUT_ENDPOINT* endpoint, uint32_t* endpointIdOut);
|
||||
KSTATUS (*SetEndpointStreams)(uint32_t endpointId, uint32_t streamMask);
|
||||
void (*Write)(const HAL_OUTPUT_RECORD* record);
|
||||
void (*QueryStats)(HAL_OUTPUT_STATS* statsOut);
|
||||
uint32_t SerialEndpointId;
|
||||
uint32_t BootFramebufferEndpointId;
|
||||
} HAL_OUTPUT_ROUTER;
|
||||
|
||||
typedef struct HAL_TIMER {
|
||||
uint64_t (*QueryTicks)(void);
|
||||
uint64_t (*QueryTickFrequency)(void);
|
||||
void (*Stall)(uint32_t us);
|
||||
void (*Isr)(void);
|
||||
uint8_t IrqNumber;
|
||||
} HAL_TIMER;
|
||||
|
||||
|
||||
#define HAL_RTC_TIME_FLAG_VALID 0x0001u
|
||||
#define HAL_RTC_TIME_FLAG_RTC 0x0002u
|
||||
|
||||
@@ -60,7 +116,7 @@ typedef struct HAL_RTC {
|
||||
} HAL_RTC;
|
||||
|
||||
typedef struct HAL_PCI {
|
||||
// Raw PCI configuration access. Policy-level operations such as
|
||||
// Raw PCI configuration access. Policy-level operations such as
|
||||
// enumeration, BAR decoding, interrupt discovery, and MSI programming
|
||||
// belong to pci.sys.
|
||||
uint32_t (*Read32)(uint16_t segment,
|
||||
@@ -94,6 +150,7 @@ typedef struct HAL_API {
|
||||
uint32_t Version;
|
||||
void *(*PhysToVirt)(uint64_t physAddr);
|
||||
HAL_SCREEN Screen;
|
||||
HAL_OUTPUT_ROUTER Output;
|
||||
HAL_TIMER Timer;
|
||||
HAL_RTC Rtc;
|
||||
HAL_PCI Pci;
|
||||
@@ -120,8 +177,27 @@ typedef struct HAL_INIT_PARAMS {
|
||||
void* (*AllocatePool)(size_t size);
|
||||
} HAL_INIT_PARAMS;
|
||||
|
||||
#define HAL_API_VERSION // do not change during development
|
||||
// Increment when the HAL API layout or semantics change when we go from indev to alpha.
|
||||
#define HAL_API_VERSION 1
|
||||
|
||||
__declspec(dllexport) const HAL_API* HalGetApi(void);
|
||||
__declspec(dllexport) void HalRegisterScheduler(void (*pKeSchedulerTick)(void));
|
||||
__declspec(dllexport) KSTATUS HalInitialize(const HAL_INIT_PARAMS* params);
|
||||
|
||||
// Masks interrupts and returns the previous RFLAGS value.
|
||||
__declspec(dllexport) uintptr_t HalDisableInterrupts(void);
|
||||
|
||||
// Restores the RFLAGS value returned by HalDisableInterrupts.
|
||||
__declspec(dllexport) void HalRestoreInterrupts(uintptr_t flags);
|
||||
|
||||
// Enables maskable interrupts.
|
||||
__declspec(dllexport) void HalEnableInterrupts(void);
|
||||
|
||||
// Enables interrupts and halts until the processor receives an interrupt.
|
||||
__declspec(dllexport) void HalWaitForInterrupt(void);
|
||||
|
||||
// Halts once without changing the interrupt state.
|
||||
__declspec(dllexport) void HalHalt(void);
|
||||
|
||||
// Masks interrupts and permanently stops the current processor.
|
||||
__declspec(dllexport) _Noreturn void HalStopProcessor(void);
|
||||
Reference in new issue
Block a user