fixed uninitialized variable warning
[reactos.git] / reactos / ntoskrnl / kd / kdinit.c
index 97d0dbb..55297c3 100644 (file)
 #define NDEBUG
 #include <internal/debug.h>
 
+/* Make bochs debug output in the very early boot phase available */
+//#define AUTO_ENABLE_BOCHS
+
 /* VARIABLES ***************************************************************/
 
 KD_PORT_INFORMATION PortInfo = {DEFAULT_DEBUG_PORT, DEFAULT_DEBUG_BAUD_RATE, 0};
 ULONG KdpPortIrq;
+#ifdef AUTO_ENABLE_BOCHS
+KDP_DEBUG_MODE KdpDebugMode = {{{.Bochs=TRUE}}};;
+PKDP_INIT_ROUTINE WrapperInitRoutine = KdpBochsInit;
+KD_DISPATCH_TABLE WrapperTable = {.KdpInitRoutine = KdpBochsInit, .KdpPrintRoutine = KdpBochsDebugPrint};
+#else
 KDP_DEBUG_MODE KdpDebugMode;
-LIST_ENTRY KdProviders;
 PKDP_INIT_ROUTINE WrapperInitRoutine;
-KD_DISPATCH_TABLE DispatchTable[KdMax];
 KD_DISPATCH_TABLE WrapperTable;
+#endif
+BOOLEAN KdpEarlyBreak = FALSE;
+LIST_ENTRY KdProviders = {&KdProviders, &KdProviders};
+KD_DISPATCH_TABLE DispatchTable[KdMax];
 
 PKDP_INIT_ROUTINE InitRoutines[KdMax] = {KdpScreenInit,
                                          KdpSerialInit,
@@ -34,7 +44,6 @@ KdpGetWrapperDebugMode(PCHAR Currentp2,
 {
     PCHAR p2 = Currentp2;
 
-#ifdef DBG
     /* Check for BOCHS Debugging */
     if (!_strnicmp(p2, "BOCHS", 5))
     {
@@ -66,7 +75,6 @@ KdpGetWrapperDebugMode(PCHAR Currentp2,
         /* Enable Debugging */
         KdDebuggerEnabled = TRUE;
     }
-#endif
 
 #ifdef KDBG
     /* Get the KDBG Settings and enable it */
@@ -158,8 +166,6 @@ KdInitSystem(ULONG BootPhase,
     /* Set Default Port Options */
     if (BootPhase == 0)
     {
-        /* Initialize the Provider List */
-        InitializeListHead(&KdProviders);
 
         /* Parse the Command Line */
         p1 = (PCHAR)LoaderBlock->CommandLine;
@@ -175,6 +181,12 @@ KdInitSystem(ULONG BootPhase,
                 p2 = KdpGetDebugMode(p2);
                 p2 = KdpGetWrapperDebugMode(p2, LoaderBlock);
             }
+            /* Check for early breakpoint */
+            else if (!_strnicmp(p2, "BREAK", 5))
+            {
+                p2 += 5;
+                KdpEarlyBreak = TRUE;
+            }
             /* Check for Kernel Debugging Enable */
             else if (!_strnicmp(p2, "DEBUG", 5))
             {