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 g/c COMPAT_OLDBOOT from bootblocks, spri...



details:   https://anonhg.NetBSD.org/src/rev/4ebdfec3f7b7
branches:  trunk
changeset: 510581:4ebdfec3f7b7
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Fri Jun 01 23:26:30 2001 +0000

description:
g/c COMPAT_OLDBOOT from bootblocks, sprinkle some const
bump bootblock version to 2.10

diffstat:

 sys/arch/i386/stand/biosboot/Makefile     |   4 +-
 sys/arch/i386/stand/biosboot/devopen.c    |  78 ++++----------------------
 sys/arch/i386/stand/biosboot/main.c       |  18 ++---
 sys/arch/i386/stand/biosboot/version      |   3 +-
 sys/arch/i386/stand/biosboot_ser/Makefile |   4 +-
 sys/arch/i386/stand/dosboot/Makefile      |   4 +-
 sys/arch/i386/stand/dosboot/devopen.c     |   5 +-
 sys/arch/i386/stand/dosboot/main.c        |   6 +-
 sys/arch/i386/stand/lib/biosdisk.c        |  18 +-----
 sys/arch/i386/stand/lib/exec.c            |  93 +------------------------------
 sys/arch/i386/stand/lib/libi386.h         |   7 +-
 sys/arch/i386/stand/netboot/Makefile      |   3 +-
 sys/arch/i386/stand/netboot/main.c        |  22 +-------
 13 files changed, 38 insertions(+), 227 deletions(-)

diffs (truncated from 545 to 300 lines):

diff -r a29a7ce8b581 -r 4ebdfec3f7b7 sys/arch/i386/stand/biosboot/Makefile
--- a/sys/arch/i386/stand/biosboot/Makefile     Fri Jun 01 23:02:55 2001 +0000
+++ b/sys/arch/i386/stand/biosboot/Makefile     Fri Jun 01 23:26:30 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.36 2001/05/19 18:15:14 jdolecek Exp $
+#      $NetBSD: Makefile,v 1.37 2001/06/01 23:26:30 jdolecek Exp $
 
 S=     ${.CURDIR}/../../../../
 
@@ -15,7 +15,7 @@
 
 CLEANFILES+= ${BSSTART}
 
-CPPFLAGS+= -DCOMPAT_OLDBOOT -DCOMPAT_386BSD_MBRPART -DSUPPORT_PS2
+CPPFLAGS+= -DCOMPAT_386BSD_MBRPART -DSUPPORT_PS2
 
 .if (${BASE} == "biosboot")
 # Various serial line configurations
