2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: ntoskrnl/kd/wrappers/bochs.c
5 * PURPOSE: BOCHS Wrapper for Kd
7 * PROGRAMMERS: Alex Ionescu (alex@relsoft.net)
12 #include <internal/debug.h>
14 /* bochs debug output */
15 #define BOCHS_LOGGER_PORT (0xe9)
17 /* FUNCTIONS *****************************************************************/
21 KdpBochsDebugPrint(IN PCH Message
)
27 #if defined(_M_IX86) && defined(__GNUC__)
28 /* Don't use WRITE_PORT_UCHAR because hal isn't initialized yet in the very early boot phase. */
29 __asm__("outb %b0, %w1\n\t" :: "a" ('\r'), "d" (BOCHS_LOGGER_PORT
));
31 WRITE_PORT_UCHAR((PUCHAR
)BOCHS_LOGGER_PORT
, '\r');
34 #if defined(_M_IX86) && defined(__GNUC__)
35 /* Don't use WRITE_PORT_UCHAR because hal isn't initialized yet in the very early boot phase. */
36 __asm__("outb %b0, %w1\n\t" :: "a" (*Message
), "d" (BOCHS_LOGGER_PORT
));
38 WRITE_PORT_UCHAR((PUCHAR
)BOCHS_LOGGER_PORT
, *Message
);
48 KdpBochsInit(PKD_DISPATCH_TABLE WrapperTable
,
51 if (!KdpDebugMode
.Bochs
) return;
55 /* Write out the functions that we support for now */
56 WrapperTable
->KdpInitRoutine
= KdpBochsInit
;
57 WrapperTable
->KdpPrintRoutine
= KdpBochsDebugPrint
;
59 else if (BootPhase
== 2)
61 HalDisplayString("\n Bochs debugging enabled\n\n");