Author: dgorbachev Date: Mon Nov 21 05:28:08 2011 New Revision: 54468
URL: http://svn.reactos.org/svn/reactos?rev=54468&view=rev Log: [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.
Modified: trunk/reactos/base/setup/usetup/bootsup.c trunk/reactos/boot/bootdata/autorun.inf (contents, props changed) trunk/reactos/boot/bootdata/bootcd.ini (contents, props changed) trunk/reactos/boot/bootdata/livecd.ini (contents, props changed) trunk/reactos/media/drivers/etc/KDBinit (contents, props changed) trunk/reactos/media/drivers/etc/hosts (props changed) trunk/reactos/ntoskrnl/kd/kdinit.c trunk/reactos/ntoskrnl/kd/kdio.c trunk/reactos/ntoskrnl/kdbg/kdb.c trunk/reactos/ntoskrnl/kdbg/kdb_cli.c
Modified: trunk/reactos/base/setup/usetup/bootsup.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/bootsup.c... ============================================================================== --- trunk/reactos/base/setup/usetup/bootsup.c [iso-8859-1] (original) +++ trunk/reactos/base/setup/usetup/bootsup.c [iso-8859-1] Mon Nov 21 05:28:08 2011 @@ -486,6 +486,12 @@ 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)"",
Modified: trunk/reactos/boot/bootdata/autorun.inf URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/autorun.inf?r... ============================================================================== --- trunk/reactos/boot/bootdata/autorun.inf [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/autorun.inf [iso-8859-1] Mon Nov 21 05:28:08 2011 @@ -1,4 +1,3 @@ -[autorun] - -open=reactos\welcome.exe -icon=icon.ico +[autorun] +open=reactos\welcome.exe +icon=icon.ico
Propchange: trunk/reactos/boot/bootdata/autorun.inf ------------------------------------------------------------------------------ --- svn:eol-style (original) +++ svn:eol-style Mon Nov 21 05:28:08 2011 @@ -1,1 +1,1 @@ -native +CRLF
Modified: trunk/reactos/boot/bootdata/bootcd.ini URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/bootcd.ini?re... ============================================================================== --- trunk/reactos/boot/bootdata/bootcd.ini [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/bootcd.ini [iso-8859-1] Mon Nov 21 05:28:08 2011 @@ -1,32 +1,31 @@ -[FREELOADER] -DefaultOS=Setup -Timeout=0 - -[Display] -TitleText=ReactOS Setup -StatusBarColor=Cyan -StatusBarTextColor=Black -BackdropTextColor=White -BackdropColor=Blue -BackdropFillStyle=Medium -TitleBoxTextColor=White -TitleBoxColor=Red -MessageBoxTextColor=White -MessageBoxColor=Blue -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] -Setup="Setup" - -[Setup] -BootType=ReactOSSetup - +[FREELOADER] +DefaultOS=Setup +TimeOut=0 + +[Display] +TitleText=ReactOS Setup +StatusBarColor=Cyan +StatusBarTextColor=Black +BackdropTextColor=White +BackdropColor=Blue +BackdropFillStyle=Medium +TitleBoxTextColor=White +TitleBoxColor=Red +MessageBoxTextColor=White +MessageBoxColor=Blue +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] +Setup="Setup" + +[Setup] +BootType=ReactOSSetup
Propchange: trunk/reactos/boot/bootdata/bootcd.ini ------------------------------------------------------------------------------ --- svn:eol-style (original) +++ svn:eol-style Mon Nov 21 05:28:08 2011 @@ -1,1 +1,1 @@ -native +CRLF
Modified: trunk/reactos/boot/bootdata/livecd.ini URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/livecd.ini?re... ============================================================================== --- trunk/reactos/boot/bootdata/livecd.ini [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/livecd.ini [iso-8859-1] Mon Nov 21 05:28:08 2011 @@ -1,28 +1,51 @@ -[FREELOADER] -DefaultOS=ReactOS -Timeout=1 - -[Display] -TitleText=ReactOS Boot Manager -StatusBarColor=Cyan -StatusBarTextColor=Black -BackdropTextColor=White -BackdropColor=Blue -BackdropFillStyle=Medium -TitleBoxTextColor=White -TitleBoxColor=Red -MessageBoxTextColor=White -MessageBoxColor=Blue -MenuTextColor=White -MenuColor=Blue -TextColor=Yellow -SelectedTextColor=Black -SelectedColor=Gray - -[Operating Systems] -ReactOS="ReactOS" - -[ReactOS] -BootType=Windows2003 -SystemPath=LiveCD\reactos -Options=/DEBUGPORT=COM1 /SOS /MININT +[FREELOADER] +DefaultOS=LiveCD_Debug +TimeOut=3 + +[Display] +TitleText=ReactOS LiveCD +StatusBarColor=Cyan +StatusBarTextColor=Black +BackdropTextColor=White +BackdropColor=Blue +BackdropFillStyle=Medium +TitleBoxTextColor=White +TitleBoxColor=Red +MessageBoxTextColor=White +MessageBoxColor=Blue +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] +LiveCD="LiveCD" +LiveCD_Debug="LiveCD (Debug)" +LiveCD_Screen="LiveCD (Screen)" +LiveCD_LogFile="LiveCD (Log file)" + +[LiveCD] +BootType=Windows2003 +SystemPath=LiveCD\reactos +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
Propchange: trunk/reactos/boot/bootdata/livecd.ini ------------------------------------------------------------------------------ --- svn:eol-style (original) +++ svn:eol-style Mon Nov 21 05:28:08 2011 @@ -1,1 +1,1 @@ -native +CRLF
Modified: trunk/reactos/media/drivers/etc/KDBinit URL: http://svn.reactos.org/svn/reactos/trunk/reactos/media/drivers/etc/KDBinit?r... ============================================================================== --- trunk/reactos/media/drivers/etc/KDBinit [iso-8859-1] (original) +++ trunk/reactos/media/drivers/etc/KDBinit [iso-8859-1] Mon Nov 21 05:28:08 2011 @@ -1,14 +1,13 @@ -# Example KDB.init file -# -# - -# Set the disassembly flavor to "intel" (default is "at&t") -set syntax intel - -# Change the condition to enter KDB on INT3 to "always" (default is "kmode") -# set condition INT3 first always - -# This is a special command available only in the KDBinit file - it breaks into -# KDB when it is interpreting the init file at startup. -#break - +# Example KDB.init file +# + +# Set the disassembly flavor to "intel" (default is "at&t") +set syntax intel + +# Change the condition to enter KDB on INT3 to "always" (default is "kmode") +#set condition INT3 first always + +# This is a special command available only in the KDBinit file - it breaks into +# KDB when it is interpreting the init file at startup. +#break +
Propchange: trunk/reactos/media/drivers/etc/KDBinit ------------------------------------------------------------------------------ --- svn:eol-style (original) +++ svn:eol-style Mon Nov 21 05:28:08 2011 @@ -1,1 +1,1 @@ -native +CRLF
Propchange: trunk/reactos/media/drivers/etc/hosts ------------------------------------------------------------------------------ svn:eol-style = CRLF
Modified: trunk/reactos/ntoskrnl/kd/kdinit.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd/kdinit.c?rev=54... ============================================================================== --- trunk/reactos/ntoskrnl/kd/kdinit.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/kd/kdinit.c [iso-8859-1] Mon Nov 21 05:28:08 2011 @@ -40,6 +40,8 @@ KdpBochsInit, KdpKdbgInit};
+extern ANSI_STRING KdpLogFileName; + /* PRIVATE FUNCTIONS *********************************************************/
PCHAR @@ -47,7 +49,7 @@ INIT_FUNCTION KdpGetDebugMode(PCHAR Currentp2) { - PCHAR p2 = Currentp2; + PCHAR p1, p2 = Currentp2; ULONG Value;
/* Check for Screen Debugging */ @@ -73,12 +75,21 @@ 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 @@ 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); @@ -201,6 +210,10 @@ Port = KdpGetDebugMode(Port); 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)
Modified: trunk/reactos/ntoskrnl/kd/kdio.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd/kdio.c?rev=5446... ============================================================================== --- trunk/reactos/ntoskrnl/kd/kdio.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/kd/kdio.c [iso-8859-1] Mon Nov 21 05:28:08 2011 @@ -23,6 +23,7 @@ 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 @@ 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 @@ NULL, 0);
+ RtlFreeUnicodeString(&FileName); + if (!NT_SUCCESS(Status)) return;
KeInitializeEvent(&KdpLoggerThreadEvent, SynchronizationEvent, TRUE);
Modified: trunk/reactos/ntoskrnl/kdbg/kdb.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kdbg/kdb.c?rev=544... ============================================================================== --- trunk/reactos/ntoskrnl/kdbg/kdb.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/kdbg/kdb.c [iso-8859-1] Mon Nov 21 05:28:08 2011 @@ -127,12 +127,6 @@ IN PKTRAP_FRAME TrapFrame, IN ULONG Esp);
-/* ROS Internal. Please deprecate */ -NTHALAPI -VOID -NTAPI -HalReleaseDisplayOwnership(); - /* FUNCTIONS *****************************************************************/
static VOID @@ -1247,9 +1241,21 @@ 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 */
Modified: trunk/reactos/ntoskrnl/kdbg/kdb_cli.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kdbg/kdb_cli.c?rev... ============================================================================== --- trunk/reactos/ntoskrnl/kdbg/kdb_cli.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/kdbg/kdb_cli.c [iso-8859-1] Mon Nov 21 05:28:08 2011 @@ -107,6 +107,7 @@ 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 @@ if (KdbNumberOfRowsTerminal > 0 && (LONG)(KdbNumberOfRowsPrinted + RowsPrintedByTerminal) >= KdbNumberOfRowsTerminal) { + KdbRepeatLastCommand = FALSE; + if (KdbNumberOfColsPrinted > 0) DbgPrint("\n");
@@ -2789,6 +2792,8 @@ if (KdbNumberOfRowsTerminal > 0 && (LONG)(KdbNumberOfRowsPrinted + RowsPrintedByTerminal) >= KdbNumberOfRowsTerminal) { + KdbRepeatLastCommand = FALSE; + if (KdbNumberOfColsPrinted > 0) DbgPrint("\n");
@@ -2987,7 +2992,7 @@ 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 @@ * Repeat the last command if the user presses enter. Reduces the * risk of RSI when single-stepping. */ - if (Buffer == Orig) - { + if (Buffer != Orig) + { + KdbRepeatLastCommand = TRUE; + RtlStringCbCopyA(LastCommand, sizeof(LastCommand), Orig); + *Buffer = '\0'; + } + else if (KdbRepeatLastCommand) RtlStringCbCopyA(Buffer, Size, LastCommand); - } else - { *Buffer = '\0'; - RtlStringCbCopyA(LastCommand, sizeof(LastCommand), Orig); - }
return; }