diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-10-22 06:56:32 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-10-22 06:56:32 +0000 |
commit | 44cd2448a12527a02751d5f8264c38c25eafa8fd (patch) | |
tree | 6b45ce670fb389fb316c129391cfd45d6ba586b3 /sys/arch/mvme68k | |
parent | 2683e3ff84743ade2c2617d20b6785d422c9e366 (diff) |
NetBSD -> OpenBSD; kernel is called /bsd
Diffstat (limited to 'sys/arch/mvme68k')
-rw-r--r-- | sys/arch/mvme68k/stand/bootsd/boot.c | 4 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/libsa/devopen.c | 13 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/netboot/boot.c | 50 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/sboot/sboot.c | 193 |
4 files changed, 139 insertions, 121 deletions
diff --git a/sys/arch/mvme68k/stand/bootsd/boot.c b/sys/arch/mvme68k/stand/bootsd/boot.c index ae22345dc8a..4621fac2888 100644 --- a/sys/arch/mvme68k/stand/bootsd/boot.c +++ b/sys/arch/mvme68k/stand/bootsd/boot.c @@ -84,7 +84,7 @@ main(pp) void *addr; int io, i; - printf(">> NetBSD sdboot [%s]\n", version); + printf(">> OpenBSD sdboot [%s]\n", version); bugargs = pp; parse_args(pp); @@ -290,7 +290,7 @@ parse_args(pargs) struct mvmeprom_args *pargs; { char *ptr = pargs->arg_start; - char *name = "/netbsd"; + char *name = "/bsd"; char c; int howto = 0; diff --git a/sys/arch/mvme68k/stand/libsa/devopen.c b/sys/arch/mvme68k/stand/libsa/devopen.c index 2c7e714e430..92c083983cb 100644 --- a/sys/arch/mvme68k/stand/libsa/devopen.c +++ b/sys/arch/mvme68k/stand/libsa/devopen.c @@ -1,9 +1,17 @@ #include <sys/param.h> #include <stand.h> +#include "promboot.h" /* - * Open the device + * Open the device named by the combined device/file name + * given as the "fname" arg, something like: "sd()bsd" + * + * However, Sun PROMs don't really let you choose which + * device you will talk to. You can only open the device + * that was used to load the boot program. Therefore, we + * do not accept a "device" part in the "fname" string. + * Pass the PROM device name to open in case it needs it. */ int devopen(f, fname, file) @@ -12,12 +20,13 @@ devopen(f, fname, file) char **file; { struct devsw *dp; + char *cp, *path, *devname; int error; *file = (char*)fname; dp = &devsw[0]; f->f_dev = dp; - error = (*dp->dv_open)(f, NULL); + error = (*dp->dv_open)(f, prom_bootdev); return (error); } diff --git a/sys/arch/mvme68k/stand/netboot/boot.c b/sys/arch/mvme68k/stand/netboot/boot.c index 1c16244e0fe..a09076af7a4 100644 --- a/sys/arch/mvme68k/stand/netboot/boot.c +++ b/sys/arch/mvme68k/stand/netboot/boot.c @@ -1,6 +1,7 @@ -/* $NetBSD: boot.c,v 1.1.1.1.2.1 1995/10/12 20:38:57 chuck Exp $ */ +/* $NetBSD: boot.c,v 1.1.1.1 1995/06/09 22:02:40 gwr Exp $ */ /*- + * Copyright (c) 1995 Theo de Raadt * Copyright (c) 1982, 1986, 1990, 1993 * The Regents of the University of California. All rights reserved. * @@ -39,39 +40,52 @@ #include <sys/reboot.h> #include "stand.h" +#include "promboot.h" /* * Boot device is derived from ROM provided information. */ -#define LOADADDR 0x8000 +#define LOADADDR 0x10000 -extern char *version; -extern char *cmd_parse(); -char defname[32] = "netbsd"; +extern char *version; +char defname[32] = "bsd"; char line[80]; -int boothowto; +#if 0 +u_int bootdev = MAKEBOOTDEV(0, sdmajor, 0, 0, 0); /* disk boot */ +#endif +u_int bootdev = MAKEBOOTDEV(1, 0, 0, 0, 0); /* network boot */ -main(cline) -char *cline; +main() { char *cp, *file; int io; + extern int cputyp; + extern char *oparg, *opargend; + int ask = 0; - printf(">> NetBSD netboot [%s]\n", version); - file = cmd_parse(cline, &boothowto); - if (file == NULL) - file = defname; + printf(">> OpenBSD netboot [%s]\n", version); + printf("model MVME%x\n", cputyp); + + *opargend = '\0'; + prom_get_boot_info(); + file = defname; + + cp = prom_bootfile; + if (cp && *cp) + file = cp; for (;;) { - if (boothowto & RB_ASKNAME) { + if (ask) { printf("boot: "); gets(line); - if (line[0]) - file = line; + if (line[0]) { + oparg = line; + prom_get_boot_info(); + } } - exec_mvme(file, LOADADDR, boothowto); - printf("boot: %s: %s\n", file, strerror(errno)); - boothowto |= RB_ASKNAME; + exec_sun(file, (char *)LOADADDR, prom_boothow); + printf("boot: %s\n", strerror(errno)); + ask = 1; } } diff --git a/sys/arch/mvme68k/stand/sboot/sboot.c b/sys/arch/mvme68k/stand/sboot/sboot.c index 3a8d1bf8a34..70135614b80 100644 --- a/sys/arch/mvme68k/stand/sboot/sboot.c +++ b/sys/arch/mvme68k/stand/sboot/sboot.c @@ -29,122 +29,117 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - * main driver, plus machdep stuff - */ +#include <sys/cdefs.h> #include "sboot.h" -void sboot() - +void +main() { - char * mesg; - char buf[128]; - buf[0] = '0'; - consinit(); - printf("\nsboot: serial line bootstrap program (&end = %x)\n\n", &end); - if (reboot) { /* global flag from AAstart.s */ - reboot = 0; - printf("[rebooting...]\n"); - do_cmd("b"); - } - while (1) { - printf(">>> "); - ngets(buf, sizeof(buf)); - do_cmd(buf); - } - /* not reached */ + char buf[128]; + + buf[0] = '0'; + printf("\nsboot: MVME147 bootstrap program\n"); + while (1) { + printf(">>> "); + gets(buf); + do_cmd(buf); + } + /* not reached */ } /* * exit to rom */ - -void callrom () +void +callrom() { - asm("trap #15; .word 0x0063"); + asm("trap #15; .word 0x0063"); } /* * do_cmd: do a command */ - -void do_cmd(buf) - -char *buf; - +void +do_cmd(buf) + char *buf; { - switch (*buf) { - case '\0': - return; - case 'a': - if ( rev_arp() ) { - printf ("My ip address is: %d.%d.%d.%d\n", myip[0], - myip[1], myip[2], myip[3]); - printf ("Server ip address is: %d.%d.%d.%d\n", servip[0], - servip[1], servip[2], servip[3]); - } else { - printf ("Failed.\n"); - } - return; - case 'e': - printf("exiting to ROM\n"); - callrom(); - return; - case 'f': - if (do_get_file() == 1) { - printf("Download Failed\n"); - } else { - printf("Download was a success!\n"); - } - return; - case 'b': - le_init(); - if ( rev_arp() ) { - printf ("My ip address is: %d.%d.%d.%d\n", myip[0], - myip[1], myip[2], myip[3]); - printf ("Server ip address is: %d.%d.%d.%d\n", servip[0], - servip[1], servip[2], servip[3]); - } else { - printf ("REVARP: Failed.\n"); - return; - } - if (do_get_file() == 1) { - printf("Download Failed\n"); - return; - } else { - printf("Download was a success!\n"); - } - go(buf); - return; - case 'h': - case '?': - printf("valid commands\n"); - printf("a - send a RARP\n"); - printf("b - boot the system\n"); - printf("e - exit to ROM\n"); - printf("f - ftp the boot file\n"); - printf("g - execute the boot file\n"); - printf("h - help\n"); - printf("i - init LANCE enet chip\n"); - return; - case 'i': - le_init(); - return; - case 'g': - go(buf); - return; - default: - printf("sboot: %s: Unknown command\n", buf); - } + switch (*buf) { + case '\0': + break; + case 'a': + if (rev_arp()) { + printf("My ip address is: %d.%d.%d.%d\n", myip[0], + myip[1], myip[2], myip[3]); + printf("Server ip address is: %d.%d.%d.%d\n", servip[0], + servip[1], servip[2], servip[3]); + } else { + printf("Failed.\n"); + } + break; + case 'q': + printf("exiting to ROM\n"); + callrom(); + break; + case 'f': + if (do_get_file() == 1) { + printf("Download Failed\n"); + } else { + printf("Download was a success!\n"); + } + break; + case 'b': + le_init(); + if (rev_arp()) { + printf("client IP address %d.%d.%d.%d\n", myip[0], + myip[1], myip[2], myip[3]); + printf("server IP address %d.%d.%d.%d\n", servip[0], + servip[1], servip[2], servip[3]); + } else { + printf("REVARP: Failed.\n"); + return; + } + if (do_get_file() == 1) { + printf("Download Failed\n"); + return; + } else { + printf("received secondary boot program.\n"); + } + if (*++buf == '\0') + buf = "bsd"; + go(buf); + break; + case 'h': + case '?': + printf("valid commands\n"); + printf("a - send a RARP\n"); + printf("b - boot the system\n"); + printf("q - exit to ROM\n"); + printf("f - ftp the boot file\n"); + printf("g - execute the boot file\n"); + printf("h - help\n"); + printf("i - init LANCE enet chip\n"); + break; + case 'i': + le_init(); + break; + case 'g': + go(buf); + break; + default: + printf("sboot: %s: Unknown command\n", buf); + } } -go(buf) -char *buf; - +go(buf) + char *buf; { - void (*entry)() = (void (*)) LOAD_ADDR ; - printf("Start @ 0x%x ... \n", entry); - (*entry)(buf); -} + void (*entry)() = (void (*))LOAD_ADDR; + + printf("jumping to boot program at 0x%x.\n", entry); + asm("clrl d0; clrl d1"); /* XXX network device */ + asm("movl %0, a3" : : "a" (buf) : "a3"); + asm("movl %0, a4" : : "a" (buf + strlen(buf)) : "a4"); + asm("jmp %0@" : : "a" (entry)); +} |