NetBSD Problem Report #7409

Received: (qmail 16653 invoked from network); 17 Apr 1999 14:37:45 -0000
Message-Id: <199904171437.KAA16129@anduin.eldar.org>
Date: Sat, 17 Apr 1999 10:37:41 -0400 (EDT)
From: Brad Spencer <brad@anduin.eldar.org>
Reply-To: brad@anduin.eldar.org
To: gnats-bugs@gnats.netbsd.org
Subject: SS2, PROM version 2.2 serial console problems
X-Send-Pr-Version: 3.95

>Number:         7409
>Category:       port-sparc
>Synopsis:       SS2, PROM version 2.2 serial console problems
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-sparc-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Apr 17 07:50:01 +0000 1999
>Closed-Date:    Mon Mar 13 14:23:15 +0000 2000
>Last-Modified:  Mon Mar 13 14:27:27 +0000 2000
>Originator:     Brad Spencer
>Release:        NetBSD-1.4_ALPHA supped around 4/14/1999
>Organization:
	Sitting at home
>Environment:

System: NetBSD valinor.eldar.org 1.4_ALPHA NetBSD 1.4_ALPHA (VALINOR) #2: Fri Apr 16 23:45:35 EDT 1999     root@valinor.eldar.org:/usr/src/sys/arch/sparc/compile/VALINOR sparc


>Description:

When updating my Sparc 2, which uses a serial console, with PROM
version 2.2 from NetBSD 1.3E to NetBSD 1.4_ALPHA, the new kernel would
not boot.  It complained with the following lines:

ok boot netbsd.new2 -s
Boot device: /sbus/esp@0,800000/sd@3,0   File and args: netbsd.new2 -s
>How-To-Repeat:

Boot a new kernel on a Sparc 2 with older PROMs.

>Fix:

Well...  I don't have a proper fix, however, the PROM does have a
couple of "variables" that are set to ttya.  If possible, falling back
to those might be a good thing.

[BTW - this particular machine appears to *not* fall back to the
serial console when the keyboard is removed.  When I fist installed
this machine, I had to borrow a 13W3<->HD-15 video adaptor so I could
set the eeprom to use ttya as the console input and output device]

>Release-Note:
>Audit-Trail:

From: David Brownlee <abs@mono.org>
To: jonl <jonl@kudra.yubyub.net>
Cc: gnats-bugs@gnats.netbsd.org, brad@anduin.eldar.org,
        Brian D Chase <bdc@world.std.com>,
        "(NetBSD/sparc Maillist)" <port-sparc@netbsd.org>
Subject: port-sparc/7409
Date: Mon, 1 Nov 1999 00:30:11 +0000 (GMT)

 	http://www.NetBSD.org/cgi-bin/query-pr-single.pl?number=7409

 	Could someone with this problem please change line 919 of
 	/sys/arch/sparc/dev/zs.c to

         printf("Warning: unparseable %s property '%s'\n", prop, buffer);

 	and report the new error messages.

 	My guess is the following commit is the problem:

 http://cvsweb.netbsd.org/cgi-bin/cvsweb.cgi/syssrc/sys/arch/sparc/dev/zs.c.diff?r1=1.65&r2=1.66

 		David/absolute

 On Sun, 31 Oct 1999, jonl wrote:

 > On Sun, 31 Oct 1999, David Brownlee wrote:
 > 
 > > 	Do you know if there is a PR open on the problem?
 > > 	If not, would it be possible for you to send one with the
 > > 	patch you used? :)
 > > 
 > > 	Thanks!
 > 
 > There is a PR, although I don't know the number.  I basically followed the
 > advice there (just hardwire one function to return a specific value - I
 > forget which), and there you go.  Sorry I can't be more specific than
 > that.
 > 
 > -Jon
 > 


From: Brian D Chase <bdc@world.std.com>
To: David Brownlee <abs@mono.org>
Cc: jonl <jonl@kudra.yubyub.net>, gnats-bugs@gnats.netbsd.org,
        brad@anduin.eldar.org,
        "(NetBSD/sparc Maillist)" <port-sparc@netbsd.org>
