g/c COMPAT_OLDBOOT from bootblocks, sprinkle some const
bump bootblock version to 2.10
This commit is contained in:
parent
09afb2735c
commit
b001ce9b90
@ -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 @@ SRCS= main.c devopen.c conf.c exec.c
|
||||
|
||||
CLEANFILES+= ${BSSTART}
|
||||
|
||||
CPPFLAGS+= -DCOMPAT_OLDBOOT -DCOMPAT_386BSD_MBRPART -DSUPPORT_PS2
|
||||
CPPFLAGS+= -DCOMPAT_386BSD_MBRPART -DSUPPORT_PS2
|
||||
|
||||
.if (${BASE} == "biosboot")
|
||||
# Various serial line configurations
|
||||
|
@ -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 __inline int dev2bios __P((char *, unsigned int, int *));
|
||||
|
||||
static 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 @@ bios2dev(biosdev, devname, unit)
|
||||
char **devname;
|
||||
unsigned int *unit;
|
||||
{
|
||||
u_int8_t devidx;
|
||||
|
||||
if (biosdev & 0x80) {
|
||||
#if defined(COMPAT_OLDBOOT) && defined(_STANDALONE)
|
||||
extern struct disklabel disklabel;
|
||||
|
||||
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
|
||||
if (biosdev & 0x80)
|
||||
*devname = "hd";
|
||||
else
|
||||
devidx = 2;
|
||||
} else
|
||||
#endif
|
||||
/* call it "hd", we don't know better */
|
||||
devidx = 1;
|
||||
} else
|
||||
devidx = 0;
|
||||
*devname = "fd";
|
||||
|
||||
*devname = biosdevtab[devidx].name;
|
||||
*unit = biosdev & 0x7f;
|
||||
|
||||
return (0);
|
||||
|
@ -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 @@ int boottimeout = TIMEOUT; /* patchable */
|
||||
|
||||
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_boot __P((char *));
|
||||
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 @@ main()
|
||||
/* 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 @@ void
|
||||
command_ls(arg)
|
||||
char *arg;
|
||||
{
|
||||
char *save = default_filename;
|
||||
const char *save = default_filename;
|
||||
|
||||
default_filename = "/";
|
||||
ufs_ls(arg);
|
||||
|
@ -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 @@ is taken as the current.
|
||||
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
|
||||
|
@ -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 @@ SRCS= main.c devopen.c conf.c exec.c
|
||||
|
||||
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
|
||||
|
@ -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 @@ SRCS= main.c devopen.c exec.c
|
||||
|
||||
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
|
||||
|
@ -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},
|
||||
};
|
||||
|
@ -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 @@ char *sprint_bootsel __P((const char *));
|
||||
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_boot __P((char *));
|
||||
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 },
|
||||
|
@ -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 @@
|
||||
|
||||
struct biosdisk {
|
||||
struct biosdisk_ll ll;
|
||||
#ifdef COMPAT_OLDBOOT
|
||||
int disktype;
|
||||
#endif
|
||||
int boff;
|
||||
char buf[BUFSIZE];
|
||||
};
|
||||
@ -138,16 +135,6 @@ biosdiskstrategy(devdata, flag, dblk, size, buf, rsize)
|
||||
return (0);
|
||||
}
|
||||
|
||||
#ifdef COMPAT_OLDBOOT
|
||||
int
|
||||
biosdisk_gettype(f)
|
||||
struct open_file *f;
|
||||
{
|
||||
struct biosdisk *d = f->f_devdata;
|
||||
return (d->disktype);
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
biosdiskopen(struct open_file *f, ...)
|
||||
/* file, biosdev, partition */
|
||||
@ -260,9 +247,6 @@ biosdiskopen(struct open_file *f, ...)
|
||||
d->boff = lp->d_partitions[partition].p_offset;
|
||||
if (lp->d_partitions[partition].p_fstype == FS_RAID)
|
||||
d->boff += RF_PROTECTED_SECTORS;
|
||||
#ifdef COMPAT_OLDBOOT
|
||||
d->disktype = lp->d_type;
|
||||
#endif
|
||||
#ifdef _STANDALONE
|
||||
bi_disk.labelsector = sector + LABELSECTOR;
|
||||
bi_disk.label.type = lp->d_type;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: exec.c,v 1.16 2001/05/19 18:15:14 jdolecek Exp $ */
|
||||
/* $NetBSD: exec.c,v 1.17 2001/06/01 23:26:31 jdolecek Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1990, 1993
|
||||
@ -49,9 +49,6 @@
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/reboot.h>
|
||||
#ifdef COMPAT_OLDBOOT
|
||||
#include <sys/disklabel.h>
|
||||
#endif
|
||||
|
||||
#include <lib/libsa/stand.h>
|
||||
|
||||
@ -62,36 +59,6 @@
|
||||
#include "biosmca.h"
|
||||
#endif
|
||||
|
||||
#ifdef COMPAT_OLDBOOT
|
||||
static int dev2major __P((char *, int *));
|
||||
|
||||
static int
|
||||
dev2major(devname, major)
|
||||
char *devname;
|
||||
int *major;
|
||||
{
|
||||
static const struct {
|
||||
const char *name;
|
||||
int maj;
|
||||
} devices[] = {
|
||||
{ "wd", 0 },
|
||||
{ "fd", 2 },
|
||||
{ "sd", 4 },
|
||||
#ifdef SUPPORT_PS2
|
||||
{ "ed", 20 },
|
||||
#endif
|
||||
};
|
||||
#define NUMDEVICES (sizeof(devices)/sizeof(devices[0]))
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUMDEVICES; i++)
|
||||
if (!strcmp(devname, devices[i].name)) {
|
||||
*major = devices[i].maj;
|
||||
return (0);
|
||||
}
|
||||
return (-1);
|
||||
}
|
||||
#endif
|
||||
#define BOOT_NARGS 6
|
||||
|
||||
extern struct btinfo_console btinfo_console;
|
||||
@ -113,13 +80,6 @@ exec_netbsd(file, loadaddr, boothowto)
|
||||
physaddr_t origaddr = loadaddr;
|
||||
#endif
|
||||
|
||||
#ifdef COMPAT_OLDBOOT
|
||||
char *fsname, *devname;
|
||||
int unit, part;
|
||||
const char *filename;
|
||||
int bootdevnr;
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("exec: file=%s loadaddr=0x%lx\n",
|
||||
file ? file : "NULL", loadaddr);
|
||||
@ -166,58 +126,7 @@ exec_netbsd(file, loadaddr, boothowto)
|
||||
goto out;
|
||||
|
||||
boot_argv[0] = boothowto;
|
||||
|
||||
#ifdef COMPAT_OLDBOOT
|
||||
/* prepare boot device information for kernel */
|
||||
if (parsebootfile(file, &fsname, &devname, &unit, &part, &filename)
|
||||
|| strcmp(fsname, "ufs"))
|
||||
bootdevnr = 0; /* XXX error out if parse error??? */
|
||||
else {
|
||||
int major;
|
||||
|
||||
if (strcmp(devname, "hd") == 0) {
|
||||
/* generic BIOS disk, have to guess type */
|
||||
struct open_file *f = &files[fd]; /* XXX */
|
||||
|
||||
switch (biosdisk_gettype(f)) {
|
||||
case DTYPE_SCSI:
|
||||
devname = "sd";
|
||||
break;
|
||||
#ifdef SUPPORT_PS2
|
||||
case DTYPE_ESDI:
|
||||
if (biosmca_ps2model) {
|
||||
devname = "ed";
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
devname = "wd";
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* The old boot block performed the following
|
||||
* conversion:
|
||||
*
|
||||
* hdN -> Xd0
|
||||
*
|
||||
* where X is the type specified by the label.
|
||||
* We mimmick that here, for lack of any better
|
||||
* way of doing things.
|
||||
*/
|
||||
unit = 0;
|
||||
}
|
||||
|
||||
if (dev2major(devname, &major))
|
||||
bootdevnr = 0; /* XXX error out??? */
|
||||
else
|
||||
bootdevnr = MAKEBOOTDEV(major, 0, 0, unit, part);
|
||||
}
|
||||
|
||||
boot_argv[1] = bootdevnr;
|
||||
#else
|
||||
boot_argv[1] = 0;
|
||||
#endif
|
||||
boot_argv[2] = vtophys(bootinfo); /* old cyl offset */
|
||||
/* argv[3] below */
|
||||
boot_argv[4] = extmem;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: libi386.h,v 1.13 2000/09/24 12:32:35 jdolecek Exp $ */
|
||||
/* $NetBSD: libi386.h,v 1.14 2001/06/01 23:26:31 jdolecek Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996
|
||||
@ -73,12 +73,9 @@ void initio __P((int));
|
||||
int iskey __P((void));
|
||||
char awaitkey __P((int, int));
|
||||
|
||||
#ifdef COMPAT_OLDBOOT
|
||||
int biosdisk_gettype __P((struct open_file*));
|
||||
/* this is in "user code"! */
|
||||
int parsebootfile __P((const char *, char**, char**, unsigned int*,
|
||||
unsigned int*, const char**));
|
||||
#endif
|
||||
|
||||
#ifdef XMS
|
||||
physaddr_t ppbcopy __P((physaddr_t, physaddr_t, int));
|
||||
@ -104,4 +101,4 @@ time_t getsecs __P((void));
|
||||
|
||||
/* in "user code": */
|
||||
void command_help __P((char *));
|
||||
extern struct bootblk_command commands[];
|
||||
extern const struct bootblk_command commands[];
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile,v 1.20 1999/04/08 10:23:23 drochner Exp $
|
||||
# $NetBSD: Makefile,v 1.21 2001/06/01 23:26:31 jdolecek Exp $
|
||||
|
||||
S= ${.CURDIR}/../../../../
|
||||
|
||||
@ -11,7 +11,6 @@ SRCS= main.c devopen.c conf.c dev_net.c exec.c
|
||||
|
||||
CLEANFILES+= ${ROMSTART} ${BASE}.bin ${BASE}.sym
|
||||
|
||||
#CPPFLAGS+= -DCOMPAT_OLDBOOT
|
||||
#CPPFLAGS+= -DDEBUG
|
||||
#CPPFLAGS+= -DNET_DEBUG
|
||||
#CPPFLAGS+= -DSUPPORT_BOOTP -DSUPPORT_DHCP
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: main.c,v 1.7 2000/09/24 18:28:18 jdolecek Exp $ */
|
||||
/* $NetBSD: main.c,v 1.8 2001/06/01 23:26:32 jdolecek Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996
|
||||
@ -62,26 +62,6 @@ struct bootblk_command commands[] = {
|
||||
{ NULL, NULL },
|
||||
};
|
||||
|
||||
#ifdef COMPAT_OLDBOOT
|
||||
int
|
||||
parsebootfile(fname, fsname, devname, unit, partition, file)
|
||||
const char *fname;
|
||||
char **fsname; /* out */
|
||||
char **devname;/* out */
|
||||
unsigned int *unit, *partition; /* out */
|
||||
const char **file; /* out */
|
||||
{
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
int
|
||||
biosdisk_gettype(f)
|
||||
struct open_file *f;
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
bootit(filename, howto)
|
||||
const char *filename;
|
||||
|
Loading…
Reference in New Issue
Block a user