From owner-freebsd-current Thu Jun 10 9:41: 1 1999 Delivered-To: freebsd-current@freebsd.org Received: from midten.fast.no (midten.fast.no [195.139.251.11]) by hub.freebsd.org (Postfix) with ESMTP id 98EE114D19; Thu, 10 Jun 1999 09:40:42 -0700 (PDT) (envelope-from tegge@fast.no) Received: from fast.no (IDENT:tegge@midten.fast.no [195.139.251.11]) by midten.fast.no (8.9.3/8.9.3) with ESMTP id SAA13408; Thu, 10 Jun 1999 18:40:23 +0200 (CEST) Message-Id: <199906101640.SAA13408@midten.fast.no> To: philh@mincom.com Cc: freebsd-current@FreeBSD.ORG, freebsd-stable@FreeBSD.ORG Subject: Re: ENABLE_SERIAL_BREAK_KEY...or something? From: Tor.Egge@fast.no In-Reply-To: Your message of "Thu, 10 Jun 1999 15:41:24 +1000" References: <19990610154124.F22693@mincom.com> X-Mailer: Mew version 1.70 on Emacs 19.34.1 Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Thu_Jun_10_18:39:25_1999)--" Content-Transfer-Encoding: 7bit Date: Thu, 10 Jun 1999 18:40:22 +0200 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG ----Next_Part(Thu_Jun_10_18:39:25_1999)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit > Would be most excellent if this could be done. A couple of boxen I > have here have serial consoles attached to other machines which > do a very good simulation of a break when the controlling process > leaves them. Dropping to DDB every time you reboot the other machine > is, uh, less than desirable behaviour. :-) I had the same problem. Changing the sio code to require three breaks inside a 10 seconds interval before dropping into the debugger reduced the problem for me. - Tor Egge ----Next_Part(Thu_Jun_10_18:39:25_1999)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Index: sys/i386/conf/options.i386 =================================================================== RCS file: /home/ncvs/src/sys/i386/conf/options.i386,v retrieving revision 1.116 diff -u -r1.116 options.i386 --- options.i386 1999/06/06 22:45:04 1.116 +++ options.i386 1999/06/08 00:27:17 @@ -24,6 +24,7 @@ AUTO_EOI_1 opt_auto_eoi.h AUTO_EOI_2 opt_auto_eoi.h BREAK_TO_DEBUGGER opt_comconsole.h +TRIPLE_BREAK_TO_DEBUGGER opt_comconsole.h CONSPEED opt_comconsole.h I586_PMC_GUPROF opt_i586_guprof.h WLCACHE opt_wavelan.h Index: sys/isa/sio.c =================================================================== RCS file: /home/ncvs/src/sys/isa/sio.c,v retrieving revision 1.246 diff -u -r1.246 sio.c --- sio.c 1999/05/31 06:57:31 1.246 +++ sio.c 1999/06/08 00:27:38 @@ -427,6 +427,16 @@ { -1, -1 } }; +#define DDB_BREAK_MASK (IER_ERXRDY | IER_ETXRDY | IER_ERLS | IER_EMSC) + +#ifdef TRIPLE_BREAK_TO_DEBUGGER +#ifndef TRIPLE_BREAK_TIMEOUT +#define TRIPLE_BREAK_TIMEOUT 10 +#endif +int triple_break_count; /* number of breaks detected */ +int triple_break_time; /* time_second sampled at first break */ +#endif + #ifdef COM_ESP /* XXX configure this properly. */ static Port_t likely_com_ports[] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, }; @@ -998,6 +1008,9 @@ com->lt_out.c_ispeed = com->lt_out.c_ospeed = com->lt_in.c_ispeed = com->lt_in.c_ospeed = com->it_in.c_ispeed = com->it_in.c_ospeed = comdefaultrate; +#if defined(DDB) && defined(BREAK_TO_DEBUGGER) && defined(DDB_BREAK_MASK) + outb(iobase + com_ier, DDB_BREAK_MASK); +#endif } else com->it_in.c_ispeed = com->it_in.c_ospeed = TTYDEF_SPEED; if (siosetwater(com, com->it_in.c_ispeed) != 0) { @@ -1404,7 +1417,12 @@ com->pps.ppsparam.mode = 0; outb(iobase + com_cfcr, com->cfcr_image &= ~CFCR_SBREAK); { - outb(iobase + com_ier, 0); +#if defined(DDB) && defined(BREAK_TO_DEBUGGER) && defined(DDB_BREAK_MASK) + if (com->unit == comconsole) + outb(iobase + com_ier, DDB_BREAK_MASK); + else +#endif + outb(iobase + com_ier, 0); tp = com->tp; if (tp->t_cflag & HUPCL /* @@ -1704,7 +1722,23 @@ if (line_status & LSR_BI) { #if defined(DDB) && defined(BREAK_TO_DEBUGGER) if (com->unit == comconsole) { +#ifdef TRIPLE_BREAK_TO_DEBUGGER + if (time_second > + triple_break_time + + TRIPLE_BREAK_TIMEOUT) + triple_break_count = 0; + triple_break_count++; + if (triple_break_count == 1) + triple_break_time = + time_second; + else if (triple_break_count + == 3) { + triple_break_count = 0; + breakpoint(); + } +#else breakpoint(); +#endif goto cont; } #endif ----Next_Part(Thu_Jun_10_18:39:25_1999)---- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message