ReactOS  0.4.14-dev-1036-g3c5b10f
kdio.c File Reference
#include <ntoskrnl.h>
#include <reactos/buildno.h>
#include <debug.h>
Include dependency graph for kdio.c:

Go to the source code of this file.

Macros

#define NDEBUG
 
#define KdpBufferSize   (1024 * 512)
 
#define KdpScreenLineLengthDefault   80
 

Functions

static INIT_FUNCTION SIZE_T KdpGetMemorySizeInMBs (IN PLOADER_PARAMETER_BLOCK LoaderBlock)
 
static INIT_FUNCTION VOID KdpPrintBanner (IN SIZE_T MemSizeMBs)
 
KIRQL NTAPI KdpAcquireLock (IN PKSPIN_LOCK SpinLock)
 
VOID NTAPI KdpReleaseLock (IN PKSPIN_LOCK SpinLock, IN KIRQL OldIrql)
 
static VOID NTAPI KdpLoggerThread (PVOID Context)
 
static VOID NTAPI KdpPrintToLogFile (PCHAR String, ULONG StringLength)
 
VOID NTAPI KdpDebugLogInit (PKD_DISPATCH_TABLE DispatchTable, ULONG BootPhase)
 
VOID NTAPI KdpSerialDebugPrint (PCHAR Message, ULONG Length)
 
VOID NTAPI KdpSerialInit (PKD_DISPATCH_TABLE DispatchTable, ULONG BootPhase)
 
VOID KdpScreenAcquire (VOID)
 
VOID KdpScreenRelease (VOID)
 
static VOID NTAPI KdpScreenPrint (PCHAR Message, ULONG Length)
 
VOID NTAPI KdpScreenInit (PKD_DISPATCH_TABLE DispatchTable, ULONG BootPhase)
 
BOOLEAN NTAPI KdpPrintString (_In_ PSTRING Output)
 
BOOLEAN NTAPI KdpPromptString (_In_ PSTRING PromptString, _In_ PSTRING ResponseString)
 

Variables

static BOOLEAN KdpLoggingEnabled = FALSE
 
static PCHAR KdpDebugBuffer = NULL
 
static volatile ULONG KdpCurrentPosition = 0
 
static volatile ULONG KdpFreeBytes = 0
 
static KSPIN_LOCK KdpDebugLogSpinLock
 
static KEVENT KdpLoggerThreadEvent
 
static HANDLE KdpLogFileHandle
 
ANSI_STRING KdpLogFileName = RTL_CONSTANT_STRING("\\SystemRoot\\debug.log")
 
static KSPIN_LOCK KdpSerialSpinLock
 
ULONG SerialPortNumber = DEFAULT_DEBUG_PORT
 
CPPORT SerialPortInfo = {0, DEFAULT_DEBUG_BAUD_RATE, 0}
 
ULONG KdpPort
 
static CHAR KdpScreenLineBuffer [KdpScreenLineLengthDefault+1] = ""
 
static ULONG KdpScreenLineBufferPos = 0
 
static ULONG KdpScreenLineLength = 0
 
const ULONG KdpDmesgBufferSize = 128 * 1024
 
PCHAR KdpDmesgBuffer = NULL
 
volatile ULONG KdpDmesgCurrentPosition = 0
 
volatile ULONG KdpDmesgFreeBytes = 0
 
volatile ULONG KdbDmesgTotalWritten = 0
 
volatile BOOLEAN KdbpIsInDmesgMode = FALSE
 
static KSPIN_LOCK KdpDmesgLogSpinLock
 
STRING KdbPromptString
 

Macro Definition Documentation

◆ KdpBufferSize

#define KdpBufferSize   (1024 * 512)

Definition at line 19 of file kdio.c.

◆ KdpScreenLineLengthDefault

#define KdpScreenLineLengthDefault   80

Definition at line 36 of file kdio.c.

◆ NDEBUG

#define NDEBUG

Definition at line 14 of file kdio.c.

Function Documentation

◆ KdpAcquireLock()

KIRQL NTAPI KdpAcquireLock ( IN PKSPIN_LOCK  SpinLock)

Definition at line 116 of file kdio.c.

117 {
118  KIRQL OldIrql;
119 
120  /* Acquire the spinlock without waiting at raised IRQL */
121  while (TRUE)
122  {
123  /* Loop until the spinlock becomes available */
124  while (!KeTestSpinLock(SpinLock));
125 
126  /* Spinlock is free, raise IRQL to high level */
128 
129  /* Try to get the spinlock */
131  break;
132 
133  /* Someone else got the spinlock, lower IRQL back */
135  }
136 
137  return OldIrql;
138 }
#define KeRaiseIrql(irql, oldIrql)
Definition: env_spec_w32.h:597
#define TRUE
Definition: types.h:120
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID _In_opt_ PKSPIN_LOCK SpinLock
Definition: iofuncs.h:798
UCHAR KIRQL
Definition: env_spec_w32.h:591
BOOLEAN FASTCALL KeTestSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: spinlock.c:442
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:790
#define HIGH_LEVEL
Definition: env_spec_w32.h:703
BOOLEAN FASTCALL KeTryToAcquireSpinLockAtDpcLevel(IN OUT PKSPIN_LOCK SpinLock)
Definition: spinlock.c:303

Referenced by KdpPrintToLogFile(), KdpPromptString(), KdpScreenPrint(), and KdpSerialDebugPrint().

◆ KdpDebugLogInit()

