From owner-freebsd-current Mon Jun 21 7:46: 5 1999 Delivered-To: freebsd-current@freebsd.org Received: from outmail.utsunomiya-u.ac.jp (outmail.utsunomiya-u.ac.jp [160.12.196.3]) by hub.freebsd.org (Postfix) with ESMTP id 3293214F55 for ; Mon, 21 Jun 1999 07:45:58 -0700 (PDT) (envelope-from yokota@zodiac.mech.utsunomiya-u.ac.jp) Received: from zodiac.mech.utsunomiya-u.ac.jp (IDENT:X95tTDpo9+awMWf9XL5MI04HoBv02axq@zodiac.mech.utsunomiya-u.ac.jp [160.12.42.1]) by outmail.utsunomiya-u.ac.jp (8.9.3/3.7Wpl2) with ESMTP id XAA26907; Mon, 21 Jun 1999 23:45:48 +0900 (JST) Received: from zodiac.mech.utsunomiya-u.ac.jp (zodiac.mech.utsunomiya-u.ac.jp [160.12.42.1]) by zodiac.mech.utsunomiya-u.ac.jp (8.7.6+2.6Wbeta7/3.4W/zodiac-May96) with ESMTP id XAA25349; Mon, 21 Jun 1999 23:49:58 +0900 (JST) Message-Id: <199906211449.XAA25349@zodiac.mech.utsunomiya-u.ac.jp> To: Bruce Evans Cc: current@freebsd.org, yokota@zodiac.mech.utsunomiya-u.ac.jp Subject: siocnprobe() (was: Re: Remote serial gdb--status?) In-reply-to: Your message of "Mon, 21 Jun 1999 11:52:39 +1000." <199906210152.LAA22100@godzilla.zeta.org.au> References: <199906210152.LAA22100@godzilla.zeta.org.au> Date: Mon, 21 Jun 1999 23:49:57 +0900 From: Kazutaka YOKOTA Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Different, but related issue. Even when the sio? port is disabled, siocnprobe() will check if it should be initialized for the console or for gdb. The disabled port should not be touched. Attached patch will check the resource value "disabled", and if it is set for the port, siocnprobe() will skip this port. Kazu Index: sio.c =================================================================== RCS file: /src/CVS/src/sys/isa/sio.c,v retrieving revision 1.249 diff -u -r1.249 sio.c --- sio.c 1999/06/20 13:10:09 1.249 +++ sio.c 1999/06/21 14:44:36 @@ -2814,6 +2814,11 @@ for (unit = 0; unit < 16; unit++) { /* XXX need to know how many */ int flags; + int disabled; + if (resource_int_value("sio", unit, "disabled", &disabled) == 0) { + if (disabled) + continue; + } if (resource_int_value("sio", unit, "flags", &flags)) continue; if (COM_CONSOLE(flags) || COM_DEBUGGER(flags)) { >>It looks like isa/sio.c still won't allow you to set a port as both >>a low-level console and the gdb port. I could not get remote gdb >>to work correctly after the sio probe without designating the port >>for low-level console I/O. Now that I've done that, I can't debug >>at 115200 any more. 38400 seems to work for me, but that is with >>only minimal testing. Who broke remote debugging in sio? This >>is a critical tool we can't afford to have broken... 8-( > >Designating a port for low-level "console" i/o (flags 0x40) currently >makes it unavailable for ordinary console i/o (flags 0x10) and >debugging (flags 0x80). I think this is a bug. Go back a couple >of versions if you want to use flags (0x40 | 0x80). > >I think the problem with "high" speeds is caused by the low-level console >driver doesn't initialise the UART's (receiver) fifo. The siocn i/o >routines are unbuffered, but gdb apparently requires some buffering, and a >16-character fifo apparently provides enough buffering. It's surprising >that the unbuffered routines work at all. The output routine busy-waits >until everything is sent, so sending large packets would break receiving >large packets. > >To use gdb on a normal port (except while booting), stty the port to the >same settings as gdb is using. This annulls the context switching in >the siocn i/o routines (they switch the context on every character so >that debugging using ddb works evern if the port is being probed, but >this doesn't work for gdb since its i/o isn't one character at a time). > >The sio probe and attach routines should handle the gdb port like they >handle the console port. > >Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message