From f7577eaeb738d3214c698e80d09d156d181dcdb6 Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Sun, 4 Mar 2007 19:20:03 +0000 Subject: [PATCH] - Enable stubs in kdcom to actually be exported (to simplfiy compatibility with KD Branch, which won't be needed soon thanks to a build flag). - Enable call to KdDebuggerInitialize1 even in trunk, since it doesn't do anything. - Make i8042prt stop using a reactos-only kernel export hack (KdpServiceDispatcher),and use KdSystemDebugControl instead, which is the NT version and fully-exported. - Implement a stub KdSystemDebugControl and export it. svn path=/trunk/; revision=25985 --- reactos/drivers/base/kdcom/kdcom.def | 9 +++++++++ reactos/drivers/input/i8042prt/keyboard.c | 7 ++----- reactos/ntoskrnl/ex/init.c | 4 +++- reactos/ntoskrnl/kd/kdmain.c | 14 ++++++++++++++ reactos/ntoskrnl/ntoskrnl.def | 1 + 5 files changed, 29 insertions(+), 6 deletions(-) diff --git a/reactos/drivers/base/kdcom/kdcom.def b/reactos/drivers/base/kdcom/kdcom.def index 05e95ca0d2a..1681667a830 100644 --- a/reactos/drivers/base/kdcom/kdcom.def +++ b/reactos/drivers/base/kdcom/kdcom.def @@ -1,6 +1,7 @@ LIBRARY kdcom.dll EXPORTS +; Old KD KdPortGetByte@4 KdPortGetByteEx@8 KdPortInitialize@12 @@ -13,3 +14,11 @@ KdPortRestore@0 KdPortSave@0 KdPortDisableInterrupts@0 KdPortEnableInterrupts@0 + +; New KD +KdDebuggerInitialize0@4 +KdDebuggerInitialize1@4 +KdSave@4 +KdRestore@4 +KdReceivePacket@20 +KdSendPacket@16 diff --git a/reactos/drivers/input/i8042prt/keyboard.c b/reactos/drivers/input/i8042prt/keyboard.c index a301d2ee129..f422a7736b0 100644 --- a/reactos/drivers/input/i8042prt/keyboard.c +++ b/reactos/drivers/input/i8042prt/keyboard.c @@ -12,6 +12,7 @@ /* INCLUDES ****************************************************************/ #include "i8042prt.h" +#include "kdfuncs.h" #define NDEBUG #include @@ -750,10 +751,6 @@ detectsetleds: } /* debug stuff */ -VOID STDCALL -KdpServiceDispatcher(ULONG Code, PVOID Context1, PVOID Context2); -#define EnterDebugger ((PVOID)0x25) - static VOID STDCALL I8042DebugWorkItem(PDEVICE_OBJECT DeviceObject, PVOID Context) { @@ -771,6 +768,6 @@ static VOID STDCALL I8042DebugWorkItem(PDEVICE_OBJECT DeviceObject, /* We hope kernel would understand this. If * that's not the case, nothing would happen. */ - KdpServiceDispatcher(TAG('R', 'o', 's', ' '), (PVOID)Key, NULL); + KdSystemDebugControl(TAG('R', 'o', 's', ' '), (PVOID)Key, 0, NULL, 0, NULL, KernelMode); #endif /* __REACTOS__ */ } diff --git a/reactos/ntoskrnl/ex/init.c b/reactos/ntoskrnl/ex/init.c index 268c21c81f4..86544700d12 100644 --- a/reactos/ntoskrnl/ex/init.c +++ b/reactos/ntoskrnl/ex/init.c @@ -1172,7 +1172,7 @@ Phase1InitializationDiscard(PVOID Context) HalReportResourceUsage(); /* Call the debugger DLL once we have KD64 6.0 support */ - //KdDebuggerInitialize1(LoaderBlock); + KdDebuggerInitialize1(LoaderBlock); /* Setup PnP Manager in phase 1 */ if (!PpInitSystem()) KeBugCheck(PP1_INITIALIZATION_FAILED); @@ -1255,3 +1255,5 @@ Phase1Initialization(IN PVOID Context) MmZeroPageThreadMain(NULL); } + + diff --git a/reactos/ntoskrnl/kd/kdmain.c b/reactos/ntoskrnl/kd/kdmain.c index 4e0d788471c..012d8a6b5d8 100644 --- a/reactos/ntoskrnl/kd/kdmain.c +++ b/reactos/ntoskrnl/kd/kdmain.c @@ -328,6 +328,20 @@ NtSetDebugFilterState(IN ULONG ComponentId, return STATUS_SUCCESS; } +NTSTATUS +NTAPI +KdSystemDebugControl(IN SYSDBG_COMMAND Command, + IN PVOID InputBuffer, + IN ULONG InputBufferLength, + OUT PVOID OutputBuffer, + IN ULONG OutputBufferLength, + IN OUT PULONG ReturnLength, + IN KPROCESSOR_MODE PreviousMode) +{ + /* HACK */ + return KdpServiceDispatcher(Command, InputBuffer, InputBufferLength); +} + PKDEBUG_ROUTINE KiDebugRoutine = KdpEnterDebuggerException; /* EOF */ diff --git a/reactos/ntoskrnl/ntoskrnl.def b/reactos/ntoskrnl/ntoskrnl.def index 05beae70a8b..2502754deba 100644 --- a/reactos/ntoskrnl/ntoskrnl.def +++ b/reactos/ntoskrnl/ntoskrnl.def @@ -528,6 +528,7 @@ KdEnteredDebugger KdPollBreakIn@0 KdPowerTransition@4 KdpServiceDispatcher@12 +KdSystemDebugControl@28 Ke386CallBios@8 @KeAcquireGuardedMutex@4 @KeAcquireGuardedMutexUnsafe@4