diff --git a/reactos/ntoskrnl/dbg/kdb.c b/reactos/ntoskrnl/dbg/kdb.c index ab90f07046e..4e5fb149c3e 100644 --- a/reactos/ntoskrnl/dbg/kdb.c +++ b/reactos/ntoskrnl/dbg/kdb.c @@ -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"); } diff --git a/reactos/ntoskrnl/dbg/kdb_keyboard.c b/reactos/ntoskrnl/dbg/kdb_keyboard.c index 087dc4a8a4c..32be10e7aa6 100644 --- a/reactos/ntoskrnl/dbg/kdb_keyboard.c +++ b/reactos/ntoskrnl/dbg/kdb_keyboard.c @@ -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() { diff --git a/reactos/ntoskrnl/include/internal/kd.h b/reactos/ntoskrnl/include/internal/kd.h index 647f95e91ca..c580e4262b5 100644 --- a/reactos/ntoskrnl/include/internal/kd.h +++ b/reactos/ntoskrnl/include/internal/kd.h @@ -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);