mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[NTOSKRNL]
- Do not repeat messages into serial port even when using other debug methods. - Allow to specify debug log file name. - When using the "Screen" method, show blue screen when entering KDB. - Disable the repetition of previous KDB command with long many-page output. [USETUP] - Add "ReactOS (Screen)" entry to boot menu. svn path=/trunk/; revision=54468
This commit is contained in:
parent
34f3db310e
commit
b7f9a4b528
9 changed files with 153 additions and 97 deletions
|
@ -486,6 +486,12 @@ CreateFreeLoaderIniForReactos(
|
|||
L"/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /KDSERIAL");
|
||||
#endif
|
||||
|
||||
/* ReactOS_Screen */
|
||||
CreateFreeLoaderEntry(IniCache, IniSection,
|
||||
L"ReactOS_Screen", L"\"ReactOS (Screen)\"",
|
||||
L"Windows2003", ArcPath,
|
||||
L"/DEBUG /DEBUGPORT=SCREEN /SOS");
|
||||
|
||||
/* ReactOS_LogFile */
|
||||
CreateFreeLoaderEntry(IniCache, IniSection,
|
||||
L"ReactOS_LogFile", L"\"ReactOS (Log file)\"",
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
[autorun]
|
||||
|
||||
open=reactos\welcome.exe
|
||||
icon=icon.ico
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[FREELOADER]
|
||||
DefaultOS=Setup
|
||||
Timeout=0
|
||||
TimeOut=0
|
||||
|
||||
[Display]
|
||||
TitleText=ReactOS Setup
|
||||
|
@ -29,4 +29,3 @@ Setup="Setup"
|
|||
|
||||
[Setup]
|
||||
BootType=ReactOSSetup
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
[FREELOADER]
|
||||
DefaultOS=ReactOS
|
||||
Timeout=1
|
||||
DefaultOS=LiveCD_Debug
|
||||
TimeOut=3
|
||||
|
||||
[Display]
|
||||
TitleText=ReactOS Boot Manager
|
||||
TitleText=ReactOS LiveCD
|
||||
StatusBarColor=Cyan
|
||||
StatusBarTextColor=Black
|
||||
BackdropTextColor=White
|
||||
|
@ -13,16 +13,39 @@ TitleBoxTextColor=White
|
|||
TitleBoxColor=Red
|
||||
MessageBoxTextColor=White
|
||||
MessageBoxColor=Blue
|
||||
MenuTextColor=White
|
||||
MenuColor=Blue
|
||||
TextColor=Yellow
|
||||
MenuTextColor=Gray
|
||||
MenuColor=Black
|
||||
TextColor=Gray
|
||||
SelectedTextColor=Black
|
||||
SelectedColor=Gray
|
||||
ShowTime=No
|
||||
MenuBox=No
|
||||
CenterMenu=No
|
||||
MinimalUI=Yes
|
||||
TimeText=Seconds until highlighted choice will be started automatically:
|
||||
|
||||
[Operating Systems]
|
||||
ReactOS="ReactOS"
|
||||
LiveCD="LiveCD"
|
||||
LiveCD_Debug="LiveCD (Debug)"
|
||||
LiveCD_Screen="LiveCD (Screen)"
|
||||
LiveCD_LogFile="LiveCD (Log file)"
|
||||
|
||||
[ReactOS]
|
||||
[LiveCD]
|
||||
BootType=Windows2003
|
||||
SystemPath=LiveCD\reactos
|
||||
Options=/DEBUGPORT=COM1 /SOS /MININT
|
||||
Options=/MININT
|
||||
|
||||
[LiveCD_Debug]
|
||||
BootType=Windows2003
|
||||
SystemPath=LiveCD\reactos
|
||||
Options=/DEBUG /DEBUGPORT=COM1 /BAUDRATE=115200 /SOS /MININT
|
||||
|
||||
[LiveCD_Screen]
|
||||
BootType=Windows2003
|
||||
SystemPath=LiveCD\reactos
|
||||
Options=/DEBUG /DEBUGPORT=SCREEN /SOS /MININT
|
||||
|
||||
[LiveCD_LogFile]
|
||||
BootType=Windows2003
|
||||
SystemPath=LiveCD\reactos
|
||||
Options=/DEBUG /DEBUGPORT=FILE:\Device\HarddiskX\PartitionY\debug.log /SOS /MININT
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
# Example KDB.init file
|
||||
#
|
||||
#
|
||||
|
||||
# Set the disassembly flavor to "intel" (default is "at&t")
|
||||
set syntax intel
|
||||
|
|
|
@ -40,6 +40,8 @@ PKDP_INIT_ROUTINE InitRoutines[KdMax] = {KdpScreenInit,
|
|||
KdpBochsInit,
|
||||
KdpKdbgInit};
|
||||
|
||||
extern ANSI_STRING KdpLogFileName;
|
||||
|
||||
/* PRIVATE FUNCTIONS *********************************************************/
|
||||
|
||||
PCHAR
|
||||
|
@ -47,7 +49,7 @@ NTAPI
|
|||
INIT_FUNCTION
|
||||
KdpGetDebugMode(PCHAR Currentp2)
|
||||
{
|
||||
PCHAR p2 = Currentp2;
|
||||
PCHAR p1, p2 = Currentp2;
|
||||
ULONG Value;
|
||||
|
||||
/* Check for Screen Debugging */
|
||||
|
@ -73,12 +75,21 @@ KdpGetDebugMode(PCHAR Currentp2)
|
|||
KdpPort = Value;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for Debug Log Debugging */
|
||||
else if (!_strnicmp(p2, "FILE", 4))
|
||||
{
|
||||
/* Enable It */
|
||||
p2 += 4;
|
||||
KdpDebugMode.File = TRUE;
|
||||
if (*p2 == ':')
|
||||
{
|
||||
p2++;
|
||||
p1 = p2;
|
||||
while (*p2 != '\0' && *p2 != ' ') p2++;
|
||||
KdpLogFileName.MaximumLength = KdpLogFileName.Length = p2 - p1;
|
||||
KdpLogFileName.Buffer = p1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for BOCHS Debugging */
|
||||
|
@ -171,11 +182,9 @@ KdInitSystem(ULONG BootPhase,
|
|||
else if (strstr(CommandLine, "CRASHDEBUG")) KdDebuggerEnabled = FALSE;
|
||||
else if (strstr(CommandLine, "DEBUG"))
|
||||
{
|
||||
/* Enable on the serial port */
|
||||
/* Enable the kernel debugger */
|
||||
KdDebuggerEnabled = TRUE;
|
||||
KdDebuggerNotPresent = FALSE;
|
||||
KdpDebugMode.Serial = TRUE;
|
||||
|
||||
#ifdef KDBG
|
||||
/* Get the KDBG Settings */
|
||||
KdbpGetCommandLineSettings(LoaderBlock->LoadOptions);
|
||||
|
@ -202,6 +211,10 @@ KdInitSystem(ULONG BootPhase,
|
|||
Port = strstr(Port, "DEBUGPORT");
|
||||
}
|
||||
|
||||
/* Use serial port then */
|
||||
if (KdDebuggerEnabled && KdpDebugMode.Value == 0)
|
||||
KdpDebugMode.Serial = TRUE;
|
||||
|
||||
/* Check if we got a baud rate */
|
||||
if (BaudRate)
|
||||
{
|
||||
|
|
|
@ -23,6 +23,7 @@ volatile ULONG KdpFreeBytes = 0;
|
|||
KSPIN_LOCK KdpDebugLogSpinLock;
|
||||
KEVENT KdpLoggerThreadEvent;
|
||||
HANDLE KdpLogFileHandle;
|
||||
ANSI_STRING KdpLogFileName = RTL_CONSTANT_STRING("\\SystemRoot\\debug.log");
|
||||
|
||||
KSPIN_LOCK KdpSerialSpinLock;
|
||||
KD_PORT_INFORMATION SerialPortInfo = { DEFAULT_DEBUG_PORT, DEFAULT_DEBUG_BAUD_RATE, 0 };
|
||||
|
@ -201,7 +202,9 @@ KdpInitDebugLog(PKD_DISPATCH_TABLE DispatchTable,
|
|||
else if (BootPhase == 3)
|
||||
{
|
||||
/* Setup the log name */
|
||||
RtlInitUnicodeString(&FileName, L"\\SystemRoot\\debug.log");
|
||||
Status = RtlAnsiStringToUnicodeString(&FileName, &KdpLogFileName, TRUE);
|
||||
if (!NT_SUCCESS(Status)) return;
|
||||
|
||||
InitializeObjectAttributes(&ObjectAttributes,
|
||||
&FileName,
|
||||
0,
|
||||
|
@ -221,6 +224,8 @@ KdpInitDebugLog(PKD_DISPATCH_TABLE DispatchTable,
|
|||
NULL,
|
||||
0);
|
||||
|
||||
RtlFreeUnicodeString(&FileName);
|
||||
|
||||
if (!NT_SUCCESS(Status)) return;
|
||||
|
||||
KeInitializeEvent(&KdpLoggerThreadEvent, SynchronizationEvent, TRUE);
|
||||
|
|
|
@ -127,12 +127,6 @@ KiEspToTrapFrame(
|
|||
IN PKTRAP_FRAME TrapFrame,
|
||||
IN ULONG Esp);
|
||||
|
||||
/* ROS Internal. Please deprecate */
|
||||
NTHALAPI
|
||||
VOID
|
||||
NTAPI
|
||||
HalReleaseDisplayOwnership();
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
static VOID
|
||||
|
@ -1247,9 +1241,21 @@ KdbpInternalEnter()
|
|||
ULONG SavedStackLimit;
|
||||
|
||||
KbdDisableMouse();
|
||||
if (KdpDebugMode.Screen)
|
||||
|
||||
if (KdpDebugMode.Screen &&
|
||||
InbvIsBootDriverInstalled() &&
|
||||
!InbvCheckDisplayOwnership())
|
||||
{
|
||||
/* Acquire ownership and reset the display */
|
||||
InbvAcquireDisplayOwnership();
|
||||
InbvResetDisplay();
|
||||
|
||||
/* Display blue screen */
|
||||
InbvSolidColorFill(0, 0, 639, 479, 6);
|
||||
InbvSetTextColor(15);
|
||||
InbvInstallDisplayStringFilter(NULL);
|
||||
InbvEnableDisplayString(TRUE);
|
||||
InbvSetScrollRegion(0, 0, 639, 479);
|
||||
}
|
||||
|
||||
/* Call the interface's main loop on a different stack */
|
||||
|
|
|
@ -107,6 +107,7 @@ static LONG KdbCommandHistoryIndex = 0;
|
|||
static ULONG KdbNumberOfRowsPrinted = 0;
|
||||
static ULONG KdbNumberOfColsPrinted = 0;
|
||||
static BOOLEAN KdbOutputAborted = FALSE;
|
||||
static BOOLEAN KdbRepeatLastCommand = FALSE;
|
||||
static LONG KdbNumberOfRowsTerminal = -1;
|
||||
static LONG KdbNumberOfColsTerminal = -1;
|
||||
|
||||
|
@ -2469,6 +2470,8 @@ KdbpPrint(
|
|||
if (KdbNumberOfRowsTerminal > 0 &&
|
||||
(LONG)(KdbNumberOfRowsPrinted + RowsPrintedByTerminal) >= KdbNumberOfRowsTerminal)
|
||||
{
|
||||
KdbRepeatLastCommand = FALSE;
|
||||
|
||||
if (KdbNumberOfColsPrinted > 0)
|
||||
DbgPrint("\n");
|
||||
|
||||
|
@ -2789,6 +2792,8 @@ KdbpPager(
|
|||
if (KdbNumberOfRowsTerminal > 0 &&
|
||||
(LONG)(KdbNumberOfRowsPrinted + RowsPrintedByTerminal) >= KdbNumberOfRowsTerminal)
|
||||
{
|
||||
KdbRepeatLastCommand = FALSE;
|
||||
|
||||
if (KdbNumberOfColsPrinted > 0)
|
||||
DbgPrint("\n");
|
||||
|
||||
|
@ -2987,7 +2992,7 @@ KdbpReadCommand(
|
|||
PCHAR Orig = Buffer;
|
||||
ULONG ScanCode = 0;
|
||||
BOOLEAN EchoOn;
|
||||
static CHAR LastCommand[1024] = "";
|
||||
static CHAR LastCommand[1024];
|
||||
static CHAR NextKey = '\0';
|
||||
INT CmdHistIndex = -1;
|
||||
INT i;
|
||||
|
@ -3059,15 +3064,16 @@ KdbpReadCommand(
|
|||
* Repeat the last command if the user presses enter. Reduces the
|
||||
* risk of RSI when single-stepping.
|
||||
*/
|
||||
if (Buffer == Orig)
|
||||
if (Buffer != Orig)
|
||||
{
|
||||
RtlStringCbCopyA(Buffer, Size, LastCommand);
|
||||
}
|
||||
else
|
||||
{
|
||||
*Buffer = '\0';
|
||||
KdbRepeatLastCommand = TRUE;
|
||||
RtlStringCbCopyA(LastCommand, sizeof(LastCommand), Orig);
|
||||
*Buffer = '\0';
|
||||
}
|
||||
else if (KdbRepeatLastCommand)
|
||||
RtlStringCbCopyA(Buffer, Size, LastCommand);
|
||||
else
|
||||
*Buffer = '\0';
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue