Source-Changes-HG archive

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

[src/trunk]: src Revert yesterday's change that attempted to fix the detectio...



details:   https://anonhg.NetBSD.org/src/rev/903cfdd47da0
branches:  trunk
changeset: 587953:903cfdd47da0
user:      jmmv <jmmv%NetBSD.org@localhost>
date:      Sat Feb 04 11:24:42 2006 +0000

description:
Revert yesterday's change that attempted to fix the detection of the
boot device when using a Multiboot boot loader.  It couldn't work because
these boot loaders do not pass a checksum of the disk so matchbiosdisk()
cannot really find any matches.  I should have gone to sleep before
commiting...

Found by xtraeme@.

diffstat:

 distrib/sets/lists/comp/md.amd64  |   6 ++--
 distrib/sets/lists/comp/md.i386   |   6 ++--
 sys/arch/amd64/amd64/autoconf.c   |  14 +----------
 sys/arch/amd64/include/Makefile   |   4 +-
 sys/arch/amd64/include/autoconf.h |   3 --
 sys/arch/i386/i386/autoconf.c     |  19 +--------------
 sys/arch/i386/i386/multiboot.c    |  46 +++++++++++---------------------------
 sys/arch/i386/include/Makefile    |   4 +-
 sys/arch/i386/include/autoconf.h  |   3 --
 sys/arch/i386/include/multiboot.h |   3 +-
 sys/arch/x86/include/Makefile     |   4 +-
 sys/arch/x86/include/autoconf.h   |  10 --------
 sys/arch/x86/x86/x86_autoconf.c   |  40 ++++-----------------------------
 13 files changed, 36 insertions(+), 126 deletions(-)

diffs (truncated from 388 to 300 lines):

diff -r 4834b8397cec -r 903cfdd47da0 distrib/sets/lists/comp/md.amd64
--- a/distrib/sets/lists/comp/md.amd64  Sat Feb 04 11:23:45 2006 +0000
+++ b/distrib/sets/lists/comp/md.amd64  Sat Feb 04 11:24:42 2006 +0000
@@ -1,10 +1,10 @@
-# $NetBSD: md.amd64,v 1.18 2006/02/03 23:33:30 jmmv Exp $
+# $NetBSD: md.amd64,v 1.19 2006/02/04 11:24:42 jmmv Exp $
 ./usr/include/amd64                            comp-c-include
 ./usr/include/amd64/ansi.h                     comp-c-include
 ./usr/include/amd64/aout_machdep.h             comp-c-include
 ./usr/include/amd64/asm.h                      comp-c-include
 ./usr/include/amd64/atomic.h                   comp-c-include
-./usr/include/amd64/autoconf.h                 comp-c-include
+./usr/include/amd64/autoconf.h                 comp-obsolete           obsolete
 ./usr/include/amd64/bootinfo.h                 comp-c-include
 ./usr/include/amd64/bswap.h                    comp-c-include
 ./usr/include/amd64/bus.h                      comp-c-include
@@ -126,7 +126,7 @@
 ./usr/include/x64_64/vmparam.h                 comp-obsolete           obsolete
 ./usr/include/x86                              comp-c-include
 ./usr/include/x86/aout_machdep.h               comp-c-include
-./usr/include/x86/autoconf.h                   comp-c-include
+./usr/include/x86/autoconf.h                   comp-obsolete           obsolete
 ./usr/include/x86/bootinfo.h                   comp-c-include
 ./usr/include/x86/bus.h                                comp-c-include
 ./usr/include/x86/cacheinfo.h                  comp-c-include
diff -r 4834b8397cec -r 903cfdd47da0 distrib/sets/lists/comp/md.i386
--- a/distrib/sets/lists/comp/md.i386   Sat Feb 04 11:23:45 2006 +0000
+++ b/distrib/sets/lists/comp/md.i386   Sat Feb 04 11:24:42 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: md.i386,v 1.89 2006/02/03 23:33:30 jmmv Exp $
+# $NetBSD: md.i386,v 1.90 2006/02/04 11:24:42 jmmv Exp $
 ./usr/include/emmintrin.h                      comp-c-include          gcccmds
 ./usr/include/i386                             comp-c-include
 ./usr/include/i386/_G_config.h                 comp-obsolete           obsolete