Subject: Re: port-sparc/7409
Date: Sun, 31 Oct 1999 17:30:42 -0800

 I've done some poking around with the driver and found that the line

   cp = getpropstringA(node, prop, buffer, sizeof buffer);

 returns a null string to cp.  When I examined the full length of buffer[]
 I found that it was just full of garbage.  I'm still digging my way
 through function calls to figure out where things are breaking down.

 In the meantime, can someone give me an example of what the cp string
 should look like for the serial console on ttya?

 Thanks.

 -brian.


 On Mon, 1 Nov 1999, David Brownlee wrote:

 > 	http://www.NetBSD.org/cgi-bin/query-pr-single.pl?number=7409
 > 
 > 	Could someone with this problem please change line 919 of
 > 	/sys/arch/sparc/dev/zs.c to
 > 
 >         printf("Warning: unparseable %s property '%s'\n", prop, buffer);
 > 
 > 	and report the new error messages.
 > 
 > 	My guess is the following commit is the problem:
 > 
 > http://cvsweb.netbsd.org/cgi-bin/cvsweb.cgi/syssrc/sys/arch/sparc/dev/zs.c.diff?r1=1.65&r2=1.66
 > 
 > 		David/absolute
 > 
 > On Sun, 31 Oct 1999, jonl wrote:
 > 
 > > On Sun, 31 Oct 1999, David Brownlee wrote:
 > > 
 > > > 	Do you know if there is a PR open on the problem?
 > > > 	If not, would it be possible for you to send one with the
 > > > 	patch you used? :)
 > > > 
 > > > 	Thanks!
 > > 
 > > There is a PR, although I don't know the number.  I basically followed the
 > > advice there (just hardwire one function to return a specific value - I
 > > forget which), and there you go.  Sorry I can't be more specific than
 > > that.
 > > 
 > > -Jon
 > > 
 > 

 --- Brian Chase | bdc@world.std.com | http://world.std.com/~bdc/ -----
  On Earth it's always something.  In Heaven it's always Kibo.  -- K.


From: Brad Spencer <brad@anduin.eldar.org>
To: bdc@world.std.com
Cc: abs@mono.org, jonl@kudra.yubyub.net, gnats-bugs@gnats.netbsd.org,
        port-sparc@netbsd.org
Subject: Re: port-sparc/7409
Date: Sun, 31 Oct 1999 22:55:09 -0500 (EST)

    I've done some poking around with the driver and found that the line

      cp = getpropstringA(node, prop, buffer, sizeof buffer);

    returns a null string to cp.  When I examined the full length of buffer[]
    I found that it was just full of garbage.  I'm still digging my way
    through function calls to figure out where things are breaking down.

 I am the one who wrote the original PR and can confirm the above
 behavior.  The buffer returned is junk.

 The problem almost seems to be prom version dependent, as it does not
 appear to exist on any of my other Suns [if I recall correctly], only on
 my SS2.  I would also state that the eeprom command says that input-device
 and output-device are set to ttya.

 Also...  this, did at one time, function as expected.  I am not sure when
 it went amuck.

    In the meantime, can someone give me an example of what the cp string
    should look like for the serial console on ttya?

    Thanks.

    -brian.


    On Mon, 1 Nov 1999, David Brownlee wrote:

    > 	http://www.NetBSD.org/cgi-bin/query-pr-single.pl?number=7409
    > 
    > 	Could someone with this problem please change line 919 of
    > 	/sys/arch/sparc/dev/zs.c to
    > 
    >         printf("Warning: unparseable %s property '%s'\n", prop, buffer);
    > 
    > 	and report the new error messages.
    > 
    > 	My guess is the following commit is the problem:
    > 
    > http://cvsweb.netbsd.org/cgi-bin/cvsweb.cgi/syssrc/sys/arch/sparc/dev/zs.c.diff?r1=1.65&r2=1.66
    > 
    > 		David/absolute
    > 


 [snip]




 Brad Spencer - brad@anduin.eldar.org   http://anduin.eldar.org
 [finger brad@anduin.eldar.org for PGP public key]

From: Brian D Chase <bdc@world.std.com>
To: Brad Spencer <brad@anduin.eldar.org>
Cc: abs@mono.org, jonl@kudra.yubyub.net, gnats-bugs@gnats.netbsd.org,
        port-sparc@netbsd.org
