ReactOS  0.4.14-dev-583-g2a1ba2c
bochs.c
Go to the documentation of this file.
1 /*
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
6  *
7  * PROGRAMMERS: Alex Ionescu (alex@relsoft.net)
8  */
9 
10 #include <ntoskrnl.h>
11 #define NDEBUG
12 #include <debug.h>
13 
14 /* bochs debug output */
15 #define BOCHS_LOGGER_PORT ((PVOID)0xe9)
16 
17 /* FUNCTIONS *****************************************************************/
18 
19 VOID
20 NTAPI
22  IN ULONG Length)
23 {
24  if (!KdpDebugMode.Bochs) return;
25 
26  while (*Message != 0)
27  {
28  if (*Message == '\n')
29  {
31  }
33  Message++;
34  }
35 }
36 
37 VOID
38 NTAPI
39 KdpBochsInit(PKD_DISPATCH_TABLE DispatchTable,
40  ULONG BootPhase)
41 {
42  UCHAR Value;
43  if (!KdpDebugMode.Bochs) return;
44 
45  if (BootPhase == 0)
46  {
49  {
50  KdpDebugMode.Bochs = FALSE;
51  return;
52  }
53 
54  /* Write out the functions that we support for now */
55  DispatchTable->KdpInitRoutine = KdpBochsInit;
56  DispatchTable->KdpPrintRoutine = KdpBochsDebugPrint;
57 
58  /* Register as a Provider */
59  InsertTailList(&KdProviders, &DispatchTable->KdProvidersList);
60  }
61  else if (BootPhase == 2)
62  {
63  HalDisplayString("\r\n Bochs debugging enabled\r\n\r\n");
64  }
65 }
66 
67 /* EOF */
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
#define IN
Definition: typedefs.h:38
KDP_DEBUG_MODE KdpDebugMode
Definition: kdinit.c:25
UCHAR NTAPI READ_PORT_UCHAR(PUCHAR Address)
Definition: mach.c:528
#define InsertTailList(ListHead, Entry)
VOID NTAPI KdpBochsInit(PKD_DISPATCH_TABLE DispatchTable, ULONG BootPhase)
Definition: bochs.c:39
LIST_ENTRY KdProviders
Definition: kdinit.c:29
uint32_t ULONG_PTR
Definition: typedefs.h:63
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
CHAR * PCH
Definition: ntbasedef.h:398
VOID NTAPI KdpBochsDebugPrint(IN PCH Message, IN ULONG Length)
Definition: bochs.c:21
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
CHAR Message[80]
Definition: alive.c:5
unsigned char UCHAR
Definition: xmlstorage.h:181
static LSA_DISPATCH_TABLE DispatchTable
Definition: authpackage.c:164
NTHALAPI VOID NTAPI HalDisplayString(PUCHAR String)
unsigned int ULONG
Definition: retypes.h:1
void WRITE_PORT_UCHAR(PUCHAR Address, UCHAR Value)
Definition: mach.c:532
#define BOCHS_LOGGER_PORT
Definition: bochs.c:15