Make the bochs debug output in the very early boot phase available, if AUTO_ENABLE_BOCHS is defined.

svn path=/trunk/; revision=15768
This commit is contained in:
Hartmut Birr 2005-06-04 10:05:20 +00:00
parent 651c6eedd3
commit e13bb66f6e
4 changed files with 27 additions and 7 deletions

View file

@ -450,8 +450,6 @@ ExpInitializeExecutive(VOID)
/* Parse the Loaded Modules (by FreeLoader) and cache the ones we'll need */ /* Parse the Loaded Modules (by FreeLoader) and cache the ones we'll need */
ParseAndCacheLoadedModules(); ParseAndCacheLoadedModules();
/* Initialize the kernel debugger parameters */
KdInitSystem(0, (PLOADER_PARAMETER_BLOCK)&KeLoaderBlock);
/* Initialize the Dispatcher, Clock and Bug Check Mechanisms. */ /* Initialize the Dispatcher, Clock and Bug Check Mechanisms. */
KeInit2(); KeInit2();

View file

@ -11,15 +11,24 @@
#define NDEBUG #define NDEBUG
#include <internal/debug.h> #include <internal/debug.h>
/* Make bochs debug output in the very early boot phase available */
//#define AUTO_ENABLE_BOCHS
/* VARIABLES ***************************************************************/ /* VARIABLES ***************************************************************/
KD_PORT_INFORMATION PortInfo = {DEFAULT_DEBUG_PORT, DEFAULT_DEBUG_BAUD_RATE, 0}; KD_PORT_INFORMATION PortInfo = {DEFAULT_DEBUG_PORT, DEFAULT_DEBUG_BAUD_RATE, 0};
ULONG KdpPortIrq; 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; KDP_DEBUG_MODE KdpDebugMode;
LIST_ENTRY KdProviders;
PKDP_INIT_ROUTINE WrapperInitRoutine; PKDP_INIT_ROUTINE WrapperInitRoutine;
KD_DISPATCH_TABLE DispatchTable[KdMax];
KD_DISPATCH_TABLE WrapperTable; KD_DISPATCH_TABLE WrapperTable;
#endif
LIST_ENTRY KdProviders = {&KdProviders, &KdProviders};
KD_DISPATCH_TABLE DispatchTable[KdMax];
PKDP_INIT_ROUTINE InitRoutines[KdMax] = {KdpScreenInit, PKDP_INIT_ROUTINE InitRoutines[KdMax] = {KdpScreenInit,
KdpSerialInit, KdpSerialInit,
@ -158,8 +167,6 @@ KdInitSystem(ULONG BootPhase,
/* Set Default Port Options */ /* Set Default Port Options */
if (BootPhase == 0) if (BootPhase == 0)
{ {
/* Initialize the Provider List */
InitializeListHead(&KdProviders);
/* Parse the Command Line */ /* Parse the Command Line */
p1 = (PCHAR)LoaderBlock->CommandLine; p1 = (PCHAR)LoaderBlock->CommandLine;

View file

@ -24,9 +24,19 @@ KdpBochsDebugPrint(IN PCH Message)
{ {
if (*Message == '\n') if (*Message == '\n')
{ {
#if defined(_M_IX86) && defined(__GNUC__)
/* Don't use WRITE_PORT_UCHAR because hal isn't initialized yet in the very early boot phase. */
__asm__("outb %0, %w1\n\t" :: "a" ('\r'), "d" (BOCHS_LOGGER_PORT));
#else
WRITE_PORT_UCHAR((PUCHAR)BOCHS_LOGGER_PORT, '\r'); WRITE_PORT_UCHAR((PUCHAR)BOCHS_LOGGER_PORT, '\r');
#endif
} }
#if defined(_M_IX86) && defined(__GNUC__)
/* Don't use WRITE_PORT_UCHAR because hal isn't initialized yet in the very early boot phase. */
__asm__("outb %0, %w1\n\t" :: "a" (*Message), "d" (BOCHS_LOGGER_PORT));
#else
WRITE_PORT_UCHAR((PUCHAR)BOCHS_LOGGER_PORT, *Message); WRITE_PORT_UCHAR((PUCHAR)BOCHS_LOGGER_PORT, *Message);
#endif
Message++; Message++;
} }
} }

View file

@ -26,6 +26,11 @@
#endif /* __GNUC__ */ #endif /* __GNUC__ */
#endif #endif
#if 0
#undef ps
#define ps(args...) DPRINT1(args)
#endif
#define NDEBUG #define NDEBUG
#include <internal/debug.h> #include <internal/debug.h>