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
,
28 #if defined(_M_IX86) && defined(__GNUC__)
29 /* Don't use WRITE_PORT_UCHAR because hal isn't initialized yet in the very early boot phase. */
30 __asm__("outb %b0, %w1\n\t" :: "a" ('\r'), "d" (BOCHS_LOGGER_PORT
));
32 WRITE_PORT_UCHAR((PUCHAR
)BOCHS_LOGGER_PORT
, '\r');
35 #if defined(_M_IX86) && defined(__GNUC__)
36 /* Don't use WRITE_PORT_UCHAR because hal isn't initialized yet in the very early boot phase. */
37 __asm__("outb %b0, %w1\n\t" :: "a" (*Message
), "d" (BOCHS_LOGGER_PORT
));
39 WRITE_PORT_UCHAR((PUCHAR
)BOCHS_LOGGER_PORT
, *Message
);
47 KdpBochsInit(PKD_DISPATCH_TABLE WrapperTable
,
50 if (!KdpDebugMode
.Bochs
) return;
54 /* Write out the functions that we support for now */
55 WrapperTable
->KdpInitRoutine
= KdpBochsInit
;
56 WrapperTable
->KdpPrintRoutine
= KdpBochsDebugPrint
;
58 else if (BootPhase
== 2)
60 HalDisplayString("\n Bochs debugging enabled\n\n");