Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/stand/mbr Remove the functionality added in re...



details:   https://anonhg.NetBSD.org/src/rev/3a2779c1dd8d
branches:  trunk
changeset: 569722:3a2779c1dd8d
user:      dsl <dsl%NetBSD.org@localhost>
date:      Wed Sep 01 20:31:20 2004 +0000

description:
Remove the functionality added in rev 1.7.
With no menu items the mbr_bootsel code will wait for the timeout (default
10 seconds) and then boot the default device - usually the active partition.
Forcing the 'active' partition was wrong - jmmv has a system which needs
to boot from hd1 where hd0 has no mbr partition info.
I suspect the problem I though rev 1.7 fixed was actually caused by
disklabel copying sector zero of the disk to sector zero of the partition!
Gains another 9 bytes of free space, mbr_bootsel now has 20 free bytes.

diffstat:

 sys/arch/i386/stand/mbr/mbr.S |  21 +++++++--------------
 1 files changed, 7 insertions(+), 14 deletions(-)

diffs (49 lines):

diff -r b938c9635817 -r 3a2779c1dd8d sys/arch/i386/stand/mbr/mbr.S
--- a/sys/arch/i386/stand/mbr/mbr.S     Wed Sep 01 19:38:09 2004 +0000
+++ b/sys/arch/i386/stand/mbr/mbr.S     Wed Sep 01 20:31:20 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mbr.S,v 1.9 2004/08/14 21:03:23 dsl Exp $      */
+/*     $NetBSD: mbr.S,v 1.10 2004/09/01 20:31:20 dsl Exp $     */
 
 /*
  * Copyright (c) 1999-2004 The NetBSD Foundation, Inc. 
@@ -215,20 +215,13 @@
 #endif
 
 /*
- * If we haven't output any menu entries, then the system sits waiting
- * for a keypress with the user looking at a blank screen wondering
- * why nothing is happening.
- * To stop this we generate <ENTER> - to boot the active partition
- * if we haven't output any menu texts.
- * The non-bootsel code also traverses this code path.
+ * The non-bootsel code traverses this code path, it needs the
+ * correct keycode to select the active partition.
  */
 
 #ifndef BOOTSEL
-       movb    $SCAN_ENTER - SCAN_F1, %al
+       mov     $SCAN_ENTER - SCAN_F1, %ax
 #else
-       movb    $SCAN_ENTER, %al        /* default to active partition */
-       cmpb    $'0', prefix            /* did we output a menu ? */
-       je      check_key               /* Nope - process SCAN_ENTER */
 /*
  * Get the initial time value for the timeout comparison. It is returned
  * by int 1a in cx:dx. We do sums modulo 2^16 so it doesn't matter if
@@ -252,12 +245,12 @@
        cmpw    timeout, %dx            /* always wait for 1 tick... */
        jbe     3b                      /* 0xffff means never timeout */
 def_key:
-       movb    defkey, %al             /* timedout - pick default key */
-       jmp     check_key
+       mov     defkey - 1, %ax         /* timedout - get default key to %ah */
+       jmp     4f
 get_key:
        xorb    %ah, %ah
        int     $0x16                   /* 'read key', code ah, ascii al */
-       shr     $8, %ax                 /* code in %al, %ah zero */
+4:     shr     $8, %ax                 /* code in %al, %ah zero */
 
 /*
  * We have a keycode, see what it means.



Home | Main Index | Thread Index | Old Index