@@ -7,7 +7,7 @@
 ./usr/include/i386/apmvar.h                    comp-c-include
 ./usr/include/i386/asm.h                       comp-c-include
 ./usr/include/i386/atomic.h                    comp-c-include
-./usr/include/i386/autoconf.h                  comp-c-include
+./usr/include/i386/autoconf.h                  comp-obsolete           obsolete
 ./usr/include/i386/bioscall.h                  comp-c-include
 ./usr/include/i386/bootinfo.h                  comp-c-include
 ./usr/include/i386/bswap.h                     comp-c-include
@@ -80,7 +80,7 @@
 ./usr/include/pmc.h                            comp-c-include
 ./usr/include/x86                              comp-c-include
 ./usr/include/x86/aout_machdep.h               comp-c-include
-./usr/include/x86/autoconf.h                   comp-c-include
+./usr/include/x86/autoconf.h                   comp-obsolete           obsolete
 ./usr/include/x86/bootinfo.h                   comp-c-include
 ./usr/include/x86/bus.h                                comp-c-include
 ./usr/include/x86/cacheinfo.h                  comp-c-include
diff -r 4834b8397cec -r 903cfdd47da0 sys/arch/amd64/amd64/autoconf.c
--- a/sys/arch/amd64/amd64/autoconf.c   Sat Feb 04 11:23:45 2006 +0000
+++ b/sys/arch/amd64/amd64/autoconf.c   Sat Feb 04 11:24:42 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.13 2006/02/03 23:33:31 jmmv Exp $       */
+/*     $NetBSD: autoconf.c,v 1.14 2006/02/04 11:24:42 jmmv Exp $       */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.13 2006/02/03 23:33:31 jmmv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.14 2006/02/04 11:24:42 jmmv Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -54,7 +54,6 @@
 #include <sys/systm.h>
 #include <sys/buf.h>
 
-#include <machine/autoconf.h>
 #include <machine/pte.h>
 #include <machine/cpu.h>
 
@@ -108,12 +107,3 @@
        spl0();
        lcr8(0);
 }
-
-void
-cpu_rootconf(void)
-{
-
-       x86_matchbiosdisks();
-
-       x86_cpu_rootconf();
-}
diff -r 4834b8397cec -r 903cfdd47da0 sys/arch/amd64/include/Makefile
--- a/sys/arch/amd64/include/Makefile   Sat Feb 04 11:23:45 2006 +0000
+++ b/sys/arch/amd64/include/Makefile   Sat Feb 04 11:24:42 2006 +0000
@@ -1,8 +1,8 @@
-#      $NetBSD: Makefile,v 1.5 2006/02/03 23:33:31 jmmv Exp $
+#      $NetBSD: Makefile,v 1.6 2006/02/04 11:24:42 jmmv Exp $
 
 INCSDIR= /usr/include/amd64
 
-INCS=  ansi.h aout_machdep.h autoconf.h asm.h atomic.h \
+INCS=  ansi.h aout_machdep.h asm.h atomic.h \
        bootinfo.h bswap.h bus.h byte_swap.h \
        cdefs.h cpu.h cpufunc.h \
        disklabel.h \
