replace ad hoc driver loading with a proper driver manager, new DDK, new PnP manager with device matching, asynchronous startup, resource ownership and removal, add shared PCI capability helpers, replace typed, rigid services with a proper service manager, implement proper system shutdown and restart, shutting down unloads drivers and shuts down services, add simple power button, remove heavyweight boot self-tests and SMP stress runs, add monotonic timestamps to kernel debug output, fruitless USB and PS/2 fixes, make test builds opt in.

This commit is contained in:
maksw committed 2026-10-26 10:08:03 +01:00
1 parent c0ad63c27f
commit d36f19509c
160 files changed
+6563 -7366

No files matched your search

+45 -11
View File
@@ -1516,6 +1516,45 @@ DISPLAY_API KSTATUS KeDisplayRegisterDevice(DISPLAY_DEVICE* device) {
return result;
}
DISPLAY_API KSTATUS KeDisplayUnregisterDevice(DISPLAY_DEVICE* device) {
if (!device || device == &gBootFbDevice)
return NTLSTATUS_INVALID_PARAMETER;
bool providerHeld = false;
KSTATUS status = KiDisplayAcquireProviderMutex(&providerHeld);
if (!KSUCCESS(status))
return status;
uintptr_t flags = KeAcquireSpinlock(&gDisplayLock);
DISPLAY_DEVICE** link = &gDisplayList;
while (*link && *link != device)
link = &(*link)->Next;
if (!*link) {
KeReleaseSpinlock(&gDisplayLock, flags);
KiDisplayReleaseProviderMutex(providerHeld);
return NTLSTATUS_NOT_FOUND;
}
*link = device->Next;
device->Next = (DISPLAY_DEVICE*)0;
if (gPrimaryDisplay == device) {
gPrimaryDisplay = (DISPLAY_DEVICE*)0;
gDisplayGeneration++;
gCursorDrawn = false;
gCursorUpdatePending = false;
gCursorAppliedGeneration = gCursorRequestGeneration;
gCursorCommittedX = DISPLAY_CURSOR_POS_INVALID;
gCursorCommittedY = DISPLAY_CURSOR_POS_INVALID;
gDirtyAll = false;
gDirtyRectCount = 0;
gDrawDepth = 0;
}
KeReleaseSpinlock(&gDisplayLock, flags);
KiDisplayReleaseProviderMutex(providerHeld);
return NTLSTATUS_SUCCESS;
}
// Implements the display Seed New Primary operation.
static KSTATUS KiDisplaySeedNewPrimary(DISPLAY_DEVICE* oldDevice, DISPLAY_DEVICE* newDevice) {
if (!oldDevice || !newDevice || oldDevice == newDevice)
@@ -1570,6 +1609,11 @@ DISPLAY_API KSTATUS KeDisplaySetPrimary(DISPLAY_DEVICE* device) {
const char* name = device->Name ? device->Name : "?";
bool providerHeld = false;
KSTATUS result = KiDisplayAcquireProviderMutex(&providerHeld);
if (!KSUCCESS(result))
return result;
uintptr_t flags = KeAcquireSpinlock(&gDisplayLock);
bool found = false;
for (DISPLAY_DEVICE* it = gDisplayList; it; it = it->Next) {
@@ -1580,6 +1624,7 @@ DISPLAY_API KSTATUS KeDisplaySetPrimary(DISPLAY_DEVICE* device) {
}
if (!found) {
KeReleaseSpinlock(&gDisplayLock, flags);
KiDisplayReleaseProviderMutex(providerHeld);
return NTLSTATUS_NOT_FOUND;
}
@@ -1590,17 +1635,6 @@ DISPLAY_API KSTATUS KeDisplaySetPrimary(DISPLAY_DEVICE* device) {
gCursorUpdatePending = gCursorVisible;
KeReleaseSpinlock(&gDisplayLock, flags);
bool providerHeld = false;
KSTATUS result = KiDisplayAcquireProviderMutex(&providerHeld);
if (!KSUCCESS(result)) {
flags = KeAcquireSpinlock(&gDisplayLock);
gDisplayTransitionInProgress = false;
gDisplayGeneration++;
KeReleaseSpinlock(&gDisplayLock, flags);
KiDisplayQueueCursorWork();
return result;
}
if (oldDevice && oldCursorDrawn && oldDevice->Ops && oldDevice->Ops->ShowCursor)
(void)oldDevice->Ops->ShowCursor(oldDevice, false);