Cross commits from the release branch. Serial echo option + local keyboard

mouse on/off.

svn path=/trunk/; revision=7723
This commit is contained in:
Art Yerkes 2004-01-17 17:13:13 +00:00
parent 83da931554
commit 5405cd7d70
3 changed files with 42 additions and 4 deletions

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: kdb.c,v 1.16 2004/01/13 03:23:11 arty Exp $
/* $Id: kdb.c,v 1.17 2004/01/17 17:13:13 arty Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/dbg/kdb.c
@ -47,11 +47,15 @@
#define BS 8
#define DEL 127
BOOL KbdEchoOn = TRUE;
int isalpha( int );
VOID
PsDumpThreads(BOOLEAN System);
ULONG
DbgContCommand(ULONG Argc, PCH Argv[], PKTRAP_FRAME Tf);
ULONG
DbgEchoToggle(ULONG Argc, PCH Argv[], PKTRAP_FRAME Tf);
ULONG
DbgRegsCommand(ULONG Argc, PCH Argv[], PKTRAP_FRAME Tf);
ULONG
@ -89,6 +93,7 @@ struct
ULONG (*Fn)(ULONG Argc, PCH Argv[], PKTRAP_FRAME Tf);
} DebuggerCommands[] = {
{"cont", "cont", "Exit the debugger", DbgContCommand},
{"echo", "echo", "Toggle serial echo", DbgEchoToggle},
{"regs", "regs", "Display general purpose registers", DbgRegsCommand},
{"dregs", "dregs", "Display debug registers", DbgDRegsCommand},
{"cregs", "cregs", "Display control registers", DbgCRegsCommand},
@ -221,12 +226,16 @@ KdbGetCommand(PCH Buffer)
{
Buffer--;
*Buffer = 0;
DbgPrint("%c %c", BS, BS);
if (KbdEchoOn)
DbgPrint("%c %c", BS, BS);
else
DbgPrint(" %c", BS);
}
}
else
{
DbgPrint("%c", Key);
if (KbdEchoOn)
DbgPrint("%c", Key);
*Buffer = Key;
Buffer++;
@ -716,6 +725,13 @@ DbgContCommand(ULONG Argc, PCH Argv[], PKTRAP_FRAME Tf)
return(0);
}
ULONG
DbgEchoToggle(ULONG Argc, PCH Argv[], PKTRAP_FRAME Tf)
{
KbdEchoOn = !KbdEchoOn;
return(TRUE);
}
VOID
DbgPrintEflags(ULONG Eflags)
{
@ -975,7 +991,9 @@ VOID
KdbInternalEnter(PKTRAP_FRAME Tf)
{
__asm__ __volatile__ ("cli\n\t");
KbdDisableMouse();
(VOID)KdbMainLoop(Tf);
KbdEnableMouse();
__asm__ __volatile__("sti\n\t");
}

View file

@ -40,8 +40,12 @@
#define KBD_CNTL_REG 0x64
#define KBD_DATA_REG 0x60
#define KBD_DISABLE_MOUSE 0xA7
#define KBD_ENABLE_MOUSE 0xA8
#define KBD_STAT_OBF 0x01 /* Keyboard output buffer full */
#define kbd_write_command(cmd) WRITE_PORT_UCHAR((PUCHAR)KBD_STATUS_REG,cmd)
#define kbd_read_input() READ_PORT_UCHAR((PUCHAR)KBD_DATA_REG)
#define kbd_read_status() READ_PORT_UCHAR((PUCHAR)KBD_STATUS_REG)
@ -66,6 +70,16 @@ static unsigned char keyb_layout[2][128] =
typedef BYTE byte_t;
VOID KbdEnableMouse()
{
kbd_write_command(KBD_ENABLE_MOUSE);
}
VOID KbdDisableMouse()
{
kbd_write_command(KBD_DISABLE_MOUSE);
}
CHAR
KdbTryGetCharKeyboard()
{

View file

@ -1,4 +1,4 @@
/* $Id: kd.h,v 1.21 2004/01/13 03:23:11 arty Exp $
/* $Id: kd.h,v 1.22 2004/01/17 17:13:13 arty Exp $
*
* kernel debugger prototypes
*/
@ -32,6 +32,12 @@ typedef enum _KD_CONTINUE_TYPE
kdHandleException
} KD_CONTINUE_TYPE;
VOID
KbdDisableMouse();
VOID
KbdEnableMouse();
ULONG
KdpPrintString (PANSI_STRING String);