From owner-kdb@oss.sgi.com Fri Dec 3 17:19:04 1999 Received: by oss.sgi.com id ; Fri, 3 Dec 1999 17:18:44 -0800 Received: from deliverator.sgi.com ([204.94.214.10]:52780 "EHLO deliverator.sgi.com") by oss.sgi.com with ESMTP id ; Fri, 3 Dec 1999 17:18:18 -0800 Received: from griffin.engr.sgi.com (griffin.engr.sgi.com [150.166.42.40]) by deliverator.sgi.com (980309.SGI.8.8.8-aspam-6.2/980310.SGI-aspam) via ESMTP id RAA12754 for ; Fri, 3 Dec 1999 17:21:09 -0800 (PST) mail_from (slurn@griffin.engr.sgi.com) Received: (from slurn@localhost) by griffin.engr.sgi.com (980427.SGI.8.8.8/960327.SGI.AUTOCF) id RAA87317; Fri, 3 Dec 1999 17:24:04 -0800 (PST) From: slurn@griffin.engr.sgi.com (Scott Lurndal) Message-Id: <199912040124.RAA87317@griffin.engr.sgi.com> Subject: [PATCH] kdb v0.6 for ia32 now available To: linux-kernel@vger.rutgers.edu Date: Fri, 3 Dec 1999 17:24:04 -0800 (PST) Cc: kdb@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-kdb@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;kdb-outgoing Release v0.6 of the built-in Kernel Debugger for linux (kdb) is now available on http://oss.sgi.com/projects/kdb direct download: ftp://oss.sgi.com/www/projects/kdb/download/kdb-v0.6-2.2.13.gz This release is against the 2.2.13 kernel tree. I'm currently backporting it to 2.2.5 for folks using the redhat 6.0 release kernel distribution, it should be available soon. This is the last scheduled release of kdb for the 2.2 kernel series. The next release of kdb, hopefully sometime in December, will be version v1.0, and will be restructured to support multiple architectures with initial support for ia32, mips and ia64 (ia64 code is subject to NDA restrictions at this time). Please address comments, bug-fixes and enhancment requests to the kdb mailing list (kdb@oss.sgi.com). Release v0.6 supports the following new features and bugfixes. Much better support for SMP systems, including use of NMI to force all processors into the kernel debugger independent of the interrupt state of the processor. Once all processors have stopped, no interrupts are necessary to switch the kernel debugger between processors. Better breakpoint handling on multiprocessor systems. Simultaneous breakpoints (e.g. bpa schedule) on multiple processors will be handled serially by the kernel debugger. Pentium and PentiumPRO machine check exception handling. Invoke KDB upon NMI (for systems with NMI button, allows debugging systems when all interrupts are disabled). Somewhat better keyboard handling. I haven't encountered the keyboard hang with this release, but I don't guarantee it has been fixed. The garbage characters leftover have been fixed, however. New 'sr' command to call MAGIC_SYSRQ functions (Thanks Adegawa Masahiro). Handle symbols with MODVERSIONS tags (Thanks Adegawa Masahiro). Under some circumstances, spurious breakpoints would occur. This should be fixed. New loadable module commands to examine SCSI mid-layer data structures (Scsi_Cmnd, Scsi_Disk, Scsi_Host) and to examine a struct file. rm command can be used to alter debug register contents. Enhanced ps command to print process state and to show current process as well as active processes on other processors. Space is no longer allocated in the kernel image for the symbol table when CONFIG_KDB=N, and the space requirement is computed dynamically when CONFIG_KDB=Y based upon the maximum number of symbols configured with make *config. General bugfixes. -- Scott Lurndal Technical Lead - MTS Core Linux OS SGI From owner-kdb@oss.sgi.com Wed Dec 8 08:10:29 1999 Received: by oss.sgi.com id ; Wed, 8 Dec 1999 08:10:19 -0800 Received: from soto.zerosoft.co.jp ([210.140.67.114]:16390 "EHLO soto.zerosoft.co.jp") by oss.sgi.com with ESMTP id ; Wed, 8 Dec 1999 08:09:56 -0800 Received: (from bin@localhost) by soto.zerosoft.co.jp (8.8.5/3.5Wpl5) id BAA14665; Thu, 9 Dec 1999 01:17:13 +0900 (JST) Received: from uchi.zerosoft.co.jp(192.168.181.182) by soto.zerosoft.co.jp via smap (V2.0) id xma014663; Thu, 9 Dec 99 01:17:03 +0900 Received: from ade2 ([192.168.200.232]) by uchi.zerosoft.co.jp (8.8.5/3.5Wpl5) with SMTP id BAA08938; Thu, 9 Dec 1999 01:17:02 +0900 (JST) Date: Thu, 09 Dec 1999 01:16:14 +0900 From: masahiro adegawa To: kdb@oss.sgi.com Cc: linux-kernel@vger.rutgers.edu Subject: [PATCH]display-modify i/o port for kdb-v0.6 Message-Id: <384E844E23A.60C2ADEGAWA@mail.zerosoft.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver 1.25.04 Sender: owner-kdb@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;kdb-outgoing hi, I have 2 patchs about i/o port for kdb-v0.6. (http://oss.sgi.com/projects/kdb) 1st patch is a small bug fix. I'm using kdb with serial console or HHK that haven't LED. :-p 2nd patch is added commands display-modify i/o port. iob [] Display/Modify i/o port(8bit) iow [] Display/Modify i/o port(16bit) iol [] Display/Modify i/o port(32bit) ex. Entering kdb due to Keyboard Entry kdb> iob 0x378 in : 0x378 = 0x00 kdb> iob 0x378 0x23 out : 0x378 = 0x23 kdb> iob 0x378 in : 0x378 = 0x23 kdb> thanks, --- arch/i386/kdb/kdb_io.c.orig Tue Dec 7 12:05:17 1999 +++ arch/i386/kdb/kdb_io.c Tue Dec 7 12:06:16 1999 @@ -45,7 +45,7 @@ { while (inb(KBD_STATUS_REG) & KBD_STAT_IBF) ; - outb(KBD_DATA_REG, byte); + outb(byte, KBD_DATA_REG); } static void --- arch/i386/kdb/kdb.c.orig Tue Dec 7 12:05:17 1999 +++ arch/i386/kdb/kdb.c Tue Dec 7 12:06:16 1999 @@ -23,6 +23,7 @@ #endif #include #include +#include #include "kdbsupport.h" #include "kdb_io.h" @@ -1148,6 +1149,85 @@ return 0; } +/* + * kdb_io + * + * This function implements the 'iob','iow' and 'iol' commands. + * + * iob|iow|iol [ []] + * + * Inputs: + * argc argument count + * argv argument vector + * envp environment vector + * regs registers at time kdb was entered. + * Outputs: + * None. + * Returns: + * zero for success, a kdb diagnostic if error + * Locking: + * none. + * Remarks: + * none. + */ + +int +kdb_io(int argc, const char **argv, const char **envp, struct pt_regs *regs) +{ + int diag; + unsigned long addr; + long offset = 0; + unsigned long contents; + int nextarg; + int mod = 0; + + if (argc == 0) { + return KDB_ARGCOUNT; + } + + nextarg = 1; + diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL, regs); + if (diag) + return diag; + + if (nextarg <= argc) { + diag = kdbgetaddrarg(argc, argv, &nextarg, &contents, NULL, NULL, regs); + if (diag) + return diag; + mod = 1; + if (nextarg != argc + 1) + return KDB_ARGCOUNT; + } + + /* + * To prevent access of invalid addresses, check first. + * Hmm... + */ + + if (strcmp(argv[0], "iob") == 0) { + if (mod) + outb(contents, addr); + else + contents = inb(addr); + kdb_printf("%s : 0x%x = 0x%2.2x\n", mod?"out":"in", addr, contents); + } + if (strcmp(argv[0], "iow") == 0) { + if (mod) + outw(contents, addr); + else + contents = inw(addr); + kdb_printf("%s : 0x%x = 0x%4.4x\n", mod?"out":"in", addr, contents); + } + if (strcmp(argv[0], "iol") == 0) { + if (mod) + outl(contents, addr); + else + contents = inl(addr); + kdb_printf("%s : 0x%x = 0x%8.8x\n", mod?"out":"in", addr, contents); + } + + return 0; +} /* * kdb_go @@ -1855,6 +1935,9 @@ kdb_register("cpu", kdb_cpu, "","Switch to new cpu", 0); #endif /* __SMP__ */ kdb_register("ps", kdb_ps, "", "Display active task list", 0); + kdb_register("iob", kdb_io, " []", "Display/Modify i/o port(8bit)", 0); + kdb_register("iow", kdb_io, " []", "Display/Modify i/o port(16bit)", 0); + kdb_register("iol", kdb_io, " []", "Display/Modify i/o port(32bit)", 0); kdb_register("reboot", kdb_reboot, "", "Reboot the machine immediately", 0); #if defined(CONFIG_MAGIC_SYSRQ) kdb_register("sr", kdb_sr, "", "Magic SysRq key", 0);