Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenbochs.c
Go to the documentation of this file.
00001 /* 00002 * COPYRIGHT: See COPYING in the top level directory 00003 * PROJECT: ReactOS kernel 00004 * FILE: ntoskrnl/kd/wrappers/bochs.c 00005 * PURPOSE: BOCHS Wrapper for Kd 00006 * 00007 * PROGRAMMERS: Alex Ionescu (alex@relsoft.net) 00008 */ 00009 00010 #include <ntoskrnl.h> 00011 #define NDEBUG 00012 #include <debug.h> 00013 00014 /* bochs debug output */ 00015 #define BOCHS_LOGGER_PORT ((PVOID)0xe9) 00016 00017 /* FUNCTIONS *****************************************************************/ 00018 00019 VOID 00020 NTAPI 00021 KdpBochsDebugPrint(IN PCH Message, 00022 IN ULONG Length) 00023 { 00024 if (!KdpDebugMode.Bochs) return; 00025 00026 while (*Message != 0) 00027 { 00028 if (*Message == '\n') 00029 { 00030 WRITE_PORT_UCHAR(BOCHS_LOGGER_PORT, '\r'); 00031 } 00032 WRITE_PORT_UCHAR(BOCHS_LOGGER_PORT, *Message); 00033 Message++; 00034 } 00035 } 00036 00037 VOID 00038 NTAPI 00039 KdpBochsInit(PKD_DISPATCH_TABLE DispatchTable, 00040 ULONG BootPhase) 00041 { 00042 UCHAR Value; 00043 if (!KdpDebugMode.Bochs) return; 00044 00045 if (BootPhase == 0) 00046 { 00047 Value = READ_PORT_UCHAR(BOCHS_LOGGER_PORT); 00048 if (Value != (ULONG_PTR)BOCHS_LOGGER_PORT) 00049 { 00050 KdpDebugMode.Bochs = FALSE; 00051 return; 00052 } 00053 00054 /* Write out the functions that we support for now */ 00055 DispatchTable->KdpInitRoutine = KdpBochsInit; 00056 DispatchTable->KdpPrintRoutine = KdpBochsDebugPrint; 00057 00058 /* Register as a Provider */ 00059 InsertTailList(&KdProviders, &DispatchTable->KdProvidersList); 00060 } 00061 else if (BootPhase == 2) 00062 { 00063 HalDisplayString("\n Bochs debugging enabled\n\n"); 00064 } 00065 } 00066 00067 /* EOF */ Generated on Mon May 28 2012 04:37:15 for ReactOS by
1.7.6.1
|