diff --git a/reactos/ntoskrnl/ex/init.c b/reactos/ntoskrnl/ex/init.c index f58d0187124..2d12232d87c 100644 --- a/reactos/ntoskrnl/ex/init.c +++ b/reactos/ntoskrnl/ex/init.c @@ -450,8 +450,6 @@ ExpInitializeExecutive(VOID) /* Parse the Loaded Modules (by FreeLoader) and cache the ones we'll need */ ParseAndCacheLoadedModules(); - /* Initialize the kernel debugger parameters */ - KdInitSystem(0, (PLOADER_PARAMETER_BLOCK)&KeLoaderBlock); /* Initialize the Dispatcher, Clock and Bug Check Mechanisms. */ KeInit2(); diff --git a/reactos/ntoskrnl/kd/kdinit.c b/reactos/ntoskrnl/kd/kdinit.c index 97d0dbbdb96..72d9e9dd0db 100644 --- a/reactos/ntoskrnl/kd/kdinit.c +++ b/reactos/ntoskrnl/kd/kdinit.c @@ -11,15 +11,24 @@ #define NDEBUG #include +/* 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 +LIST_ENTRY KdProviders = {&KdProviders, &KdProviders}; +KD_DISPATCH_TABLE DispatchTable[KdMax]; PKDP_INIT_ROUTINE InitRoutines[KdMax] = {KdpScreenInit, KdpSerialInit, @@ -158,8 +167,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; diff --git a/reactos/ntoskrnl/kd/wrappers/bochs.c b/reactos/ntoskrnl/kd/wrappers/bochs.c index b7661282dfb..d29fffbfa17 100644 --- a/reactos/ntoskrnl/kd/wrappers/bochs.c +++ b/reactos/ntoskrnl/kd/wrappers/bochs.c @@ -24,9 +24,19 @@ KdpBochsDebugPrint(IN PCH Message) { if (*Message == '\n') { - WRITE_PORT_UCHAR((PUCHAR)BOCHS_LOGGER_PORT, '\r'); +#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'); +#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); +#endif Message++; } } diff --git a/reactos/ntoskrnl/ldr/loader.c b/reactos/ntoskrnl/ldr/loader.c index 3979dc151b5..d45be77a8d1 100644 --- a/reactos/ntoskrnl/ldr/loader.c +++ b/reactos/ntoskrnl/ldr/loader.c @@ -26,6 +26,11 @@ #endif /* __GNUC__ */ #endif +#if 0 +#undef ps +#define ps(args...) DPRINT1(args) +#endif + #define NDEBUG #include