VOID NTAPI KdpDebugLogInit ( PKD_DISPATCH_TABLE  DispatchTable,
ULONG  BootPhase 
)

Definition at line 247 of file kdio.c.

249 {
254  HANDLE ThreadHandle;
256  SIZE_T MemSizeMBs;
257 
258  if (!KdpDebugMode.File) return;
259 
260  if (BootPhase == 0)
261  {
263 
264  /* Write out the functions that we support for now */
265  DispatchTable->KdpInitRoutine = KdpDebugLogInit;
266  DispatchTable->KdpPrintRoutine = KdpPrintToLogFile;
267 
268  /* Register as a Provider */
269  InsertTailList(&KdProviders, &DispatchTable->KdProvidersList);
270  }
271  else if (BootPhase == 1)
272  {
273  /* Allocate a buffer for debug log */
276 
277  /* Initialize spinlock */
279 
280  /* Display separator + ReactOS version at start of the debug log */
281  /* Round size up. Assumed to better match actual physical RAM size */
282  MemSizeMBs = ALIGN_UP_BY(MmNumberOfPhysicalPages * PAGE_SIZE, 1024 * 1024) / (1024 * 1024);
283  KdpPrintBanner(MemSizeMBs);
284  }
285  else if (BootPhase == 2)
286  {
287  HalDisplayString("\r\n File log debugging enabled\r\n\r\n");
288  }
289  else if (BootPhase == 3)
290  {
291  /* Setup the log name */
293  if (!NT_SUCCESS(Status)) return;
294 
296  &FileName,
298  NULL,
299  NULL);
300 
301  /* Create the log file */
305  &Iosb,
306  NULL,
311  NULL,
312  0);
313 
315 
316  if (!NT_SUCCESS(Status))
317  return;
318 
320 
321  /* Create the logger thread */
322  Status = PsCreateSystemThread(&ThreadHandle,
324  NULL,
325  NULL,
326  NULL,
328  NULL);
329  if (!NT_SUCCESS(Status))
330  {
332  return;
333  }
334 
335  Priority = 7;
336  NtSetInformationThread(ThreadHandle,
338  &Priority,
339  sizeof(Priority));
340  }
341 }
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
#define THREAD_ALL_ACCESS
Definition: nt_native.h:1339
#define TRUE
Definition: types.h:120
static HANDLE KdpLogFileHandle
Definition: kdio.c:26
KDP_DEBUG_MODE KdpDebugMode
Definition: kdinit.c:25
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
static volatile ULONG KdpFreeBytes
Definition: kdio.c:23
LONG NTSTATUS
Definition: precomp.h:26
_In_ KPRIORITY Priority
Definition: kefuncs.h:503
static INIT_FUNCTION VOID KdpPrintBanner(IN SIZE_T MemSizeMBs)
Definition: kdio.c:103
#define InsertTailList(ListHead, Entry)
#define FILE_APPEND_DATA
Definition: nt_native.h:634
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
LONG KPRIORITY
Definition: compat.h:462
static KEVENT KdpLoggerThreadEvent
Definition: kdio.c:25
#define FILE_SHARE_READ
Definition: compat.h:125
LIST_ENTRY KdProviders
Definition: kdinit.c:29
static KSPIN_LOCK KdpDebugLogSpinLock
Definition: kdio.c:24
static VOID NTAPI KdpPrintToLogFile(PCHAR String, ULONG StringLength)
Definition: kdio.c:204
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:238
#define FILE_WRITE_THROUGH
Definition: from_kernel.h:26
smooth NULL
Definition: ftsmooth.c:416
ANSI_STRING KdpLogFileName
Definition: kdio.c:27
NTSTATUS NTAPI NtSetInformationThread(IN HANDLE ThreadHandle, IN THREADINFOCLASS ThreadInformationClass, IN PVOID ThreadInformation, IN ULONG ThreadInformationLength)
Definition: query.c:2014
static VOID NTAPI KdpLoggerThread(PVOID Context)
Definition: kdio.c:157
PUCHAR KdComPortInUse
Definition: usage.c:17
NTSTATUS NTAPI NtCreateFile(OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PLARGE_INTEGER AllocationSize OPTIONAL, IN ULONG FileAttributes, IN ULONG ShareAccess, IN ULONG CreateDisposition, IN ULONG CreateOptions, IN PVOID EaBuffer OPTIONAL, IN ULONG EaLength)
return Iosb
Definition: create.c:4426
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define KdpBufferSize
Definition: kdio.c:19
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3399
static PCHAR KdpDebugBuffer
Definition: kdio.c:21
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
#define PAGE_SIZE
Definition: env_spec_w32.h:49
#define SYNCHRONIZE
Definition: nt_native.h:61
Status
Definition: gdiplustypes.h:24
ULONG_PTR SIZE_T
Definition: typedefs.h:79
struct _FileName FileName
Definition: fatprocs.h:884
PFN_COUNT MmNumberOfPhysicalPages
Definition: init.c:48
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
static LSA_DISPATCH_TABLE DispatchTable
Definition: authpackage.c:164
NTSTATUS NTAPI PsCreateSystemThread(OUT PHANDLE ThreadHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN HANDLE ProcessHandle, IN PCLIENT_ID ClientId, IN PKSTART_ROUTINE StartRoutine, IN PVOID StartContext)
Definition: thread.c:602
NTHALAPI VOID NTAPI HalDisplayString(PUCHAR String)
#define FILE_SYNCHRONOUS_IO_NONALERT
Definition: from_kernel.h:31
#define FILE_SUPERSEDE
Definition: from_kernel.h:53
#define ALIGN_UP_BY(size, align)
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
VOID NTAPI KdpDebugLogInit(PKD_DISPATCH_TABLE DispatchTable, ULONG BootPhase)
Definition: kdio.c:247

