NetBSD Problem Report #17865

Received: (qmail 6874 invoked by uid 605); 7 Aug 2002 02:49:37 -0000
Message-Id: <200208070249.g772nTSK005084@noc.untraceable.net>
Date: Tue, 6 Aug 2002 22:49:29 -0400 (EDT)
From: Andrew Brown <atatat@atatdot.net>
Sender: gnats-bugs-owner@netbsd.org
Reply-To: Andrew Brown <atatat@atatdot.net>
To: gnats-bugs@gnats.netbsd.org
Subject: i386 boot-blocks hate function keys
X-Send-Pr-Version: 3.95

>Number:         17865
>Category:       port-i386
>Synopsis:       i386 boot-blocks hate function keys
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    perry
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 07 02:50:00 +0000 2002
>Closed-Date:    Wed Apr 30 22:19:55 +0000 2003
>Last-Modified:  Wed Apr 30 22:19:55 +0000 2003
>Originator:     TheMan
>Release:        1.6E as of 20020731 (boot-blocks built Wed May 22 04:02:45 EDT 2002)
>Organization:
none
>Environment:
System: NetBSD this 1.6E NetBSD 1.6E (THAT) #106: Fri Aug  2 16:02:12 EDT 2002     andrew@this:/usr/src/sys/arch/i386/compile/THAT i386

>Description:

i reboot my machine and mistakenly get involved in a conversation, so
when i actually get around to pressing f3 (to select netbsd from
mbr_bootsel), it's too late.  the boot-blocks are already counting
down to boot time.  however...now that i have pressed f3, the
boot-blocks seem no longer to be accepting any keypress to abort the
countdown.  sorta sucks when you're trying to boot an alternate kernel
to test some stuff.

>How-To-Repeat:

see above.

>Fix:

ask perry.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: port-i386-maintainer->perry 
Responsible-Changed-By: atatat 
Responsible-Changed-When: Tue Aug 6 19:52:54 PDT 2002 
Responsible-Changed-Why:  
perry said he'd look at it...maybe even fix it.  conceptually it 
seems simple, but who knows? 