Subject: Re: port-sparc/7409
Date: Sun, 31 Oct 1999 20:15:27 -0800

 On Sun, 31 Oct 1999, Brad Spencer wrote:

 >    I've done some poking around with the driver and found that the line
 > 
 >      cp = getpropstringA(node, prop, buffer, sizeof buffer);
 > 
 >    returns a null string to cp.  When I examined the full length of buffer[]
 >    I found that it was just full of garbage.  I'm still digging my way
 >    through function calls to figure out where things are breaking down.
 > 
 > I am the one who wrote the original PR and can confirm the above
 > behavior.  The buffer returned is junk.
 > 
 > The problem almost seems to be prom version dependent, as it does not
 > appear to exist on any of my other Suns [if I recall correctly], only on
 > my SS2.  I would also state that the eeprom command says that input-device
 > and output-device are set to ttya.

 FWIW, the prom version on my SS2 is 2.2.

 I'd also point out that the following code fragment from the zs.c file has
 a certain amount of *badness* inherent to it.  The author makes the
 assumption that they'd be dealing with a string of at least 2
 data characters and one trailing null character.  

         /*
          * At this point we assume the device path is in the form
          *   ....device@x,y:a for ttya and ...device@x,y:b for ttyb, etc.
          */
         while (*cp != 0)
                 cp++;
         cp -= 2;

 In cases where we've got a string of length 1 or 0, then following the
 decrement by 2, we're pointing at a memory location which isn't part of
 the allocated buffer.  Yech.

 -brian.
 --- Brian Chase | bdc@world.std.com | http://world.std.com/~bdc/ -----
 All math equations have a fistfight on at least one side.  -- K.


From: David Brownlee <abs@mono.org>
To: Brian D Chase <bdc@world.std.com>
Cc: Brad Spencer <brad@anduin.eldar.org>, jonl@kudra.yubyub.net,
        gnats-bugs@gnats.netbsd.org, port-sparc@netbsd.org
Subject: Re: port-sparc/7409
Date: Mon, 1 Nov 1999 11:08:09 +0000 (GMT)

 On Sun, 31 Oct 1999, Brian D Chase wrote:

 > >    I've done some poking around with the driver and found that the line
 > > 
 > >      cp = getpropstringA(node, prop, buffer, sizeof buffer);
 > > 
 > >    returns a null string to cp.  When I examined the full length of buffer[]
 > >    I found that it was just full of garbage.  I'm still digging my way
 > >    through function calls to figure out where things are breaking down.
 > > 

 	Have you tried reverting the 1.65-1.66 patch, as in
 http://cvsweb.netbsd.org/cgi-bin/cvsweb.cgi/syssrc/sys/arch/sparc/dev/zs.c.diff?r1=1.65&r2=1.66&f=u
 	(selecting unidiff should make it usable as a patch :)

 > I'd also point out that the following code fragment from the zs.c file has
 > a certain amount of *badness* inherent to it.  The author makes the
 > assumption that they'd be dealing with a string of at least 2
 > data characters and one trailing null character.  
 > 
 >         /*
 >          * At this point we assume the device path is in the form
 >          *   ....device@x,y:a for ttya and ...device@x,y:b for ttyb, etc.
 >          */
 >         while (*cp != 0)
 >                 cp++;
 >         cp -= 2;
 > 
 > In cases where we've got a string of length 1 or 0, then following the
 > decrement by 2, we're pointing at a memory location which isn't part of
 > the allocated buffer.  Yech.

 	Indeed - its making an assumption that the prom is returning
 	a valid entry. I'd agree an extra test is probably worthwhile
 	there :)

 		David/absolute


State-Changed-From-To: open->closed 
State-Changed-By: pk 
State-Changed-When: Mon Mar 13 06:23:15 PST 2000 
State-Changed-Why:  
In NetBSD/1.4.2 and NetBSD-current, this problem has been worked-around 
by falling back to `ttya' if the information cannot be retrieved 
from the PROM, according to the patch supplied. 
>Unformatted:
 >> NetBSD BOOT [$Revision: 1.4 $]
 Booting netbsd.new2 @ 0x4000
 1089536+107616+145328+[70008+82455]=0x170fa7
 OBP version 2, revision 2.2 (plugin rev 2)
 Warning: unparseable stdin-path property
 Warning: unparseable stdout-path property
 cninit: invalid inSource=0xffffffff
 Type  'go' to resume
 ok 

 The messages are from /sys/arch/sparc/dev/zs.c.  In particular, the
 function:

 int
 get_serial_promdev(io)
 	int io;
 {

 .....

 }

 failed to figure out anything from the properties 'stdin-path' and
 'stdout-path'.  Adding some more debugging would seem to indicate that
 these properties do not exist or are set to nothing.

 Wiring down the above function to return PROMDEV_TTYA allowed things
 to proceed along.


 Prior to updating my Sparc 2, I updated my IPX which is basically the
 same in terms of OS and the like.  Except that it has PROM version
 2.3.  There was not a single complaint.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.