From owner-freebsd-hackers Mon Mar 13 23:54:52 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id XAA03009 for hackers-outgoing; Mon, 13 Mar 1995 23:54:52 -0800 Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.cdrom.com (8.6.10/8.6.6) with SMTP id XAA02979 for ; Mon, 13 Mar 1995 23:51:39 -0800 Received: from sax.sax.de by irz301.inf.tu-dresden.de with SMTP (5.67b+/DEC-Ultrix/4.3) id AA18352; Tue, 14 Mar 1995 08:51:19 +0100 Received: by sax.sax.de (8.6.9/8.6.9-s1) with UUCP id IAA03533 for freebsd-hackers@freebsd.org; Tue, 14 Mar 1995 08:51:19 +0100 Received: (from j@localhost) by uriah.heep.sax.de (8.6.11/8.6.9) id IAA01352 for freebsd-hackers@freebsd.org; Tue, 14 Mar 1995 08:23:33 +0100 From: J Wunsch Message-Id: <199503140723.IAA01352@uriah.heep.sax.de> Subject: Re: calling up ddb from a comconsole To: freebsd-hackers@FreeBSD.org (FreeBSD hackers) Date: Tue, 14 Mar 1995 08:23:32 +0100 (MET) In-Reply-To: <199503140037.AAA01029@bagpuss.demon.co.uk> from "Karl Strickland" at Mar 14, 95 00:37:09 am Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) X-Phone: +49-351-2012 669 X-Mailer: ELM [version 2.4 PL23] Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Content-Length: 4923 Sender: hackers-owner@FreeBSD.org Precedence: bulk As Karl Strickland wrote: > > ideally i'd like to do this on 1.x, though if anyone has a patch for either > 1.x or 2.x, please send it to me! Had a hard time getting this machine up again... This once happened to work on a 2.0 box (actually, it still works). It uses a BREAK character to trigger DDB. The patch is rather complex since it adds another argument to siointr1 in order to pass the unit # down (and decide if this port has been the console port). Does anyone else have comments on this? *** sio.c.orig Wed Oct 12 19:11:00 1994 --- sio.c Mon Oct 31 12:01:49 1994 *************** *** 272,278 **** static timeout_t siodtrwakeup; static void comflush __P((struct com_s *com)); static void comhardclose __P((struct com_s *com)); ! static void siointr1 __P((struct com_s *com)); static void commctl __P((struct com_s *com, int bits, int how)); static int comparam __P((struct tty *tp, struct termios *t)); static int sioprobe __P((struct isa_device *dev)); --- 272,278 ---- static timeout_t siodtrwakeup; static void comflush __P((struct com_s *com)); static void comhardclose __P((struct com_s *com)); ! static void siointr1 __P((struct com_s *com, int unit)); static void commctl __P((struct com_s *com, int bits, int how)); static int comparam __P((struct tty *tp, struct termios *t)); static int sioprobe __P((struct isa_device *dev)); *************** *** 999,1005 **** int unit; { #ifndef COM_MULTIPORT ! siointr1(com_addr(unit)); #else /* COM_MULTIPORT */ struct com_s *com; bool_t possibly_more_intrs; --- 999,1005 ---- int unit; { #ifndef COM_MULTIPORT ! siointr1(com_addr(unit), unit); #else /* COM_MULTIPORT */ struct com_s *com; bool_t possibly_more_intrs; *************** *** 1018,1024 **** if (com != NULL && (inb(com->int_id_port) & IIR_IMASK) != IIR_NOPEND) { ! siointr1(com); possibly_more_intrs = TRUE; } } --- 1018,1024 ---- if (com != NULL && (inb(com->int_id_port) & IIR_IMASK) != IIR_NOPEND) { ! siointr1(com, unit); possibly_more_intrs = TRUE; } } *************** *** 1027,1034 **** } static void ! siointr1(com) struct com_s *com; { u_char line_status; u_char modem_status; --- 1027,1035 ---- } static void ! siointr1(com, unit) struct com_s *com; + int unit; { u_char line_status; u_char modem_status; *************** *** 1060,1065 **** --- 1061,1080 ---- continue; } #endif /* KGDB */ + #if defined(COMCONSOLE) && defined(DDB) + if ((line_status & LSR_BI) /* BREAK */ + && unit == comconsole) { + static bool_t in_Debugger = FALSE; + + if(!in_Debugger) { + in_Debugger = TRUE; + Debugger("console break"); + in_Debugger = FALSE; + goto next; + } + } + #endif /* COMCONSOLE && DDB */ + ioptr = com->iptr; if (ioptr >= com->ibufend) CE_RECORD(com, CE_INTERRUPT_BUF_OVERFLOW); *************** *** 1085,1090 **** --- 1100,1108 ---- * "& 0x7F" is to avoid the gcc-1.40 generating a slow * jump from the top of the loop to here */ + #if defined(COMCONSOLE) && defined(DDB) + next: + #endif line_status = inb(com->line_status_port) & 0x7F; } *************** *** 1715,1721 **** * stale input in sioopen(). */ if (com->state >= (CS_BUSY | CS_TTGO)) ! siointr1(com); enable_intr(); splx(s); --- 1733,1739 ---- * stale input in sioopen(). */ if (com->state >= (CS_BUSY | CS_TTGO)) ! siointr1(com, unit); enable_intr(); splx(s); *************** *** 1767,1773 **** #endif if (com->state & CS_BUSY) { disable_intr(); ! siointr1(com); enable_intr(); } else if (tp->t_outq.c_cc != 0) { u_int ocount; --- 1785,1791 ---- #endif if (com->state & CS_BUSY) { disable_intr(); ! siointr1(com, unit); enable_intr(); } else if (tp->t_outq.c_cc != 0) { u_int ocount; *************** *** 1777,1783 **** disable_intr(); com->obufend = (com->optr = com->obuf) + ocount; com->state |= CS_BUSY; ! siointr1(com); /* fake interrupt to start output */ enable_intr(); } out: --- 1795,1801 ---- disable_intr(); com->obufend = (com->optr = com->obuf) + ocount; com->state |= CS_BUSY; ! siointr1(com, unit); /* fake interrupt to start output */ enable_intr(); } out: *************** *** 1864,1870 **** if (com != NULL && (com->state >= (CS_BUSY | CS_TTGO) || com->poll)) { disable_intr(); ! siointr1(com); enable_intr(); } } --- 1882,1888 ---- if (com != NULL && (com->state >= (CS_BUSY | CS_TTGO) || com->poll)) { disable_intr(); ! siointr1(com, unit); enable_intr(); } } -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ Never trust an operating system you don't have sources for. ;-)