reactos/ntoskrnl/kd/kdserial.c
Hermès Bélusca-Maïto 430d7ebb93
[NTOS:KDBG] Use KdbpSendCommandSerial() to send specific ANSI escape sequences.
Use this function instead of KdpDprintf(), otherwise, we send them to
**ALL** the display providers, including for example dmesg. Replaying
the listing with dmesg would then cause the terminal to misbehave later.
For example, it would send the answer of a "Query Device Attributes"
command, as the response to a query for terminal size...
2023-03-28 16:14:39 +02:00

37 lines
919 B
C

/*
* PROJECT: ReactOS KDBG Kernel Debugger Terminal Driver
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
* PURPOSE: Serial driver
* COPYRIGHT: Copyright 2004 Art Yerkes <ayerkes@speakeasy.net>
* Copyright 2005 Gregor Anich <blight@blight.eu.org>
*/
/* INCLUDES ******************************************************************/
#include <ntoskrnl.h>
#include "kd.h"
/* FUNCTIONS *****************************************************************/
VOID
KdbpSendCommandSerial(
_In_ PCSTR Command)
{
while (*Command)
KdPortPutByteEx(&SerialPortInfo, *Command++);
}
CHAR
KdbpTryGetCharSerial(
_In_ ULONG Retry)
{
CHAR Result = -1;
if (Retry == 0)
while (!KdPortGetByteEx(&SerialPortInfo, (PUCHAR)&Result));
else
while (!KdPortGetByteEx(&SerialPortInfo, (PUCHAR)&Result) && Retry-- > 0);
return Result;
}