diff -r 4834b8397cec -r 903cfdd47da0 sys/arch/amd64/include/autoconf.h
--- a/sys/arch/amd64/include/autoconf.h Sat Feb 04 11:23:45 2006 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-/*     $NetBSD: autoconf.h,v 1.1 2006/02/03 23:33:31 jmmv Exp $        */
-
-#include <x86/autoconf.h>
diff -r 4834b8397cec -r 903cfdd47da0 sys/arch/i386/i386/autoconf.c
--- a/sys/arch/i386/i386/autoconf.c     Sat Feb 04 11:23:45 2006 +0000
+++ b/sys/arch/i386/i386/autoconf.c     Sat Feb 04 11:24:42 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.82 2006/02/03 23:33:30 jmmv Exp $       */
+/*     $NetBSD: autoconf.c,v 1.83 2006/02/04 11:24:42 jmmv Exp $       */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.82 2006/02/03 23:33:30 jmmv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.83 2006/02/04 11:24:42 jmmv Exp $");
 
 #include "opt_compat_oldboot.h"
 #include "opt_multiprocessor.h"
@@ -57,8 +57,6 @@
 #include <sys/proc.h>
 #include <sys/user.h>
 
-#include <machine/autoconf.h>
-#include <machine/multiboot.h>
 #include <machine/pte.h>
 #include <machine/cpu.h>
 #include <machine/gdt.h>
@@ -137,16 +135,3 @@
        lapic_tpr = 0;
 #endif
 }