◆ KdpGetMemorySizeInMBs()

static INIT_FUNCTION SIZE_T KdpGetMemorySizeInMBs ( IN PLOADER_PARAMETER_BLOCK  LoaderBlock)
static

Definition at line 62 of file kdio.c.

63 {
64  PLIST_ENTRY ListEntry;
66  SIZE_T NumberOfPhysicalPages = 0;
67 
68  /* Loop the memory descriptors */
69  for (ListEntry = LoaderBlock->MemoryDescriptorListHead.Flink;
70  ListEntry != &LoaderBlock->MemoryDescriptorListHead;
71  ListEntry = ListEntry->Flink)
72  {
73  /* Get the descriptor */
74  Descriptor = CONTAINING_RECORD(ListEntry,
76  ListEntry);
77 
78  /* Check if this is invisible memory */
79  if ((Descriptor->MemoryType == LoaderFirmwarePermanent) ||
80  (Descriptor->MemoryType == LoaderSpecialMemory) ||
81  (Descriptor->MemoryType == LoaderHALCachedMemory) ||
82  (Descriptor->MemoryType == LoaderBBTMemory))
83  {
84  /* Skip this descriptor */
85  continue;
86  }
87 
88  /* Check if this is bad memory */
89  if (Descriptor->MemoryType != LoaderBad)
90  {
91  /* Count this in the total of pages */
92  NumberOfPhysicalPages += Descriptor->PageCount;
93  }
94  }
95 
96  /* Round size up. Assumed to better match actual physical RAM size */
97  return ALIGN_UP_BY(NumberOfPhysicalPages * PAGE_SIZE, 1024 * 1024) / (1024 * 1024);
98 }
Definition: arc.h:130
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:120
#define PAGE_SIZE
Definition: env_spec_w32.h:49
Definition: typedefs.h:118
ULONG_PTR SIZE_T
Definition: typedefs.h:79
#define ALIGN_UP_BY(size, align)
_In_ PSTORAGE_PROPERTY_ID _Outptr_ PSTORAGE_DESCRIPTOR_HEADER * Descriptor
Definition: classpnp.h:966

Referenced by KdpSerialInit().

◆ KdpLoggerThread()

static VOID NTAPI KdpLoggerThread ( PVOID  Context)
static

Definition at line 157 of file kdio.c.

158 {
159  ULONG beg, end, num;
161 
163 
164  while (TRUE)
165  {
167 
168  /* Bug */
169  /* Keep KdpCurrentPosition and KdpFreeBytes values in local
170  * variables to avoid their possible change from Producer part,
171  * KdpPrintToLogFile function
172  */
174  num = KdpFreeBytes;
175 
176  /* Now securely calculate values, based on local variables */
177  beg = (end + num) % KdpBufferSize;
178  num = KdpBufferSize - num;
179 
180  /* Nothing to do? */
181  if (num == 0)
182  continue;
183 
184  if (end > beg)
185  {
187  KdpDebugBuffer + beg, num, NULL, NULL);
188  }
189  else
190  {
192  KdpDebugBuffer + beg, KdpBufferSize - beg, NULL, NULL);
193 
196  }
197 
199  }
200 }
static BOOLEAN KdpLoggingEnabled
Definition: kdio.c:20
#define TRUE
Definition: types.h:120
static HANDLE KdpLogFileHandle
Definition: kdio.c:26
static volatile ULONG KdpFreeBytes
Definition: kdio.c:23
GLuint GLuint end
Definition: gl.h:1545
NTSTATUS NTAPI KeWaitForSingleObject(IN PVOID Object, IN KWAIT_REASON WaitReason, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Timeout OPTIONAL)
Definition: wait.c:416
static KEVENT KdpLoggerThreadEvent
Definition: kdio.c:25
smooth NULL
Definition: ftsmooth.c:416
static volatile ULONG KdpCurrentPosition
Definition: kdio.c:22
return Iosb
Definition: create.c:4426
#define InterlockedExchangeAddUL(Addend, Value)
Definition: ex.h:1519
GLuint GLuint num
Definition: glext.h:9618
#define KdpBufferSize
Definition: kdio.c:19
static PCHAR KdpDebugBuffer
Definition: kdio.c:21
#define VOID
Definition: acefi.h:82
NTSYSAPI NTSTATUS NTAPI NtWriteFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN PVOID WriteBuffer, IN ULONG WriteBufferLength, IN PLARGE_INTEGER FileOffset OPTIONAL, IN PULONG LockOperationKey OPTIONAL)
unsigned int ULONG
Definition: retypes.h:1

Referenced by KdpDebugLogInit().

◆ KdpPrintBanner()

static INIT_FUNCTION VOID KdpPrintBanner ( IN SIZE_T  MemSizeMBs)
static

Definition at line 103 of file kdio.c.

104 {
105  DPRINT1("-----------------------------------------------------\n");
106  DPRINT1("ReactOS " KERNEL_VERSION_STR " (Build " KERNEL_VERSION_BUILD_STR ") (Commit " KERNEL_VERSION_COMMIT_HASH ")\n");
107  DPRINT1("%u System Processor [%u MB Memory]\n", KeNumberProcessors, MemSizeMBs);
108  DPRINT1("Command Line: %s\n", KeLoaderBlock->LoadOptions);
110 }
PSTR ArcBootDeviceName
Definition: arc.h:503
PLOADER_PARAMETER_BLOCK KeLoaderBlock
Definition: krnlinit.c:29
CCHAR KeNumberProcessors
Definition: krnlinit.c:35
#define DPRINT1
Definition: precomp.h:8