From: David Laight <david@l8s.co.uk>
To: netbsd-bugs@netbsd.org
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: port-i386/17865: i386 boot-blocks hate function keys
Date: Wed, 7 Aug 2002 11:38:14 +0100

 > 
 > i reboot my machine and mistakenly get involved in a conversation, so
 > when i actually get around to pressing f3 (to select netbsd from
 > mbr_bootsel), it's too late.

 You could always increase the timeout for the mbr_bootsel code.
 However don't make it more than 1/2 the apparant maximum.
 (I've a lurking fix that also allows indefinite timeout)

 	David

 -- 
 David Laight: david@l8s.co.uk

From: Andrew Brown <atatat@atatdot.net>
To: David Laight <david@l8s.co.uk>
Cc: netbsd-bugs@netbsd.org, gnats-bugs@gnats.netbsd.org
Subject: Re: port-i386/17865: i386 boot-blocks hate function keys
Date: Wed, 7 Aug 2002 12:16:29 -0400

 >> i reboot my machine and mistakenly get involved in a conversation, so
 >> when i actually get around to pressing f3 (to select netbsd from
 >> mbr_bootsel), it's too late.
 >
 >You could always increase the timeout for the mbr_bootsel code.
 >However don't make it more than 1/2 the apparant maximum.
 >(I've a lurking fix that also allows indefinite timeout)

 nah...that'd have the unfortunate side-effect that regular unattended
 booting would take longer.  the point is not that i don't have enough
 time to press the key, the point is that i get distracted at the
 crucial moment and then the bootblocks stop behaving as expected
 (after i punch f3).  they shouldn't stop acknowledging keypresses
 while they're counting down.

 -- 
 |-----< "CODE WARRIOR" >-----|
 codewarrior@daemon.org             * "ah!  i see you have the internet
 twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
 andrew@crossbar.com       * "information is power -- share the wealth."

From: David Laight <david@l8s.co.uk>
To: Cc: netbsd-bugs@netbsd.org, gnats-bugs@gnats.netbsd.org
Subject: Re: port-i386/17865: i386 boot-blocks hate function keys
Date: Wed, 7 Aug 2002 18:05:43 +0100

 > nah...that'd have the unfortunate side-effect that regular unattended
 > booting would take longer.  the point is not that i don't have enough
 > time to press the key, the point is that i get distracted at the
 > crucial moment and then the bootblocks stop behaving as expected
 > (after i punch f3).  they shouldn't stop acknowledging keypresses
 > while they're counting down.

 Ok can you remember whether F3 had the effect of aborting the
 countdown? ie acting the same as enter?

 The bios call used to read the keyboard returns the raw keycode
 in ah and the ascii value in al.  For function keys the ascii
 value could easily be 0.  This would terminate the timeout.

 awaitkey() (in sys/arch/i386/stand/lib/pcio.c) has the following:

 	/* flush input buffer */
 	while (iskey())
 		c = getchar();
 	goto out; /* XXX what happens if c == 0? */

 Maybe it would be better to add:
 	if (!c)
 		c = -1;

 So that keys with an ascii value of 0 aren't treated as
 timeout.

 	David

 -- 
 David Laight: david@l8s.co.uk

From: Andrew Brown <atatat@atatdot.net>
To: David Laight <david@l8s.co.uk>
Cc: netbsd-bugs@netbsd.org, gnats-bugs@gnats.netbsd.org
Subject: Re: port-i386/17865: i386 boot-blocks hate function keys
Date: Wed, 7 Aug 2002 13:13:35 -0400

 >> nah...that'd have the unfortunate side-effect that regular unattended
 >> booting would take longer.  the point is not that i don't have enough
 >> time to press the key, the point is that i get distracted at the
 >> crucial moment and then the bootblocks stop behaving as expected
 >> (after i punch f3).  they shouldn't stop acknowledging keypresses
 >> while they're counting down.
 >
 >Ok can you remember whether F3 had the effect of aborting the
 >countdown? ie acting the same as enter?

 i didn't.  that was the problem.  if it did abort the countdown, we
 wouldn't be here now.

 >The bios call used to read the keyboard returns the raw keycode
 >in ah and the ascii value in al.  For function keys the ascii
 >value could easily be 0.  This would terminate the timeout.

 they probably *are* 0 because function keys, iirc, return an extended
 keycode from the keyboard port first.  i dunno if that's confusing
 things...it might be.

 >awaitkey() (in sys/arch/i386/stand/lib/pcio.c) has the following:
 >
 >	/* flush input buffer */
 >	while (iskey())
 >		c = getchar();
 >	goto out; /* XXX what happens if c == 0? */
 >
 >Maybe it would be better to add:
 >	if (!c)
 >		c = -1;
 >
 >So that keys with an ascii value of 0 aren't treated as
 >timeout.

 or perhaps just something as simple as a space so that the countdown
 gets aborted?  hmm...i dunno.  maybe not.

 -- 
 |-----< "CODE WARRIOR" >-----|
 codewarrior@daemon.org             * "ah!  i see you have the internet
 twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
 andrew@crossbar.com       * "information is power -- share the wealth."

From: David Laight <david@l8s.co.uk>
To: Cc: netbsd-bugs@netbsd.org, gnats-bugs@gnats.netbsd.org
Subject: Re: port-i386/17865: i386 boot-blocks hate function keys
Date: Wed, 7 Aug 2002 18:22:52 +0100

 > >Ok can you remember whether F3 had the effect of aborting the
 > >countdown? ie acting the same as enter?
 > 
 > i didn't.  that was the problem.  if it did abort the countdown, we
 > wouldn't be here now.

 Abort as in 'stop counting and boot now',
 not abort as in 'stop counting and give me a prompt',
 as opposed to 'continue counting but ignore the keyboard'.

 	David

 -- 
 David Laight: david@l8s.co.uk

From: Andrew Brown <atatat@atatdot.net>
To: David Laight <david@l8s.co.uk>
Cc: netbsd-bugs@netbsd.org, gnats-bugs@gnats.netbsd.org
Subject: Re: port-i386/17865: i386 boot-blocks hate function keys
Date: Wed, 7 Aug 2002 13:41:43 -0400

 >> >Ok can you remember whether F3 had the effect of aborting the
 >> >countdown? ie acting the same as enter?
 >> 
 >> i didn't.  that was the problem.  if it did abort the countdown, we
 >> wouldn't be here now.
 >
 >Abort as in 'stop counting and boot now',
 >not abort as in 'stop counting and give me a prompt',
 >as opposed to 'continue counting but ignore the keyboard'.

 abort as in "stop counting and give me the boot prompt".  like the
 space bar.

 not abort as in "skip counting and boot".  like return.

 certainly not "keep counting and ignore me from now on".  which is
 what it does now.

 -- 
 |-----< "CODE WARRIOR" >-----|
 codewarrior@daemon.org             * "ah!  i see you have the internet
 twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
 andrew@crossbar.com       * "information is power -- share the wealth."

From: David Laight <david@l8s.co.uk>
To: Cc: netbsd-bugs@netbsd.org, gnats-bugs@gnats.netbsd.org
Subject: Re: port-i386/17865: i386 boot-blocks hate function keys
Date: Wed, 7 Aug 2002 18:46:29 +0100

 > 1) Abort as in 'stop counting and boot now',
 >    not abort as in 'stop counting and give me a prompt',
 > 2) as opposed to 'continue counting but ignore the keyboard'.

 Ok it does (2) first due to a bug in coniskey, then (1) due
 to the previously mentioned but in awaitkey.

 Fix to (2) is:

 dsl@snowdrop:-ksh$ cvs diff conio.S
 Index: conio.S
 ===================================================================
 RCS file: /cvsroot/syssrc/sys/arch/i386/stand/lib/conio.S,v
 retrieving revision 1.1.1.1
 diff -u -r1.1.1.1 conio.S
 --- conio.S     1997/03/14 02:40:32     1.1.1.1
 +++ conio.S     2002/08/07 17:38:09
 @@ -85,8 +85,9 @@
         movb    $0x1,%ah
         int     $0x16
         data32
 +       movb    $0,%bl
         jz      1f
 -       movb    %al,%bl
 +       incb    %bl
  1:

 	data32

 The int16(ah=1) call returns status in the 'z' flag,
 the contents of al are either undefined or are the value of
 the key.  Who knows what was in bl (when al wasn't copied there)
 - possible the 0 setup before the int16 call...

 Anywhat the explicit checks above are fine.

 	David

 -- 
 David Laight: david@l8s.co.uk

From: David Laight <david@l8s.co.uk>
To: Cc: netbsd-bugs@netbsd.org, gnats-bugs@gnats.netbsd.org
Subject: Re: port-i386/17865: i386 boot-blocks hate function keys
Date: Wed, 7 Aug 2002 19:03:33 +0100

 On Wed, Aug 07, 2002 at 06:46:29PM +0100, David Laight wrote:
 > > 1) Abort as in 'stop counting and boot now',
 > >    not abort as in 'stop counting and give me a prompt',
 > > 2) as opposed to 'continue counting but ignore the keyboard'.

 I've just put the fixed versions of conio.S and pcio.c onto
 my webspace (www.l8s.co.uk then netbsd/boot/*).

 If you trust me there is a copy of biosboot.sym that contains
 the fixes (and some other enhancements - eg wildcards in
 directory listings).
 + my latest fdisk and mbr_bootsel code.

 	David

 -- 
 David Laight: david@l8s.co.uk
State-Changed-From-To: open->closed 
State-Changed-By: dsl 
State-Changed-When: Wed Apr 30 22:19:20 UTC 2003 
State-Changed-Why:  
Both fixes were committed recently 
>Unformatted:

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.