mirror of
https://github.com/reactos/reactos.git
synced 2025-01-07 14:51:00 +00:00
[NTOSKRNL|KDCOM]
Allow to specify the serial port address, as requested by people on the forum. svn path=/trunk/; revision=54473
This commit is contained in:
parent
2ffaaef5e6
commit
4ce30245de
2 changed files with 39 additions and 17 deletions
|
@ -258,19 +258,27 @@ KdPortInitializeEx(
|
|||
if (PortInformation->BaudRate == 0)
|
||||
PortInformation->BaudRate = DEFAULT_BAUD_RATE;
|
||||
|
||||
if (PortInformation->ComPort == 0)
|
||||
return FALSE;
|
||||
|
||||
if (!KdpDoesComPortExist(BaseArray[PortInformation->ComPort]))
|
||||
if (PortInformation->ComPort != 0)
|
||||
{
|
||||
sprintf(buffer,
|
||||
"\nKernel Debugger: Serial port not found!\n\n");
|
||||
HalDisplayString(buffer);
|
||||
return FALSE;
|
||||
if (!KdpDoesComPortExist(BaseArray[PortInformation->ComPort]))
|
||||
{
|
||||
sprintf(buffer,
|
||||
"\nKernel Debugger: Serial port not found!\n\n");
|
||||
HalDisplayString(buffer);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ComPortBase = BaseArray[PortInformation->ComPort];
|
||||
PortInformation->BaseAddress = ComPortBase;
|
||||
}
|
||||
else
|
||||
{
|
||||
ComPortBase = PortInformation->BaseAddress;
|
||||
}
|
||||
|
||||
ComPortBase = BaseArray[PortInformation->ComPort];
|
||||
PortInformation->BaseAddress = ComPortBase;
|
||||
if (ComPortBase == 0)
|
||||
return FALSE;
|
||||
|
||||
#ifndef NDEBUG
|
||||
sprintf(buffer,
|
||||
"\nSerial port COM%ld found at 0x%lx\n",
|
||||
|
|
|
@ -64,15 +64,29 @@ KdpGetDebugMode(PCHAR Currentp2)
|
|||
{
|
||||
/* Gheck for a valid Serial Port */
|
||||
p2 += 3;
|
||||
Value = (ULONG)atol(p2);
|
||||
if (Value > 0 && Value < 5)
|
||||
if (*p2 != ':')
|
||||
{
|
||||
/* Valid port found, enable Serial Debugging */
|
||||
KdpDebugMode.Serial = TRUE;
|
||||
Value = (ULONG)atol(p2);
|
||||
if (Value > 0 && Value < 5)
|
||||
{
|
||||
/* Valid port found, enable Serial Debugging */
|
||||
KdpDebugMode.Serial = TRUE;
|
||||
|
||||
/* Set the port to use */
|
||||
SerialPortInfo.ComPort = Value;
|
||||
KdpPort = Value;
|
||||
/* Set the port to use */
|
||||
SerialPortInfo.ComPort = Value;
|
||||
KdpPort = Value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Value = strtoul(p2 + 1, NULL, 0);
|
||||
if (Value)
|
||||
{
|
||||
KdpDebugMode.Serial = TRUE;
|
||||
SerialPortInfo.BaseAddress = Value;
|
||||
SerialPortInfo.ComPort = 0;
|
||||
KdpPort = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue