diff --git a/reactos/apps/utils/pice/readme.txt b/reactos/apps/utils/pice/readme.txt index 494a46340d2..c1d534144bb 100644 --- a/reactos/apps/utils/pice/readme.txt +++ b/reactos/apps/utils/pice/readme.txt @@ -15,7 +15,7 @@ http://pice.sourceforge.net). Installation and use: 1. PICE is loaded like a regular device driver. The only limitation - it must -be loaded before keyboard.sys driver. You should add: +be loaded after keyboard.sys driver. You should add: LdrLoadAutoConfigDriver( L"pice.sys" ); @@ -95,11 +95,10 @@ phys show all mappings for linear address timers show all active timers TODO: -1. Break into pice on KeBugCheck(). -2. Evaluation of pointers. -3. Virtual breakpoints -4. Unimplemented commands. -5. Video mode switching (to debug gdi applications). +1. Evaluation of pointers. +2. Virtual breakpoints +3. Unimplemented commands. +4. Video mode switching (to debug gdi applications). Enjoy, diff --git a/reactos/install.bat b/reactos/install.bat index f9c48d80bf0..2fda4607837 100644 --- a/reactos/install.bat +++ b/reactos/install.bat @@ -11,6 +11,7 @@ echo Installing to %ROS_INSTALL% md %ROS_INSTALL% md %ROS_INSTALL%\bin +md %ROS_INSTALL%\symbols md %ROS_INSTALL%\system32 md %ROS_INSTALL%\system32\config md %ROS_INSTALL%\system32\drivers @@ -21,6 +22,7 @@ copy aboot.bat %ROS_INSTALL% copy system.hiv %ROS_INSTALL%\system32\config copy loaders\dos\loadros.com %ROS_INSTALL% copy ntoskrnl\ntoskrnl.exe %ROS_INSTALL%\system32 +copy ntoskrnl\ntoskrnl.sym %ROS_INSTALL%\symbols copy hal\halx86\hal.dll %ROS_INSTALL%\system32 copy services\fs\vfat\vfatfs.sys %ROS_INSTALL%\system32\drivers copy services\fs\ms\msfs.sys %ROS_INSTALL%\system32\drivers @@ -87,6 +89,9 @@ copy apps\partinfo\partinfo.exe %ROS_INSTALL%\bin copy apps\objdir\objdir.exe %ROS_INSTALL%\bin copy apps\mutex\mutex.exe %ROS_INSTALL%\bin copy apps\winhello\winhello.exe %ROS_INSTALL%\bin +copy apps\pice\module\pice.sys %ROS_INSTALL%\system32\drivers +copy apps\pice\module\pice.sym %ROS_INSTALL%\symbols +copy apps\pice\pice.cfg %ROS_INSTALL%\symbols copy media\fonts\helb____.ttf %ROS_INSTALL%\media\fonts copy media\fonts\timr____.ttf %ROS_INSTALL%\media\fonts copy media\nls\*.nls %ROS_INSTALL%\system32 diff --git a/reactos/ntoskrnl/include/internal/kd.h b/reactos/ntoskrnl/include/internal/kd.h index bf89bb97a32..36520a0413f 100644 --- a/reactos/ntoskrnl/include/internal/kd.h +++ b/reactos/ntoskrnl/include/internal/kd.h @@ -1,4 +1,4 @@ -/* $Id: kd.h,v 1.5 2002/02/02 20:12:45 ekohl Exp $ +/* $Id: kd.h,v 1.6 2002/02/09 18:41:23 chorns Exp $ * * kernel debugger prototypes */ @@ -8,6 +8,19 @@ #include +typedef enum +{ + NoDebug = 0, + GdbDebug, + PiceDebug, + ScreenDebug, + SerialDebug, + BochsDebug, + FileLogDebug +} DEBUG_TYPE; + +extern DEBUG_TYPE KdDebugType; + typedef enum _KD_CONTINUE_TYPE { kdContinue = 0, diff --git a/reactos/ntoskrnl/kd/gdbstub.c b/reactos/ntoskrnl/kd/gdbstub.c index 291d659bf8c..6ac9125b425 100644 --- a/reactos/ntoskrnl/kd/gdbstub.c +++ b/reactos/ntoskrnl/kd/gdbstub.c @@ -1278,6 +1278,8 @@ KdGdbStubInit(ULONG Phase) } KdPortEnableInterrupts(); + + DbgBreakPointWithStatus (DBG_STATUS_CONTROL_C); } } diff --git a/reactos/ntoskrnl/kd/kdebug.c b/reactos/ntoskrnl/kd/kdebug.c index 3bdc5ad4911..7f0417b7ff0 100644 --- a/reactos/ntoskrnl/kd/kdebug.c +++ b/reactos/ntoskrnl/kd/kdebug.c @@ -1,4 +1,4 @@ -/* $Id: kdebug.c,v 1.33 2002/02/08 02:57:06 chorns Exp $ +/* $Id: kdebug.c,v 1.34 2002/02/09 18:41:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -25,18 +25,6 @@ /* bochs debug output */ #define BOCHS_LOGGER_PORT (0xe9) - -/* TYPEDEFS ****************************************************************/ - -typedef enum -{ - NoDebug, - ScreenDebug, - SerialDebug, - BochsDebug, - FileLogDebug -} DEBUG_TYPE; - /* VARIABLES ***************************************************************/ BOOLEAN @@ -49,8 +37,7 @@ KdDebuggerNotPresent = TRUE; /* EXPORTED */ static BOOLEAN KdpBreakPending = FALSE; -static BOOLEAN KdpLogOnly = TRUE; -static DEBUG_TYPE KdpDebugType = NoDebug; +DEBUG_TYPE KdDebugType = NoDebug; ULONG KdpPortIrq = 0; /* PRIVATE FUNCTIONS ********************************************************/ @@ -104,13 +91,25 @@ KdInitSystem(ULONG Reserved, { p2 += 6; KdDebuggerEnabled = TRUE; - KdpDebugType = ScreenDebug; + KdDebugType = ScreenDebug; } else if (!_strnicmp(p2, "BOCHS", 5)) { p2 += 5; KdDebuggerEnabled = TRUE; - KdpDebugType = BochsDebug; + KdDebugType = BochsDebug; + } + else if (!_strnicmp(p2, "GDB", 3)) + { + p2 += 3; + KdDebuggerEnabled = TRUE; + KdDebugType = GdbDebug; + } + else if (!_strnicmp(p2, "PICE", 4)) + { + p2 += 4; + KdDebuggerEnabled = TRUE; + KdDebugType = PiceDebug; } else if (!_strnicmp(p2, "COM", 3)) { @@ -118,8 +117,9 @@ KdInitSystem(ULONG Reserved, Value = (ULONG)atol(p2); if (Value > 0 && Value < 5) { + PrintString("\n COM2 found\n\n"); KdDebuggerEnabled = TRUE; - KdpDebugType = SerialDebug; + KdDebugType = SerialDebug; PortInfo.ComPort = Value; } } @@ -127,31 +127,35 @@ KdInitSystem(ULONG Reserved, { p2 += 4; KdDebuggerEnabled = TRUE; - KdpDebugType = FileLogDebug; + KdDebugType = FileLogDebug; } } } else if (!_strnicmp(p2, "DEBUG", 5)) { p2 += 5; - KdDebuggerEnabled = TRUE; - KdpDebugType = SerialDebug; + /* Check that KdDebugType equals NoDebug so we don't override any set KdDebugType */ + if (KdDebugType == NoDebug) + { + KdDebuggerEnabled = TRUE; + KdDebugType = SerialDebug; + } } else if (!_strnicmp(p2, "NODEBUG", 7)) { p2 += 7; KdDebuggerEnabled = FALSE; - KdpDebugType = NoDebug; + KdDebugType = NoDebug; } else if (!_strnicmp(p2, "CRASHDEBUG", 10)) { p2 += 10; KdDebuggerEnabled = FALSE; - KdpDebugType = NoDebug; + KdDebugType = NoDebug; } else if (!_strnicmp(p2, "BREAK", 5)) { - p2 += 7; + p2 += 5; KdpBreakPending = TRUE; } else if (!_strnicmp(p2, "BAUDRATE", 8)) @@ -164,7 +168,7 @@ KdInitSystem(ULONG Reserved, if (Value > 0) { KdDebuggerEnabled = TRUE; - KdpDebugType = SerialDebug; + KdDebugType = SerialDebug; PortInfo.BaudRate = Value; } } @@ -178,28 +182,31 @@ KdInitSystem(ULONG Reserved, if (Value > 0) { KdDebuggerEnabled = TRUE; - KdpDebugType = SerialDebug; + KdDebugType = SerialDebug; KdpPortIrq = Value; } } } } - else if (!_strnicmp(p2, "GDB", 3)) - { - p2 += 3; - KdpLogOnly = FALSE; - } p1 = p2; } /* print some information */ if (KdDebuggerEnabled == TRUE) { - switch (KdpDebugType) + switch (KdDebugType) { case NoDebug: break; + case GdbDebug: + PrintString("\n GDB debugging enabled\n\n"); + break; + + case PiceDebug: + PrintString("\n Private ICE debugger enabled\n\n"); + break; + case ScreenDebug: //PrintString("\n Screen debugging enabled\n\n"); break; @@ -222,9 +229,10 @@ KdInitSystem(ULONG Reserved, /* initialize debug port */ if (KdDebuggerEnabled == TRUE) { - switch (KdpDebugType) + switch (KdDebugType) { case SerialDebug: + case GdbDebug: KdPortInitialize(&PortInfo, 0, 0); @@ -246,8 +254,7 @@ KdInit1(VOID) { /* Initialize kernel debugger */ if (KdDebuggerEnabled == TRUE && - KdpDebugType == SerialDebug && - KdpLogOnly == FALSE) + KdDebugType == GdbDebug) { KdGdbStubInit(0); } @@ -257,8 +264,7 @@ KdInit1(VOID) VOID KdInit2(VOID) { if (KdDebuggerEnabled == TRUE && - KdpDebugType == SerialDebug && - KdpLogOnly == FALSE) + KdDebugType == GdbDebug) { KdGdbStubInit(1); } @@ -285,20 +291,24 @@ KdpPrintString(PANSI_STRING String) { PCH pch = String->Buffer; - switch (KdpDebugType) + switch (KdDebugType) { case NoDebug: break; + case GdbDebug: + KdGdbDebugPrint(pch); + break; + + case PiceDebug: + break; + case ScreenDebug: HalDisplayString(pch); break; case SerialDebug: - if (KdpLogOnly == TRUE) KdDebugPrint(pch); - else - KdGdbDebugPrint(pch); break; case BochsDebug: @@ -328,13 +338,9 @@ KdpPrintString(PANSI_STRING String) BOOLEAN STDCALL KdPollBreakIn(VOID) { - return FALSE; - -#if 0 - if (!KdDebuggerEnabled || KdpDebugType != SerialDebug) + if ((!KdDebuggerEnabled) || (KdDebugType != SerialDebug)) return FALSE; - return TRUE; -#endif + return KdpBreakPending; } VOID STDCALL diff --git a/reactos/ntoskrnl/ke/bug.c b/reactos/ntoskrnl/ke/bug.c index 18f1bc83016..5e46f75a533 100644 --- a/reactos/ntoskrnl/ke/bug.c +++ b/reactos/ntoskrnl/ke/bug.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: bug.c,v 1.19 2002/01/10 00:59:32 ekohl Exp $ +/* $Id: bug.c,v 1.20 2002/02/09 18:41:24 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/bug.c @@ -140,15 +140,17 @@ KeBugCheckEx(ULONG BugCheckCode, // PsDumpThreads(); KeDumpStackFrames((PULONG)__builtin_frame_address(0)); -#if 1 + if (KdDebuggerEnabled) + { + __asm__("sti\n\t"); + DbgBreakPoint(); + } + for(;;) { /* PJS: use HLT instruction, rather than busy wait */ __asm__("hlt\n\t"); } -#else - for(;;); -#endif } VOID STDCALL diff --git a/reactos/ntoskrnl/ke/catch.c b/reactos/ntoskrnl/ke/catch.c index 2a8d0f2e52b..6653ee7b9ab 100644 --- a/reactos/ntoskrnl/ke/catch.c +++ b/reactos/ntoskrnl/ke/catch.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: catch.c,v 1.17 2002/01/23 23:39:25 chorns Exp $ +/* $Id: catch.c,v 1.18 2002/02/09 18:41:24 chorns Exp $ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/ke/catch.c @@ -271,11 +271,10 @@ KiDispatchException(PEXCEPTION_RECORD ExceptionRecord, /* PreviousMode == KernelMode */ -#ifndef KDBG - - KeBugCheck (KMODE_EXCEPTION_NOT_HANDLED); - -#endif /* KDBG */ + if (!KdDebuggerEnabled || KdDebugType != GdbDebug) + { + KeBugCheck (KMODE_EXCEPTION_NOT_HANDLED); + } Action = KdEnterDebuggerException (ExceptionRecord, Context, Tf); if (Action != kdHandleException) diff --git a/reactos/ntoskrnl/ldr/loader.c b/reactos/ntoskrnl/ldr/loader.c index 1383997dd28..238500eba35 100644 --- a/reactos/ntoskrnl/ldr/loader.c +++ b/reactos/ntoskrnl/ldr/loader.c @@ -1,4 +1,4 @@ -/* $Id: loader.c,v 1.95 2002/01/23 23:39:25 chorns Exp $ +/* $Id: loader.c,v 1.96 2002/02/09 18:41:24 chorns Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -792,7 +793,7 @@ VOID LdrLoadUserModuleSymbols(PLDR_MODULE ModuleObject) return; } - DbgPrint("Loading symbols from %wZ...\n", &Filename); + CPRINT("Loading symbols from %wZ...\n", &Filename); /* Get the size of the file */ Status = ZwQueryInformationFile(FileHandle, @@ -916,6 +917,14 @@ VOID LdrLoadAutoConfigDrivers (VOID) * Keyboard driver */ LdrLoadAutoConfigDriver( L"keyboard.sys" ); + + if (KdDebugType == PiceDebug) + { + /* + * Private ICE debugger + */ + LdrLoadAutoConfigDriver( L"pice.sys" ); + } /* * Raw console driver @@ -967,6 +976,7 @@ VOID LdrLoadAutoConfigDrivers (VOID) * Novell Eagle 2000 driver */ //LdrLoadAutoConfigDriver(L"ne2000.sys"); + LdrLoadAutoConfigDriver(L"pcntn3m.sys"); /* * TCP/IP protocol driver @@ -2007,7 +2017,7 @@ PVOID LdrSafePEProcessModule( } else if (Type != 0) { - DbgPrint("Unknown relocation type %x at %x\n",Type, &Type); + CPRINT("Unknown relocation type %x at %x\n",Type, &Type); return 0; } }