-
-void
-cpu_rootconf(void)
-{
-
-       x86_matchbiosdisks();
-
-#ifdef MULTIBOOT
-       multiboot_pre_findroot();
-#endif
-
-       x86_cpu_rootconf();
-}
diff -r 4834b8397cec -r 903cfdd47da0 sys/arch/i386/i386/multiboot.c
--- a/sys/arch/i386/i386/multiboot.c    Sat Feb 04 11:23:45 2006 +0000
+++ b/sys/arch/i386/i386/multiboot.c    Sat Feb 04 11:24:42 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: multiboot.c,v 1.2 2006/02/03 23:33:30 jmmv Exp $       */
+/*     $NetBSD: multiboot.c,v 1.3 2006/02/04 11:24:42 jmmv Exp $       */
 
 /*-
  * Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: multiboot.c,v 1.2 2006/02/03 23:33:30 jmmv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: multiboot.c,v 1.3 2006/02/04 11:24:42 jmmv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -47,7 +47,6 @@
 #include <sys/exec_elf.h>
 #include <sys/optstr.h>
 
-#include <machine/autoconf.h>
 #include <machine/bootinfo.h>
 #include <machine/multiboot.h>
 
@@ -196,6 +195,7 @@
        setup_howto(mi);
        setup_bootpath(mi);
        setup_biosgeom(mi);
+       setup_bootdisk(mi);
        setup_memmap(mi);
        setup_syms(mi);
 }
@@ -203,28 +203,6 @@
 /* --------------------------------------------------------------------- */
 
 /*
- * Sets up the kernel if it was booted by a Multiboot-compliant boot
- * loader.  This is executed before calling findroot() in cpu_rootconf().
- * At this point, there is not much more to do.  We only seize this call
- * to set up the default root device because all device drivers have
- * already been initialized and are available for us to use.
- */
-void
-multiboot_pre_findroot(void)
-{
-       struct multiboot_info *mi;
-       
-       if (! Multiboot_Loader)
-               return;
-
-       mi = &Multiboot_Info;
-
-       setup_bootdisk(mi);
-}
-
-/* --------------------------------------------------------------------- */
-
-/*
  * Prints a summary of the information collected in the Multiboot
  * information header (if present).  Done as a separate function because
  * the console has to be available.
@@ -495,13 +473,17 @@
        if (!found && (mi->mi_flags & MULTIBOOT_INFO_HAS_BOOT_DEVICE)) {
                const char *devprefix;
 
-               devprefix = x86_findbiosdisk(mi->mi_boot_device_drive);
-               if (devprefix == NULL) {
-                       switch (mi->mi_boot_device_drive) {
-                       case 0x00:      devprefix = "fd0";      break;
-                       case 0x01:      devprefix = "fd1";      break;
-                       default:        devprefix = "";
-                       }
+               /* XXX: This should use x86_alldisks to find the correct
+                * match.  But, at this point, neither the drivers nor the
+                * vector are initialized... */
+               switch (mi->mi_boot_device_drive) {
+               case 0x00:      devprefix = "fd0";      break;
+               case 0x01:      devprefix = "fd1";      break;
+               case 0x80:      devprefix = "wd0";      break;
+               case 0x81:      devprefix = "wd1";      break;
+               case 0x82:      devprefix = "wd2";      break;
+               case 0x83:      devprefix = "wd3";      break;
+               default:        devprefix = "";
                }
 
                if (devprefix[0] != '\0') {
diff -r 4834b8397cec -r 903cfdd47da0 sys/arch/i386/include/Makefile
--- a/sys/arch/i386/include/Makefile    Sat Feb 04 11:23:45 2006 +0000
+++ b/sys/arch/i386/include/Makefile    Sat Feb 04 11:24:42 2006 +0000
@@ -1,8 +1,8 @@
-#      $NetBSD: Makefile,v 1.31 2006/02/03 23:33:30 jmmv Exp $
+#      $NetBSD: Makefile,v 1.32 2006/02/04 11:24:42 jmmv Exp $
 
 INCSDIR= /usr/include/i386
 
-INCS=  ansi.h aout_machdep.h autoconf.h apmvar.h asm.h atomic.h \
+INCS=  ansi.h aout_machdep.h apmvar.h asm.h atomic.h \
        bioscall.h bootinfo.h bswap.h byte_swap.h bus.h \
        cdefs.h cpu.h cpufunc.h cputypes.h \
        db_machdep.h disklabel.h \
diff -r 4834b8397cec -r 903cfdd47da0 sys/arch/i386/include/autoconf.h
--- a/sys/arch/i386/include/autoconf.h  Sat Feb 04 11:23:45 2006 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-/*     $NetBSD: autoconf.h,v 1.1 2006/02/03 23:33:30 jmmv Exp $        */
-
-#include <x86/autoconf.h>
diff -r 4834b8397cec -r 903cfdd47da0 sys/arch/i386/include/multiboot.h
--- a/sys/arch/i386/include/multiboot.h Sat Feb 04 11:23:45 2006 +0000
+++ b/sys/arch/i386/include/multiboot.h Sat Feb 04 11:24:42 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: multiboot.h,v 1.2 2006/02/03 23:33:30 jmmv Exp $       */
+/*     $NetBSD: multiboot.h,v 1.3 2006/02/04 11:24:42 jmmv Exp $       */
 
 /*-
  * Copyright (c) 2005, 2006 The NetBSD Foundation, Inc.
@@ -208,7 +208,6 @@
 #if !defined(_LOCORE)
 void           multiboot_pre_reloc(struct multiboot_info *);
 void           multiboot_post_reloc(void);
-void           multiboot_pre_findroot(void);
 void           multiboot_print_info(void);
 #endif /* !defined(_LOCORE) */
 
diff -r 4834b8397cec -r 903cfdd47da0 sys/arch/x86/include/Makefile
--- a/sys/arch/x86/include/Makefile     Sat Feb 04 11:23:45 2006 +0000
+++ b/sys/arch/x86/include/Makefile     Sat Feb 04 11:24:42 2006 +0000
@@ -1,8 +1,8 @@
-#      $NetBSD: Makefile,v 1.6 2006/02/03 23:33:30 jmmv Exp $
+#      $NetBSD: Makefile,v 1.7 2006/02/04 11:24:42 jmmv Exp $
 
 INCSDIR=/usr/include/x86
 
-INCS=  aout_machdep.h autoconf.h \
+INCS=  aout_machdep.h \
        bootinfo.h bus.h \
        cacheinfo.h \
        cpuvar.h \
diff -r 4834b8397cec -r 903cfdd47da0 sys/arch/x86/include/autoconf.h
--- a/sys/arch/x86/include/autoconf.h   Sat Feb 04 11:23:45 2006 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@



Home | Main Index | Thread Index | Old Index