Referenced by KdpDebugLogInit(), KdpScreenInit(), and KdpSerialInit().

◆ KdpPrintString()

BOOLEAN NTAPI KdpPrintString ( _In_ PSTRING  Output)

Definition at line 590 of file kdio.c.

592 {
593  PLIST_ENTRY CurrentEntry;
594  PKD_DISPATCH_TABLE CurrentTable;
595 
596  if (!KdpDebugMode.Value) return FALSE;
597 
598  /* Call the registered handlers */
599  CurrentEntry = KdProviders.Flink;
600  while (CurrentEntry != &KdProviders)
601  {
602  /* Get the current table */
603  CurrentTable = CONTAINING_RECORD(CurrentEntry,
604  KD_DISPATCH_TABLE,
605  KdProvidersList);
606 
607  /* Call it */
608  CurrentTable->KdpPrintRoutine(Output->Buffer, Output->Length);
609 
610  /* Next Table */
611  CurrentEntry = CurrentEntry->Flink;
612  }
613 
614  /* Call the Wrapper Routine */
615  if (WrapperTable.KdpPrintRoutine)
616  WrapperTable.KdpPrintRoutine(Output->Buffer, Output->Length);
617 
618  return FALSE;
619 }
KDP_DEBUG_MODE KdpDebugMode
Definition: kdinit.c:25
LIST_ENTRY KdProviders
Definition: kdinit.c:29
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:120
Definition: arc.h:85
Definition: typedefs.h:118
KD_DISPATCH_TABLE WrapperTable
Definition: kdinit.c:28

Referenced by KdpDprintf(), KdpPrint(), and KdpPromptString().

◆ KdpPrintToLogFile()

static VOID NTAPI KdpPrintToLogFile ( PCHAR  String,
ULONG  StringLength 
)
static

Definition at line 204 of file kdio.c.

206 {
207  KIRQL OldIrql;
208  ULONG beg, end, num;
209 
210  if (KdpDebugBuffer == NULL) return;
211 
212  /* Acquire the printing spinlock without waiting at raised IRQL */
214 
215  beg = KdpCurrentPosition;
216  num = KdpFreeBytes;
217  if (StringLength < num)
218  num = StringLength;
219 
220  if (num != 0)
221  {
222  end = (beg + num) % KdpBufferSize;
224  KdpFreeBytes -= num;
225 
226  if (end > beg)
227  {
229  }
230  else
231  {
234  }
235  }
236 
237  /* Release the spinlock */
239 
240  /* Signal the logger thread */
243 }
static BOOLEAN KdpLoggingEnabled
Definition: kdio.c:20
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
static volatile ULONG KdpFreeBytes
Definition: kdio.c:23
KIRQL NTAPI KdpAcquireLock(IN PKSPIN_LOCK SpinLock)
Definition: kdio.c:116
static WCHAR String[]
Definition: stringtable.c:55
GLuint GLuint end
Definition: gl.h:1545
LONG NTAPI KeSetEvent(IN PKEVENT Event, IN KPRIORITY Increment, IN BOOLEAN Wait)
Definition: eventobj.c:159
static KEVENT KdpLoggerThreadEvent
Definition: kdio.c:25
static KSPIN_LOCK KdpDebugLogSpinLock
Definition: kdio.c:24
UCHAR KIRQL
Definition: env_spec_w32.h:591
smooth NULL
Definition: ftsmooth.c:416
static volatile ULONG KdpCurrentPosition
Definition: kdio.c:22
VOID NTAPI KdpReleaseLock(IN PKSPIN_LOCK SpinLock, IN KIRQL OldIrql)
Definition: kdio.c:142
GLuint GLuint num
Definition: glext.h:9618
#define KdpBufferSize
Definition: kdio.c:19
static PCHAR KdpDebugBuffer
Definition: kdio.c:21
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:790
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:566

Referenced by KdpDebugLogInit().

◆ KdpPromptString()

BOOLEAN NTAPI KdpPromptString ( _In_ PSTRING  PromptString,
_In_ PSTRING  ResponseString 
)

Definition at line 625 of file kdio.c.

