diff options
author | Brandon Creighton <bjc@cvs.openbsd.org> | 2000-10-04 04:09:02 +0000 |
---|---|---|
committer | Brandon Creighton <bjc@cvs.openbsd.org> | 2000-10-04 04:09:02 +0000 |
commit | 70014931a271bdb2730697fcc88dfe9fc0158cad (patch) | |
tree | 3cad5202e29a1ee6589feef1a2a3d3871e43d760 /sys/arch/vax/boot | |
parent | d961aa160d1016defabda6ec0c64c5af707f1b4d (diff) |
eliminate some confusion between rpb and howto -- also make sure that
the "dev()filename" notation is parsed.
Diffstat (limited to 'sys/arch/vax/boot')
-rw-r--r-- | sys/arch/vax/boot/boot/autoconf.c | 4 | ||||
-rw-r--r-- | sys/arch/vax/boot/boot/boot.c | 12 | ||||
-rw-r--r-- | sys/arch/vax/boot/boot/devopen.c | 22 | ||||
-rw-r--r-- | sys/arch/vax/boot/common/srt0.s | 12 |
4 files changed, 32 insertions, 18 deletions
diff --git a/sys/arch/vax/boot/boot/autoconf.c b/sys/arch/vax/boot/boot/autoconf.c index 7edd73492f9..2b01483feef 100644 --- a/sys/arch/vax/boot/boot/autoconf.c +++ b/sys/arch/vax/boot/boot/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.2 2000/05/01 00:12:00 bjc Exp $ */ +/* $OpenBSD: autoconf.c,v 1.3 2000/10/04 04:09:00 bjc Exp $ */ /* $NetBSD: autoconf.c,v 1.5 1999/08/23 19:09:27 ragge Exp $ */ /* * Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden. @@ -85,6 +85,7 @@ static int uda670[]={0x20004030,0x20004230}; autoconf() { extern int memsz; + int copyrpb = 1; findcpu(); /* Configures CPU variables */ consinit(); /* Allow us to print out things */ @@ -135,6 +136,7 @@ autoconf() break; case VAX_BTYP_8000: + copyrpb = 0; memsz = 0; nbi = 1; biaddr = bi8200; diff --git a/sys/arch/vax/boot/boot/boot.c b/sys/arch/vax/boot/boot/boot.c index 6edd0e02728..ad5aaf9774d 100644 --- a/sys/arch/vax/boot/boot/boot.c +++ b/sys/arch/vax/boot/boot/boot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: boot.c,v 1.3 2000/06/01 00:03:17 bjc Exp $ */ +/* $OpenBSD: boot.c,v 1.4 2000/10/04 04:09:01 bjc Exp $ */ /* $NetBSD: boot.c,v 1.4 1999/10/23 14:42:22 ragge Exp $ */ /*- * Copyright (c) 1982, 1986 The Regents of the University of California. @@ -37,6 +37,7 @@ #include "sys/param.h" #include "sys/reboot.h" +#include "rpb.h" #include "lib/libsa/stand.h" #define V750UCODE(x) ((x>>8)&255) @@ -53,6 +54,7 @@ char line[100]; int devtype, bootdev, howto, debug; extern unsigned opendev; extern unsigned *bootregs; +struct rpb *rpb; void usage(), boot(), halt(); @@ -83,6 +85,12 @@ Xmain() int io, type, askname, filindex = 0; int j, nu; + /* make sure the rpb is out of the way so it does not get trampled; + * this will be the case if booting from net + */ + + rpb = (struct rpb *)bootregs[11]; + bootdev = rpb->devtyp; io=0; skip = 1; autoconf(); @@ -122,8 +130,10 @@ Xmain() printf("> boot %s\n", filer[filindex]); exec(filer[filindex++], 0, 0); printf("boot failed: %s\n", strerror(errno)); +#if 0 if (testkey()) break; +#endif } } diff --git a/sys/arch/vax/boot/boot/devopen.c b/sys/arch/vax/boot/boot/devopen.c index c832398b951..dac5993df30 100644 --- a/sys/arch/vax/boot/boot/devopen.c +++ b/sys/arch/vax/boot/boot/devopen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: devopen.c,v 1.1 2000/04/27 02:26:25 bjc Exp $ */ +/* $OpenBSD: devopen.c,v 1.2 2000/10/04 04:09:01 bjc Exp $ */ /* $NetBSD: devopen.c,v 1.2 1999/06/30 18:30:42 ragge Exp $ */ /* * Copyright (c) 1997 Ludd, University of Lule}, Sweden. @@ -35,8 +35,10 @@ #include "lib/libsa/stand.h" #include "vaxstand.h" +#include "rpb.h" unsigned int opendev; +extern struct rpb *rpb; int devopen(f, fname, file) @@ -49,11 +51,9 @@ devopen(f, fname, file) extern int cnvtab[]; char *s, *c, *u; - dev = B_TYPE(bootdev); - ctlr = B_CONTROLLER(bootdev); - unit = B_UNIT(bootdev); - part = B_PARTITION(bootdev); - adapt = B_ADAPTOR(bootdev); + dev = rpb->devtyp; + unit = rpb->unit; + adapt = ctlr = part = 0; for (i = 0, dp = 0; i < ndevs; i++) if (cnvtab[i] == dev) @@ -99,6 +99,8 @@ devopen(f, fname, file) if (x > 3) adapt = a[0]; *file = c; + + x = 1; } else { *file = (char *)fname; c = (char *)fname; @@ -108,13 +110,17 @@ devopen(f, fname, file) return(ENODEV); f->f_dev = dp; - opendev = MAKEBOOTDEV(dev, adapt, ctlr, unit, part); - if (dev > 95) { /* MOP boot over network, root & swap over NFS */ i = (*dp->dv_open)(f, dp->dv_name); } else i = (*dp->dv_open)(f, adapt, ctlr, unit, part); + if(x == 0) { + dev = rpb->devtyp; /* dv_open may have modified rpb */ + unit = rpb->unit; + } + opendev = MAKEBOOTDEV(dev, adapt, ctlr, unit, part); + return i; usage: diff --git a/sys/arch/vax/boot/common/srt0.s b/sys/arch/vax/boot/common/srt0.s index 350c47394a5..fb5dabecf6d 100644 --- a/sys/arch/vax/boot/common/srt0.s +++ b/sys/arch/vax/boot/common/srt0.s @@ -1,4 +1,4 @@ -/* $OpenBSD: srt0.s,v 1.1 2000/04/27 02:26:26 bjc Exp $ */ +/* $OpenBSD: srt0.s,v 1.2 2000/10/04 04:09:01 bjc Exp $ */ /* $NetBSD: srt0.s,v 1.2 1999/05/23 21:58:19 ragge Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden. @@ -48,14 +48,11 @@ _start: .globl _start nop;nop; # If we get called by calls, or something movl r8, _memsz # If we come from disk, save memsize - cmpl ap, $-1 # Check if we are net-booted. XXX - kludge - beql 2f # jump if not ashl $9,76(r11),_memsz # got memsize from rpb - movzbl 102(r11), r10 # Get bootdev from rpb. - movzwl 48(r11), r11 # Get howto + movzwl 48(r11), r10 # Get howto 2: movl $_start, sp # Probably safe place for stack - subl2 $52, sp # do not overwrite saved boot-registers + pushr $0x1fff subl3 $_start, $_edata, r0 movab _start, r1 @@ -68,8 +65,7 @@ _start: .globl _start 1: movl $relocated, (sp) # return-address on top of stack rsb # can be replaced with new address relocated: # now relocation is done !!! - movl r10,_bootdev # Save bootdev early - movl r11,_howto # howto also... + movl r10,_howto # howto also... movl sp, _bootregs calls $0, _Xmain # Were here! halt # no return |