[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:
Dmitry Gorbachev
2011-11-22 02:30:16 +00:00
parent 2ffaaef5e6
commit 4ce30245de
2 changed files with 39 additions and 17 deletions
+18 -10
View File
@@ -258,19 +258,27 @@ KdPortInitializeEx(
if (PortInformation->BaudRate == 0) if (PortInformation->BaudRate == 0)
PortInformation->BaudRate = DEFAULT_BAUD_RATE; PortInformation->BaudRate = DEFAULT_BAUD_RATE;
if (PortInformation->ComPort == 0) if (PortInformation->ComPort != 0)
return FALSE;
if (!KdpDoesComPortExist(BaseArray[PortInformation->ComPort]))
{ {
sprintf(buffer, if (!KdpDoesComPortExist(BaseArray[PortInformation->ComPort]))
"\nKernel Debugger: Serial port not found!\n\n"); {
HalDisplayString(buffer); sprintf(buffer,
return FALSE; "\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]; if (ComPortBase == 0)
PortInformation->BaseAddress = ComPortBase; return FALSE;
#ifndef NDEBUG #ifndef NDEBUG
sprintf(buffer, sprintf(buffer,
"\nSerial port COM%ld found at 0x%lx\n", "\nSerial port COM%ld found at 0x%lx\n",
+21 -7
View File
@@ -64,15 +64,29 @@ KdpGetDebugMode(PCHAR Currentp2)
{ {
/* Gheck for a valid Serial Port */ /* Gheck for a valid Serial Port */
p2 += 3; p2 += 3;
Value = (ULONG)atol(p2); if (*p2 != ':')
if (Value > 0 && Value < 5)
{ {
/* Valid port found, enable Serial Debugging */ Value = (ULONG)atol(p2);
KdpDebugMode.Serial = TRUE; if (Value > 0 && Value < 5)
{
/* Valid port found, enable Serial Debugging */
KdpDebugMode.Serial = TRUE;
/* Set the port to use */ /* Set the port to use */
SerialPortInfo.ComPort = Value; SerialPortInfo.ComPort = Value;
KdpPort = Value; KdpPort = Value;
}
}
else
{
Value = strtoul(p2 + 1, NULL, 0);
if (Value)
{
KdpDebugMode.Serial = TRUE;
SerialPortInfo.BaseAddress = Value;
SerialPortInfo.ComPort = 0;
KdpPort = 0;
}
} }
} }