628 {
629  KIRQL OldIrql;
630  STRING StringChar;
631  CHAR Response;
632  USHORT i;
633  ULONG DummyScanCode;
634 
635  StringChar.Buffer = &Response;
636  StringChar.Length = StringChar.MaximumLength = sizeof(Response);
637 
638  /* Display the string and print a new line for log neatness */
639  KdpPrintString(PromptString);
640  *StringChar.Buffer = '\n';
641  KdpPrintString(&StringChar);
642 
643  /* Print the kdb prompt */
645 
646  // TODO: Use an improved KdbpReadCommand() function for our purposes.
647 
648  /* Acquire the printing spinlock without waiting at raised IRQL */
650 
652  KbdDisableMouse();
653 
654  /* Loop the whole string */
655  for (i = 0; i < ResponseString->MaximumLength; i++)
656  {
657  /* Check if this is serial debugging mode */
659  {
660  /* Get the character from serial */
661  do
662  {
664  } while (Response == -1);
665  }
666  else
667  {
668  /* Get the response from the keyboard */
669  do
670  {
671  Response = KdbpTryGetCharKeyboard(&DummyScanCode, MAXULONG);
672  } while (Response == -1);
673  }
674 
675  /* Check for return */
676  if (Response == '\r')
677  {
678  /*
679  * We might need to discard the next '\n'.
680  * Wait a bit to make sure we receive it.
681  */
683 
684  /* Check the mode */
686  {
687  /* Read and discard the next character, if any */
689  }
690  else
691  {
692  /* Read and discard the next character, if any */
693  KdbpTryGetCharKeyboard(&DummyScanCode, 5);
694  }
695 
696  /*
697  * Null terminate the output string -- documentation states that
698  * DbgPrompt does not null terminate, but it does
699  */
700  *(PCHAR)(ResponseString->Buffer + i) = 0;
701  break;
702  }
703 
704  /* Write it back and print it to the log */
705  *(PCHAR)(ResponseString->Buffer + i) = Response;
707  KdpPrintString(&StringChar);
709  }
710 
711  /* Return the length */
712  ResponseString->Length = i;
713 
715  KbdEnableMouse();
716 
717  /* Release the spinlock */
719 
720  /* Print a new line */
721  *StringChar.Buffer = '\n';
722  KdpPrintString(&StringChar);
723 
724  /* Success; we don't need to resend */
725  return FALSE;
726 }
ULONG KdbDebugState
Definition: kdb.c:45
char CHAR
Definition: xmlstorage.h:175
KIRQL NTAPI KdpAcquireLock(IN PKSPIN_LOCK SpinLock)
Definition: kdio.c:116
CHAR KdbpTryGetCharSerial(ULONG Retry)
Definition: kdb_serial.c:19
CHAR KdbpTryGetCharKeyboard(PULONG ScanCode, ULONG Retry)
Definition: kdb_keyboard.c:104
UCHAR KIRQL
Definition: env_spec_w32.h:591
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
Definition: glfuncs.h:248
STRING KdbPromptString
Definition: kdb_cli.c:136
VOID KbdEnableMouse(VOID)
#define PCHAR
Definition: match.c:90
VOID KbdDisableMouse(VOID)
VOID NTAPI KdpReleaseLock(IN PKSPIN_LOCK SpinLock, IN KIRQL OldIrql)
Definition: kdio.c:142
Definition: ncftp.h:89
std::wstring STRING
Definition: fontsub.cpp:33
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:790
#define MAXULONG
Definition: typedefs.h:251
BOOLEAN NTAPI KdpPrintString(_In_ PSTRING Output)
Definition: kdio.c:590
unsigned short USHORT
Definition: pedump.c:61
static KSPIN_LOCK KdpSerialSpinLock
Definition: kdio.c:29
unsigned int ULONG
Definition: retypes.h:1
struct Response Response
VOID NTAPI KeStallExecutionProcessor(IN ULONG MicroSeconds)
Definition: ntoskrnl.c:95

Referenced by KdpPrompt().

◆ KdpReleaseLock()

VOID NTAPI KdpReleaseLock ( IN PKSPIN_LOCK  SpinLock,
IN KIRQL  OldIrql 
)

Definition at line 142 of file kdio.c.

144 {
145  /* Release the spinlock */
147  // KeReleaseSpinLockFromDpcLevel(SpinLock);
148 
149  /* Restore the old IRQL */
151 }
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID _In_opt_ PKSPIN_LOCK SpinLock
Definition: iofuncs.h:798
VOID FASTCALL KiReleaseSpinLock(IN PKSPIN_LOCK SpinLock)
Definition: ntoskrnl.c:35
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:790

Referenced by KdpPrintToLogFile(), KdpPromptString(), KdpScreenPrint(), and KdpSerialDebugPrint().

◆ KdpScreenAcquire()

VOID KdpScreenAcquire ( VOID  )

Definition at line 412 of file kdio.c.

413 {
414  if (InbvIsBootDriverInstalled() /* &&
415  !InbvCheckDisplayOwnership() */)
416  {
417  /* Acquire ownership and reset the display */
420  InbvSolidColorFill(0, 0, 639, 479, 0);
421  InbvSetTextColor(15);
424  InbvSetScrollRegion(0, 0, 639, 479);
425  }
426 }
#define TRUE
Definition: types.h:120
VOID NTAPI InbvSolidColorFill(IN ULONG Left, IN ULONG Top, IN ULONG Right, IN ULONG Bottom, IN ULONG Color)
Definition: inbv.c:719
smooth NULL
Definition: ftsmooth.c:416
VOID NTAPI InbvSetTextColor(IN ULONG Color)
Definition: inbv.c:695
VOID NTAPI InbvAcquireDisplayOwnership(VOID)
Definition: inbv.c:531
BOOLEAN NTAPI InbvEnableDisplayString(IN BOOLEAN Enable)
Definition: inbv.c:609
BOOLEAN NTAPI InbvIsBootDriverInstalled(VOID)
Definition: inbv.c:633
BOOLEAN NTAPI InbvResetDisplay(VOID)
Definition: inbv.c:667
VOID NTAPI InbvInstallDisplayStringFilter(IN INBV_DISPLAY_STRING_FILTER Filter)
Definition: inbv.c:625
VOID NTAPI InbvSetScrollRegion(IN ULONG Left, IN ULONG Top, IN ULONG Right, IN ULONG Bottom)
Definition: inbv.c:684

Referenced by KdbpInternalEnter(), and KdpScreenInit().

◆ KdpScreenInit()

VOID NTAPI KdpScreenInit ( PKD_DISPATCH_TABLE  DispatchTable,
ULONG  BootPhase 
)

Definition at line 544 of file kdio.c.

546 {
547  SIZE_T MemSizeMBs;
548  if (!KdpDebugMode.Screen) return;
549 
550  if (BootPhase == 0)
551  {
552  /* Write out the functions that we support for now */
553  DispatchTable->KdpInitRoutine = KdpScreenInit;
554  DispatchTable->KdpPrintRoutine = KdpScreenPrint;
555 
556  /* Register as a Provider */
557  InsertTailList(&KdProviders, &DispatchTable->KdProvidersList);
558  }
559  else if (BootPhase == 1)
560  {
561  /* Allocate a buffer for dmesg log buffer. +1 for terminating null,
562  * see kdbp_cli.c:KdbpCmdDmesg()/2
563  */
568 
569  /* Take control of the display */
571 
572  /* Initialize spinlock */
574 
575  /* Display separator + ReactOS version at start of the debug log */
576  /* Round size up. Assumed to better match actual physical RAM size */
577  MemSizeMBs = ALIGN_UP_BY(MmNumberOfPhysicalPages * PAGE_SIZE, 1024 * 1024) / (1024 * 1024);
578  KdpPrintBanner(MemSizeMBs);
579  }
580  else if (BootPhase == 2)
581  {
582  HalDisplayString("\r\n Screen debugging enabled\r\n\r\n");
583  }
584 }
KDP_DEBUG_MODE KdpDebugMode
Definition: kdinit.c:25
PCHAR KdpDmesgBuffer
Definition: kdio.c:41
static KSPIN_LOCK KdpDmesgLogSpinLock
Definition: kdio.c:46
static INIT_FUNCTION VOID KdpPrintBanner(IN SIZE_T MemSizeMBs)
Definition: kdio.c:103
#define InsertTailList(ListHead, Entry)
LIST_ENTRY KdProviders
Definition: kdinit.c:29
static VOID NTAPI KdpScreenPrint(PCHAR Message, ULONG Length)
Definition: kdio.c:450
VOID NTAPI KdpScreenInit(PKD_DISPATCH_TABLE DispatchTable, ULONG BootPhase)
Definition: kdio.c:544
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:238
volatile ULONG KdbDmesgTotalWritten
Definition: kdio.c:44
VOID KdpScreenAcquire(VOID)
Definition: kdio.c:412
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
#define PAGE_SIZE
Definition: env_spec_w32.h:49
volatile ULONG KdpDmesgFreeBytes
Definition: kdio.c:43
const ULONG KdpDmesgBufferSize
Definition: kdio.c:40
ULONG_PTR SIZE_T
Definition: typedefs.h:79
PFN_COUNT MmNumberOfPhysicalPages
Definition: init.c:48
static LSA_DISPATCH_TABLE DispatchTable
Definition: authpackage.c:164
NTHALAPI VOID NTAPI HalDisplayString(PUCHAR String)
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define ALIGN_UP_BY(size, align)

◆ KdpScreenPrint()

static VOID NTAPI KdpScreenPrint ( PCHAR  Message,
ULONG  Length 
)
static

Definition at line 450 of file kdio.c.

452 {
453  PCHAR pch = (PCHAR)Message;
454  KIRQL OldIrql;
455  ULONG beg, end, num;
456 
457  while (pch < Message + Length && *pch)
458  {
459  if (*pch == '\b')
460  {
461  /* HalDisplayString does not support '\b'. Workaround it and use '\r' */
462  if (KdpScreenLineLength > 0)
463  {
464  /* Remove last character from buffer */
467 
468  /* Clear row and print line again */
469  HalDisplayString("\r");
471  }
472  }
473  else
474  {
477  }
478 
480  {
481  /* Print buffered characters */
484 
485  /* Clear line buffer */
486  KdpScreenLineBuffer[0] = '\0';
488  }
489 
490  ++pch;
491  }
492 
493  /* Print buffered characters */
495  {
498  }
499 
500  /* Dmesg: store Message in the buffer to show it later */
501  if (KdbpIsInDmesgMode)
502  return;
503 
504  if (KdpDmesgBuffer == NULL)
505  return;
506 
507  /* Acquire the printing spinlock without waiting at raised IRQL */
509 
510  /* Invariant: always_true(KdpDmesgFreeBytes == KdpDmesgBufferSize);
511  * set num to min(KdpDmesgFreeBytes, Length).
512  */
515  if (num != 0)
516  {
517  end = (beg + num) % KdpDmesgBufferSize;
518  if (end > beg)
519  {
521  }
522  else
523  {
526  }
528 
529  /* Counting the total bytes written */
531  }
532 
533  /* Release the spinlock */
535 
536  /* Optional step(?): find out a way to notify about buffer exhaustion,
537  * and possibly fall into kbd to use dmesg command: user will read
538  * debug messages before they will be wiped over by next writes.
539  */
540 }
signed char * PCHAR
Definition: retypes.h:7
static CHAR KdpScreenLineBuffer[KdpScreenLineLengthDefault+1]
Definition: kdio.c:37
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
volatile ULONG KdpDmesgCurrentPosition
Definition: kdio.c:42
PCHAR KdpDmesgBuffer
Definition: kdio.c:41
static ULONG KdpScreenLineLength
Definition: kdio.c:38
static KSPIN_LOCK KdpDmesgLogSpinLock
Definition: kdio.c:46
KIRQL NTAPI KdpAcquireLock(IN PKSPIN_LOCK SpinLock)
Definition: kdio.c:116
GLuint GLuint end
Definition: gl.h:1545
#define pch(ap)
Definition: match.c:418
UCHAR KIRQL
Definition: env_spec_w32.h:591
smooth NULL
Definition: ftsmooth.c:416
volatile ULONG KdbDmesgTotalWritten
Definition: kdio.c:44
#define PCHAR
Definition: match.c:90
VOID NTAPI KdpReleaseLock(IN PKSPIN_LOCK SpinLock, IN KIRQL OldIrql)
Definition: kdio.c:142
GLuint GLuint num
Definition: glext.h:9618
#define KdpScreenLineLengthDefault
Definition: kdio.c:36
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
CHAR Message[80]
Definition: alive.c:5
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:790
volatile ULONG KdpDmesgFreeBytes
Definition: kdio.c:43
const ULONG KdpDmesgBufferSize
Definition: kdio.c:40
NTHALAPI VOID NTAPI HalDisplayString(PUCHAR String)
static ULONG KdpScreenLineBufferPos
Definition: kdio.c:38
volatile BOOLEAN KdbpIsInDmesgMode
Definition: kdio.c:45
unsigned int ULONG
Definition: retypes.h:1