diff -r a29a7ce8b581 -r 4ebdfec3f7b7 sys/arch/i386/stand/biosboot/devopen.c
--- a/sys/arch/i386/stand/biosboot/devopen.c    Fri Jun 01 23:02:55 2001 +0000
+++ b/sys/arch/i386/stand/biosboot/devopen.c    Fri Jun 01 23:26:30 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: devopen.c,v 1.10 2001/05/19 18:15:14 jdolecek Exp $     */
+/*     $NetBSD: devopen.c,v 1.11 2001/06/01 23:26:30 jdolecek Exp $     */
 
 /*
  * Copyright (c) 1996, 1997
@@ -33,9 +33,6 @@
 
 
 #include <sys/types.h>
-#ifdef COMPAT_OLDBOOT
-#include <sys/disklabel.h>
-#endif
 
 #include <lib/libsa/stand.h>
 #include <lib/libkern/libkern.h>
@@ -50,51 +47,19 @@
 #include <biosmca.h>
 #endif
 
-extern int parsebootfile __P((const char *, char**, char**, unsigned int*,
-                             unsigned int*, const char**));
-
-static int dev2bios __P((char *, unsigned int, int *));
+static __inline int dev2bios __P((char *, unsigned int, int *));
 
-static struct {
-       char           *name;
-       int             biosdev;
-}               biosdevtab[] = {
-       {
-               "fd", 0
-       },
-       {
-               "hd", 0x80
-       },
-#ifdef COMPAT_OLDBOOT
-       {
-               "wd", 0x80
-       },
-       {
-               "sd", 0x80
-       },
-#ifdef SUPPORT_PS2
-       {
-               "ed", 0x80
-       }
-#endif /* SUPPORT_PS2 */
-#endif /* COMPAT_OLDBOOT */
-};
-#define NUMBIOSDEVS (sizeof(biosdevtab) / sizeof(biosdevtab[0]))
-
-static int
+static __inline int
 dev2bios(devname, unit, biosdev)
        char           *devname;
        unsigned int    unit;
        int            *biosdev;
 {
-       int             i;
-
-       for (i = 0; i < NUMBIOSDEVS; i++)
-               if (!strcmp(devname, biosdevtab[i].name)) {
-                       *biosdev = biosdevtab[i].biosdev + unit;
-                       break;
-               }
-       if (i == NUMBIOSDEVS)
+       if (strcmp(devname, "hd") == 0)
+               *biosdev = 0x80 + unit;
+       else if (strcmp(devname, "fd") == 0)
+               *biosdev = 0x00 + unit;
+       else
                return (ENXIO);
 
        return (0);
@@ -106,30 +71,11 @@
        char          **devname;
        unsigned int   *unit;
 {
-       u_int8_t devidx;
-
-       if (biosdev & 0x80) {
-#if defined(COMPAT_OLDBOOT) && defined(_STANDALONE)
-               extern struct disklabel disklabel;
+       if (biosdev & 0x80)
+               *devname = "hd";
+       else
+               *devname = "fd";
 
-               if (disklabel.d_magic == DISKMAGIC) {
-                       if (disklabel.d_type == DTYPE_SCSI)
-                               devidx = 3;
-#ifdef SUPPORT_PS2
-                       else if (disklabel.d_type == DTYPE_ESDI
-                                && biosmca_ps2model)
-                               devidx = 4;
-#endif
-                       else
-                               devidx = 2;
-               } else
-#endif
-                       /* call it "hd", we don't know better */
-                       devidx = 1;
-       } else
-               devidx = 0;
-
-       *devname = biosdevtab[devidx].name;
        *unit = biosdev & 0x7f;
 
        return (0);
diff -r a29a7ce8b581 -r 4ebdfec3f7b7 sys/arch/i386/stand/biosboot/main.c
--- a/sys/arch/i386/stand/biosboot/main.c       Fri Jun 01 23:02:55 2001 +0000
+++ b/sys/arch/i386/stand/biosboot/main.c       Fri Jun 01 23:26:30 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.25 2001/05/19 18:15:14 jdolecek Exp $       */
+/*     $NetBSD: main.c,v 1.26 2001/06/01 23:26:30 jdolecek Exp $       */
 
 /*
  * Copyright (c) 1996, 1997, 1999
@@ -54,10 +54,10 @@
 int errno;
 extern int boot_biosdev;
 
-extern char bootprog_name[], bootprog_rev[], bootprog_date[],
+extern const char bootprog_name[], bootprog_rev[], bootprog_date[],
        bootprog_maker[];
 
-char *names[] = {
+static const char * const names[] = {
     "netbsd", "netbsd.gz",
     "netbsd.old", "netbsd.old.gz",
     "onetbsd", "onetbsd.gz",
@@ -76,7 +76,7 @@
 
 static char *default_devname;
 static int default_unit, default_partition;
-static char *default_filename;
+static const char *default_filename;
 
 char *sprint_bootsel __P((const char *));
 void bootit __P((const char *, int, int));
@@ -90,7 +90,7 @@
 void   command_dev __P((char *));
 void   command_consdev __P((char *));
 
-struct bootblk_command commands[] = {
+const struct bootblk_command commands[] = {
        { "help",       command_help },
        { "?",          command_help },
        { "ls",         command_ls },
@@ -256,11 +256,7 @@
        /* if the user types "boot" without filename */
        default_filename = DEFFILENAME;
 
-       printf(
-#ifdef COMPAT_OLDBOOT
-              "Use hd1a:netbsd to boot sd0 when wd0 is also installed\n"
-#endif
-              "Press return to boot now, any other key for boot menu\n");
+       printf("Press return to boot now, any other key for boot menu\n");
        currname = 0;
        for (;;) {
                printf("booting %s - starting in ",
@@ -315,7 +311,7 @@
 command_ls(arg)
        char *arg;
 {
-       char *save = default_filename;
+       const char *save = default_filename;
 
        default_filename = "/";
        ufs_ls(arg);
diff -r a29a7ce8b581 -r 4ebdfec3f7b7 sys/arch/i386/stand/biosboot/version
--- a/sys/arch/i386/stand/biosboot/version      Fri Jun 01 23:02:55 2001 +0000
+++ b/sys/arch/i386/stand/biosboot/version      Fri Jun 01 23:26:30 2001 +0000
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.10 2001/05/19 18:15:14 jdolecek Exp $
+$NetBSD: version,v 1.11 2001/06/01 23:26:30 jdolecek Exp $
 
 NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE.  The format of this
 file is important - make sure the entries are appended on end, last item
@@ -18,3 +18,4 @@
 2.9:   Recognize PS/2 L40 at runtime and use appropriate gate A20
        initialization (rather than using a compile flag).
        Recognize ESDI disks and identify them as ed(4) for COMPAT_OLDBOOT.
+2.10:  g/c COMPAT_OLDBOOT
diff -r a29a7ce8b581 -r 4ebdfec3f7b7 sys/arch/i386/stand/biosboot_ser/Makefile
--- a/sys/arch/i386/stand/biosboot_ser/Makefile Fri Jun 01 23:02:55 2001 +0000
+++ b/sys/arch/i386/stand/biosboot_ser/Makefile Fri Jun 01 23:26:30 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.6 2001/03/31 09:45:12 hubertf Exp $
+#      $NetBSD: Makefile,v 1.7 2001/06/01 23:26:31 jdolecek Exp $
 
 S=     ${.CURDIR}/../../../../
 
@@ -12,7 +12,7 @@
 
 CLEANFILES+= ${BSSTART}
 
-CPPFLAGS+= -DCOMPAT_OLDBOOT -DCOMPAT_386BSD_MBRPART -DDEBUG
+CPPFLAGS+= -DCOMPAT_386BSD_MBRPART -DDEBUG
 
 #Sample use of serial line debugger
 #CPPFLAGS+= -DSUPPORT_SERIAL=CONSDEV_COM0KBD
diff -r a29a7ce8b581 -r 4ebdfec3f7b7 sys/arch/i386/stand/dosboot/Makefile
--- a/sys/arch/i386/stand/dosboot/Makefile      Fri Jun 01 23:02:55 2001 +0000
+++ b/sys/arch/i386/stand/dosboot/Makefile      Fri Jun 01 23:26:30 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.17 2000/10/15 22:42:49 wiz Exp $
+#      $NetBSD: Makefile,v 1.18 2001/06/01 23:26:31 jdolecek Exp $
 
 S=     ${.CURDIR}/../../../../
 
@@ -11,7 +11,7 @@
 
 CLEANFILES+= ${DOSSTART} ${BASE}.sym
 
-CPPFLAGS+= -DCOMPAT_OLDBOOT -DCOMPAT_386BSD_MBRPART
+CPPFLAGS+= -DCOMPAT_386BSD_MBRPART
 CPPFLAGS+= -DXMS
 #uncomment if there are problems with memory detection
 #CPPFLAGS+= -DCONSERVATIVE_MEMDETECT
diff -r a29a7ce8b581 -r 4ebdfec3f7b7 sys/arch/i386/stand/dosboot/devopen.c
--- a/sys/arch/i386/stand/dosboot/devopen.c     Fri Jun 01 23:02:55 2001 +0000
+++ b/sys/arch/i386/stand/dosboot/devopen.c     Fri Jun 01 23:26:30 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: devopen.c,v 1.4 1999/04/14 11:53:44 drochner Exp $      */
+/*     $NetBSD: devopen.c,v 1.5 2001/06/01 23:26:31 jdolecek Exp $      */
 
 /*
  * Copyright (c) 1996
@@ -41,9 +41,6 @@
 #include <dosfile.h>
 #include <bootinfo.h>
 
-extern int parsebootfile __P((const char *, char**, char**, unsigned int*,
-                             unsigned int*, const char**));
-
 struct devsw devsw[] = {
        {"disk", biosdiskstrategy, biosdiskopen, biosdiskclose, biosdiskioctl},
 };
diff -r a29a7ce8b581 -r 4ebdfec3f7b7 sys/arch/i386/stand/dosboot/main.c
--- a/sys/arch/i386/stand/dosboot/main.c        Fri Jun 01 23:02:55 2001 +0000
+++ b/sys/arch/i386/stand/dosboot/main.c        Fri Jun 01 23:26:30 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.16 2000/09/24 18:28:21 jdolecek Exp $        */
+/*     $NetBSD: main.c,v 1.17 2001/06/01 23:26:31 jdolecek Exp $        */
 
 /*
  * Copyright (c) 1996, 1997
@@ -64,6 +64,8 @@
 static void bootit __P((const char *, int, int));
 void usage __P((void));
 int main __P((int, char **));
+int parsebootfile __P((const char *, char**, char**, unsigned int*,
+                             unsigned int*, const char**));
 
 void   command_help __P((char *));
 void   command_ls __P((char *));
@@ -72,7 +74,7 @@
 void   command_mode __P((char *));
 void   command_dev __P((char *));
 
-struct bootblk_command commands[] = {
+const struct bootblk_command commands[] = {
        { "help",       command_help },
        { "?",          command_help },
        { "ls",         command_ls },
diff -r a29a7ce8b581 -r 4ebdfec3f7b7 sys/arch/i386/stand/lib/biosdisk.c
--- a/sys/arch/i386/stand/lib/biosdisk.c        Fri Jun 01 23:02:55 2001 +0000
+++ b/sys/arch/i386/stand/lib/biosdisk.c        Fri Jun 01 23:26:30 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: biosdisk.c,v 1.13 2000/10/30 07:30:59 lukem Exp $      */
+/*     $NetBSD: biosdisk.c,v 1.14 2001/06/01 23:26:31 jdolecek Exp $   */
 
 /*
  * Copyright (c) 1996, 1998
@@ -85,9 +85,6 @@
 



Home | Main Index | Thread Index | Old Index