33#define DBG_DEFAULT_LEVELS (ERR_LEVEL|FIXME_LEVEL)
41#define BOCHS_OUTPUT_PORT 0xE9
43ULONG DebugPort = RS232;
46#if defined(SARCH_PC98)
49ULONG BaudRate = 115200;
67 PSTR CommandLine, PortString, BaudString, IrqString;
69 CHAR DbgStringBuffer[256];
73#if defined (DEBUG_ALL)
75#elif defined (DEBUG_WARN)
77#elif defined (DEBUG_ERR)
83#if defined (DEBUG_INIFILE)
85#elif defined (DEBUG_REACTOS)
88#elif defined (DEBUG_CUSTOM)
106 CommandLine = DbgStringBuffer;
112 PortString =
strstr(CommandLine,
"DEBUGPORT");
113 BaudString =
strstr(CommandLine,
"BAUDRATE");
114 IrqString =
strstr(CommandLine,
"IRQ");
123 PortString +=
strlen(
"DEBUGPORT");
126 while (*PortString ==
' ') PortString++;
130 if (
strncmp(PortString,
"SCREEN", 6) == 0)
135 else if (
strncmp(PortString,
"BOCHS", 5) == 0)
140 else if (
strncmp(PortString,
"COM", 3) == 0)
150 PortString =
strstr(PortString,
"DEBUGPORT");
157 BaudString +=
strlen(
"BAUDRATE");
160 while (*BaudString ==
' ') BaudString++;
175 IrqString +=
strlen(
"IRQ");
178 while (*IrqString ==
' ') IrqString++;
193 if (DebugPort & RS232)
202 if (Character ==
'\n')
203 DebugStartOfLine =
TRUE;
205 if (DebugPort & RS232)
207 if (Character ==
'\n')
212 if (DebugPort & BOCHS)
216 if (DebugPort & SCREEN)
246 DebugPrintChar(*
ptr++);
259 if (!(DbgChannels[
Mask] &
Level) && !(
Level & DBG_DEFAULT_LEVELS))
265 if (DebugStartOfLine)
285 DebugStartOfLine =
FALSE;
294 DebugPrintChar(*
ptr++);
305 if (!(DbgChannels[
Mask] & TRACE_LEVEL))
308 DebugStartOfLine =
FALSE;
315 DebugStartOfLine =
FALSE;
334 DebugPort &= ~SCREEN;
340 int iLevel, iChannel;
342 if (channel ==
NULL || *channel ==
'\0' ||
strlen(channel) == 0)
350 iLevel = FIXME_LEVEL;
354 iLevel = TRACE_LEVEL;
371 else if (
strcmp(channel,
"all" ) == 0)
378 DbgChannels[
i] |= iLevel;
380 DbgChannels[
i] &= ~iLevel;
388 DbgChannels[iChannel] |= iLevel;
390 DbgChannels[iChannel] &= ~iLevel;
418 DbgAddDebugChannel(
c,
str,
op);
478 "*** STOP: 0x%08lX (0x%p,0x%p,0x%p,0x%p)",
480 (
PVOID)BugCheckParameter1,
481 (
PVOID)BugCheckParameter2,
482 (
PVOID)BugCheckParameter3,
483 (
PVOID)BugCheckParameter4);
499 DbgPrint(
"Assertion \'%s\' failed at %s line %lu: %s\n",
500 (
PCHAR)FailedAssertion,
507 DbgPrint(
"Assertion \'%s\' failed at %s line %lu\n",
508 (
PCHAR)FailedAssertion,
519 "MISSING_HARDWARE_REQUIREMENTS",
520 "FREELDR_IMAGE_CORRUPTION",
521 "MEMORY_INIT_FAILURE",
523 "EXIT_BOOTSERVICES_FAILURE",
int strcmp(const char *String1, const char *String2)
char * strstr(char *String1, char *String2)
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
char * strcpy(char *DstString, const char *SrcString)
char * strchr(const char *String, int ch)
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 LineNumber
BOOLEAN Rs232PortInitialize(IN ULONG ComPort, IN ULONG BaudRate)
VOID Rs232PortPutByte(UCHAR ByteToSend)
#define DbgParseDebugChannels(val)
#define DPRINT_FILESYSTEM
#define DebugInit(DebugString)
#define DBG_CHANNELS_COUNT
#define DebugDisableScreenPort()
#define MachConsPutChar(Ch)
VOID UiMessageBoxCritical(_In_ PCSTR MessageText)
VOID UiMessageBox(_In_ PCSTR Format,...)
ULONG_PTR BugCheckInfo[5]
DECLSPEC_NORETURN VOID NTAPI KeBugCheckEx(IN ULONG BugCheckCode, IN ULONG_PTR BugCheckParameter1, IN ULONG_PTR BugCheckParameter2, IN ULONG_PTR BugCheckParameter3, IN ULONG_PTR BugCheckParameter4)
ULONG MsgBoxPrint(const char *Format,...)
VOID NTAPI RtlAssert(IN PVOID FailedAssertion, IN PVOID FileName, IN ULONG LineNumber, IN PCHAR Message OPTIONAL)
static CCHAR DebugString[256]
static const WCHAR separator[]
static const WCHAR Message[]
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
int __cdecl vsprintf(char *_Dest, const char *_Format, va_list _Args)
_Check_return_ long __cdecl atol(_In_z_ const char *_Str)
NTSYSAPI void WINAPI DbgBreakPoint(void)
#define sprintf(buf, format,...)
#define DECLSPEC_NORETURN
_In_ ULONG _In_ ULONG Offset
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define WRITE_PORT_UCHAR(p, d)
_CRTIMP char *__cdecl _strupr(_Inout_z_ char *_String)
PULONG MinorVersion OPTIONAL
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
void int int ULONGLONG int va_list * ap
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level