Referenced by KdpScreenInit().

◆ KdpScreenRelease()

VOID KdpScreenRelease ( VOID  )

Definition at line 431 of file kdio.c.

432 {
435  {
436  /* Release the display */
437  // InbvSetDisplayOwnership(FALSE);
439  }
440 }
VOID NTAPI InbvNotifyDisplayOwnershipLost(IN INBV_RESET_DISPLAY_PARAMETERS Callback)
Definition: inbv.c:641
smooth NULL
Definition: ftsmooth.c:416
BOOLEAN NTAPI InbvIsBootDriverInstalled(VOID)
Definition: inbv.c:633
BOOLEAN NTAPI InbvCheckDisplayOwnership(VOID)
Definition: inbv.c:556

Referenced by KdbpInternalEnter().

◆ KdpSerialDebugPrint()

VOID NTAPI KdpSerialDebugPrint ( PCHAR  Message,
ULONG  Length 
)

Definition at line 347 of file kdio.c.

349 {
350  PCHAR pch = (PCHAR)Message;
351  KIRQL OldIrql;
352 
353  /* Acquire the printing spinlock without waiting at raised IRQL */
355 
356  /* Output the message */
357  while (pch < Message + Length && *pch != '\0')
358  {
359  if (*pch == '\n')
360  {
362  }
364  pch++;
365  }
366 
367  /* Release the spinlock */
369 }
signed char * PCHAR
Definition: retypes.h:7
KIRQL NTAPI KdpAcquireLock(IN PKSPIN_LOCK SpinLock)
Definition: kdio.c:116
#define pch(ap)
Definition: match.c:418
UCHAR KIRQL
Definition: env_spec_w32.h:591
VOID NTAPI KdPortPutByteEx(PCPPORT PortInformation, UCHAR ByteToSend)
#define PCHAR
Definition: match.c:90
VOID NTAPI KdpReleaseLock(IN PKSPIN_LOCK SpinLock, IN KIRQL OldIrql)
Definition: kdio.c:142
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
CHAR Message[80]
Definition: alive.c:5
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:790
static KSPIN_LOCK KdpSerialSpinLock
Definition: kdio.c:29
CPPORT SerialPortInfo
Definition: kdio.c:31

Referenced by KdpSerialInit().

◆ KdpSerialInit()

VOID NTAPI KdpSerialInit ( PKD_DISPATCH_TABLE  DispatchTable,
ULONG  BootPhase 
)

Definition at line 373 of file kdio.c.

