replace the VHD/diskpart disk image pipeline with a directory-based vvfat root, we'll see when it breaks, fix /O2, add an all_tests, generalize the fat32 driver into a fat 16+32 driver, change policy on volume drivers, collapse KCPU's fields into a single atomic KE_CPU_STATE state machine, move scheduler ticking to per-CPU LAPIC timers, gate verbose SMP topology logging behind selftest diagnostics and add SMP pool-checkpoint validation around AP admission, add checked intrusive list helpers behind a new KE_DEBUG_LIST_CHECKS flag, add ObInitializeObjectHeader/ObTryReferenceObject, add waitable display clock objects and a SYS_OPEN_DISPLAY_CLOCK syscall for vsync-style waits, refactor kernel input into a per-queue KE_INPUT_CONTEXT with its own key/mouse ring buffers and DPC-driven key repeat, add KeInputQueuePeekEvent/ReadEvent/WaitKey and a SYS_QUERY_GLOBAL_INPUT_STATE syscall, split the kernel pool allocator out of mm_virt, new video files!
This commit is contained in:
1 parent
485a6bbfe7
commit
8b254f84f4
74 files changed
+4488
-2503
No files matched your search
@@ -67,3 +67,4 @@ struct DISPLAY_DEVICE {
|
||||
|
||||
DISPLAY_API KSTATUS KeDisplayRegisterDevice(DISPLAY_DEVICE* device);
|
||||
DISPLAY_API KSTATUS KeDisplaySetPrimary(DISPLAY_DEVICE* device);
|
||||
DISPLAY_API void KeDisplayNotifyFrame(DISPLAY_DEVICE* device);
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <ntlite/ddk/time.h>
|
||||
#include <ntlite/ddk/timer.h>
|
||||
|
||||
#define NTL_DDK_VERSION 1u
|
||||
#define NTL_DDK_VERSION 2u
|
||||
|
||||
// Root DDK table passed to kernel drivers by the driver loader.
|
||||
typedef struct NTL_DDK {
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
// Kernel object type identifiers used by the legacy object header.
|
||||
// Kernel object type identifiers used by the shared object header.
|
||||
typedef enum OBJECT_TYPE {
|
||||
ObjectTypeProcess = 1,
|
||||
ObjectTypeThread = 2,
|
||||
@@ -27,16 +28,35 @@ typedef enum OBJECT_TYPE {
|
||||
ObjectTypeImageSection = 18,
|
||||
ObjectTypeTimer = 19,
|
||||
ObjectTypeModule = 20,
|
||||
ObjectTypeDisplayClock = 21,
|
||||
} OBJECT_TYPE;
|
||||
|
||||
// Legacy object header embedded by current driver/device objects.
|
||||
typedef enum OBJECT_LIFETIME_STATE {
|
||||
ObjectAlive = 1,
|
||||
ObjectDying,
|
||||
ObjectDead
|
||||
} OBJECT_LIFETIME_STATE;
|
||||
|
||||
#define OBJECT_FLAG_INSERTED 0x00000001u
|
||||
#define OBJECT_FLAG_UNLINKED 0x00000002u
|
||||
|
||||
// Object header embedded by kernel and driver-owned reference-counted objects.
|
||||
typedef struct OBJECT {
|
||||
OBJECT_TYPE Type;
|
||||
volatile long RefCount;
|
||||
volatile long LifetimeState;
|
||||
volatile long Flags;
|
||||
void (*Destroy)(struct OBJECT* self);
|
||||
} OBJECT;
|
||||
|
||||
// Increments an object's reference count.
|
||||
// Initializes an embedded object header with one live reference.
|
||||
__declspec(dllexport) void ObInitializeObjectHeader(OBJECT* object, OBJECT_TYPE type);
|
||||
|
||||
// Acquires a reference only while the object is alive and inserted.
|
||||
// The caller must stabilize the pointer through its owning lock or reference.
|
||||
__declspec(dllexport) bool ObTryReferenceObject(OBJECT* object);
|
||||
|
||||
// Increments an object's reference count and stops on stale-object misuse.
|
||||
__declspec(dllexport) void ObReferenceObject(OBJECT* object);
|
||||
|
||||
// Decrements an object's reference count and destroys it when it reaches zero.
|
||||
|
||||
@@ -94,6 +94,7 @@ typedef struct DISPLAY_STATS {
|
||||
#define DISPLAY_CAP_PRESENT_SYNC 0x00000020u
|
||||
#define DISPLAY_CAP_VBLANK 0x00000040u
|
||||
#define DISPLAY_CAP_3D 0x00000080u
|
||||
#define DISPLAY_CAP_FRAME_EVENT 0x00000100u
|
||||
|
||||
#define SYS_DISPLAY_NAME_MAX 32u
|
||||
|
||||
|
||||
@@ -560,6 +560,7 @@ KSTATUS SysKillProcess(uint32_t processHandle, int32_t exitCode);
|
||||
#define SYS_THREAD_WAIT_FILE_MAPPING 15u
|
||||
#define SYS_THREAD_WAIT_SURFACE 16u
|
||||
#define SYS_THREAD_WAIT_TIMER 17u
|
||||
#define SYS_THREAD_WAIT_DISPLAY_CLOCK 18u
|
||||
#define SYS_THREAD_WAIT_UNKNOWN 0xffffffffu
|
||||
|
||||
typedef struct SYS_THREAD_INFO {
|
||||
@@ -863,9 +864,41 @@ KSTATUS SysClearScreen(uint32_t color);
|
||||
KSTATUS SysGetScreenSize(int* widthOut, int* heightOut);
|
||||
KSTATUS SysQueryDisplayInfo(SYS_DISPLAY_INFO* infoOut);
|
||||
|
||||
// Display clocks are waitable pacing objects. Providers with frame-event
|
||||
// support signal them once per submitted frame. Other providers use the BSP
|
||||
// scheduler tick, with PeriodMilliseconds rounded up to one or more ticks.
|
||||
#define SYS_DISPLAY_CLOCK_FLAG_NONE 0u
|
||||
#define SYS_DISPLAY_CLOCK_DEFAULT_PERIOD_MS 1ull
|
||||
|
||||
typedef struct SYS_OPEN_DISPLAY_CLOCK_REQUEST {
|
||||
uint32_t Size;
|
||||
uint32_t Flags;
|
||||
uint64_t PeriodMilliseconds;
|
||||
uint32_t* HandleOut;
|
||||
} SYS_OPEN_DISPLAY_CLOCK_REQUEST;
|
||||
|
||||
KSTATUS SysOpenDisplayClock(const SYS_OPEN_DISPLAY_CLOCK_REQUEST* request);
|
||||
|
||||
// Input.
|
||||
#define SYS_INPUT_QUEUE_FLAG_NONE 0x00000000u
|
||||
#define SYS_INPUT_EVENT_FLAG_NONE 0x00000000u
|
||||
#define SYS_GLOBAL_INPUT_STATE_FLAG_NONE 0x00000000u
|
||||
#define SYS_GLOBAL_INPUT_KEY_BYTES 32u
|
||||
|
||||
// SysQueryGlobalInputState snapshots the current physical input state. It does
|
||||
// not consume queued keyboard or mouse events and is intentionally global; a
|
||||
// later routed input context API should use a context handle instead.
|
||||
typedef struct SYS_GLOBAL_INPUT_STATE {
|
||||
uint32_t Size;
|
||||
uint32_t Flags;
|
||||
uint64_t Generation;
|
||||
uint32_t Modifiers;
|
||||
uint8_t KeyDown[SYS_GLOBAL_INPUT_KEY_BYTES];
|
||||
int32_t MouseX;
|
||||
int32_t MouseY;
|
||||
int32_t MouseWheel;
|
||||
uint32_t MouseButtons;
|
||||
} SYS_GLOBAL_INPUT_STATE;
|
||||
|
||||
// A zero QueueHandle means the default keyboard input queue. A
|
||||
// nonzero QueueHandle must be a handle returned by SysOpenInputQueue. A zero
|
||||
@@ -884,6 +917,7 @@ KSTATUS SysIsKeyDown(INPUT_KEY key, bool* downOut);
|
||||
KSTATUS SysReadKeyboardChar(char* charOut);
|
||||
KSTATUS SysReadKey(INPUT_KEY* keyOut);
|
||||
uint32_t SysGetKeyModifiers(void);
|
||||
KSTATUS SysQueryGlobalInputState(SYS_GLOBAL_INPUT_STATE* stateOut);
|
||||
KSTATUS SysReadInputEvent(const SYS_INPUT_EVENT_REQUEST* request);
|
||||
KSTATUS SysPeekInputEvent(const SYS_INPUT_EVENT_REQUEST* request);
|
||||
|
||||
@@ -1046,7 +1080,7 @@ KSTATUS SysRecvSocket(uint32_t socket, void* buffer, size_t length, uint32_t fla
|
||||
KSTATUS SysShutdownSocket(uint32_t socket, uint32_t how);
|
||||
KSTATUS SysSendToSocket(uint32_t socket, const SYS_SOCKET_SEND_TO_REQUEST* request);
|
||||
KSTATUS SysRecvFromSocket(uint32_t socket, const SYS_SOCKET_RECV_FROM_REQUEST* request);
|
||||
KSTATUS SysResolveHost(const SYS_RESOLVE_HOST_REQUEST* request);
|
||||
KSTATUS SysResolveHost(const SYS_RESOLVE_HOST_REQUEST* request); // Cry some more, microkernel purists!
|
||||
KSTATUS SysSetSocketOption(uint32_t socket, const SYS_SOCKET_OPTION_REQUEST* request);
|
||||
KSTATUS SysGetSocketOption(uint32_t socket, const SYS_SOCKET_OPTION_REQUEST* request);
|
||||
KSTATUS SysPoll(const SYS_POLL_REQUEST* request);
|
||||
|
||||
Reference in new issue
Block a user