Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Jun 1999 23:49:57 +0900
From:      Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        current@freebsd.org, yokota@zodiac.mech.utsunomiya-u.ac.jp
Subject:   siocnprobe() (was: Re: Remote serial gdb--status?)
Message-ID:  <199906211449.XAA25349@zodiac.mech.utsunomiya-u.ac.jp>
In-Reply-To: Your message of "Mon, 21 Jun 1999 11:52:39 %2B1000." <199906210152.LAA22100@godzilla.zeta.org.au> 
References:  <199906210152.LAA22100@godzilla.zeta.org.au> 

next in thread | previous in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199906211449.XAA25349>