375 {
376  SIZE_T MemSizeMBs;
377  if (!KdpDebugMode.Serial) return;
378 
379  if (BootPhase == 0)
380  {
381  /* Write out the functions that we support for now */
382  DispatchTable->KdpInitRoutine = KdpSerialInit;
383  DispatchTable->KdpPrintRoutine = KdpSerialDebugPrint;
384 
385  /* Initialize the Port */
387  {
388  KdpDebugMode.Serial = FALSE;
389  return;
390  }
392 
393  /* Initialize spinlock */
395 
396  /* Register as a Provider */
397  InsertTailList(&KdProviders, &DispatchTable->KdProvidersList);
398 
399  /* Display separator + ReactOS version at start of the debug log */
400  MemSizeMBs = KdpGetMemorySizeInMBs(KeLoaderBlock);
401  KdpPrintBanner(MemSizeMBs);
402  }
403  else if (BootPhase == 2)
404  {
405  HalDisplayString("\r\n Serial debugging enabled\r\n\r\n");
406  }
407 }
KDP_DEBUG_MODE KdpDebugMode
Definition: kdinit.c:25
VOID NTAPI KdpSerialInit(PKD_DISPATCH_TABLE DispatchTable, ULONG BootPhase)
Definition: kdio.c:373
static INIT_FUNCTION VOID KdpPrintBanner(IN SIZE_T MemSizeMBs)
Definition: kdio.c:103
#define InsertTailList(ListHead, Entry)
LIST_ENTRY KdProviders
Definition: kdinit.c:29
BOOLEAN NTAPI KdPortInitializeEx(PCPPORT PortInformation, ULONG ComPortNumber)
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:238
PLOADER_PARAMETER_BLOCK KeLoaderBlock
Definition: krnlinit.c:29
PUCHAR KdComPortInUse
Definition: usage.c:17
VOID NTAPI KdpSerialDebugPrint(PCHAR Message, ULONG Length)
Definition: kdio.c:347
PUCHAR Address
Definition: cportlib.h:29
ULONG_PTR SIZE_T
Definition: typedefs.h:79
static KSPIN_LOCK KdpSerialSpinLock
Definition: kdio.c:29
static LSA_DISPATCH_TABLE DispatchTable
Definition: authpackage.c:164
CPPORT SerialPortInfo
Definition: kdio.c:31
NTHALAPI VOID NTAPI HalDisplayString(PUCHAR String)
ULONG SerialPortNumber
Definition: kdio.c:30
static INIT_FUNCTION SIZE_T KdpGetMemorySizeInMBs(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: kdio.c:62

Variable Documentation

◆ KdbDmesgTotalWritten

volatile ULONG KdbDmesgTotalWritten = 0

Definition at line 44 of file kdio.c.

Referenced by KdbpCmdDmesg(), KdpScreenInit(), and KdpScreenPrint().

◆ KdbpIsInDmesgMode

volatile BOOLEAN KdbpIsInDmesgMode = FALSE

Definition at line 45 of file kdio.c.

Referenced by KdbpCmdDmesg(), and KdpScreenPrint().

◆ KdbPromptString

◆ KdpCurrentPosition

volatile ULONG KdpCurrentPosition = 0
static

Definition at line 22 of file kdio.c.

Referenced by KdpLoggerThread(), and KdpPrintToLogFile().

◆ KdpDebugBuffer

PCHAR KdpDebugBuffer = NULL
static

Definition at line 21 of file kdio.c.

Referenced by KdpDebugLogInit(), KdpLoggerThread(), and KdpPrintToLogFile().

◆ KdpDebugLogSpinLock

KSPIN_LOCK KdpDebugLogSpinLock
static

Definition at line 24 of file kdio.c.

Referenced by KdpDebugLogInit(), and KdpPrintToLogFile().

◆ KdpDmesgBuffer

PCHAR KdpDmesgBuffer = NULL

Definition at line 41 of file kdio.c.

Referenced by KdbpCmdDmesg(), KdpScreenInit(), and KdpScreenPrint().

◆ KdpDmesgBufferSize

const ULONG KdpDmesgBufferSize = 128 * 1024

Definition at line 40 of file kdio.c.

Referenced by KdbpCmdDmesg(), KdpScreenInit(), and KdpScreenPrint().

◆ KdpDmesgCurrentPosition

volatile ULONG KdpDmesgCurrentPosition = 0

Definition at line 42 of file kdio.c.

Referenced by KdbpCmdDmesg(), and KdpScreenPrint().

◆ KdpDmesgFreeBytes

volatile ULONG KdpDmesgFreeBytes = 0

Definition at line 43 of file kdio.c.

Referenced by KdbpCmdDmesg(), KdpScreenInit(), and KdpScreenPrint().

◆ KdpDmesgLogSpinLock

KSPIN_LOCK KdpDmesgLogSpinLock
static

Definition at line 46 of file kdio.c.

Referenced by KdpScreenInit(), and KdpScreenPrint().

◆ KdpFreeBytes

volatile ULONG KdpFreeBytes = 0
static

Definition at line 23 of file kdio.c.

Referenced by KdpDebugLogInit(), KdpLoggerThread(), and KdpPrintToLogFile().

◆ KdpLogFileHandle

HANDLE KdpLogFileHandle
static

Definition at line 26 of file kdio.c.

Referenced by KdpDebugLogInit(), and KdpLoggerThread().

◆ KdpLogFileName

ANSI_STRING KdpLogFileName = RTL_CONSTANT_STRING("\\SystemRoot\\debug.log")

Definition at line 27 of file kdio.c.

Referenced by KdpDebugLogInit(), and KdpGetDebugMode().

◆ KdpLoggerThreadEvent

KEVENT KdpLoggerThreadEvent
static

Definition at line 25 of file kdio.c.

Referenced by KdpDebugLogInit(), KdpLoggerThread(), and KdpPrintToLogFile().

◆ KdpLoggingEnabled

BOOLEAN KdpLoggingEnabled = FALSE
static

Definition at line 20 of file kdio.c.

Referenced by KdpLoggerThread(), and KdpPrintToLogFile().

◆ KdpPort

ULONG KdpPort

Definition at line 34 of file kdio.c.

Referenced by KdpGetDebugMode().

◆ KdpScreenLineBuffer

CHAR KdpScreenLineBuffer[KdpScreenLineLengthDefault+1] = ""
static

Definition at line 37 of file kdio.c.

Referenced by KdpScreenPrint().

◆ KdpScreenLineBufferPos

ULONG KdpScreenLineBufferPos = 0
static

Definition at line 38 of file kdio.c.

Referenced by KdpScreenPrint().

◆ KdpScreenLineLength

ULONG KdpScreenLineLength = 0
static

Definition at line 38 of file kdio.c.

Referenced by KdpScreenPrint().

◆ KdpSerialSpinLock

KSPIN_LOCK KdpSerialSpinLock
static

Definition at line 29 of file kdio.c.

Referenced by KdpPromptString(), KdpSerialDebugPrint(), and KdpSerialInit().

◆ SerialPortInfo

CPPORT SerialPortInfo = {0, DEFAULT_DEBUG_BAUD_RATE, 0}

◆ SerialPortNumber

ULONG SerialPortNumber = DEFAULT_DEBUG_PORT

Definition at line 30 of file kdio.c.

Referenced by KdpGetDebugMode(), and KdpSerialInit().