diff options
Diffstat (limited to 'sys/arch/i386/boot/boot.c')
-rw-r--r-- | sys/arch/i386/boot/boot.c | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/sys/arch/i386/boot/boot.c b/sys/arch/i386/boot/boot.c index 0e55dbdf62d..86c7adbb448 100644 --- a/sys/arch/i386/boot/boot.c +++ b/sys/arch/i386/boot/boot.c @@ -73,7 +73,7 @@ char *names[] = { static void getbootdev __P((int *howto)); static void loadprog __P((int howto)); -extern char *version; +extern char version[]; extern int end; void @@ -85,6 +85,7 @@ boot(drive) printf("\n" ">> OpenBSD BOOT: %d/%d k [%s]\n" + "use ? for file list, or carriage return for defaults\n" "use hd(1,a)/bsd to boot sd0 when wd0 is also installed\n", argv[7] = memsize(0), argv[8] = memsize(1), @@ -95,21 +96,36 @@ loadstart: * As a default set it to the first partition of the first * * floppy or hard drive * \***************************************************************/ - part = 0; - unit = drive&0x7f; - maj = (drive&0x80 ? 0 : 2); /* a good first bet */ +#ifdef DOSREAD + if (drive== 0xff) { + maj = 5; + part = 0; + unit = 0; + } else +#endif + { + part = 0; + unit = drive&0x7f; + maj = (drive&0x80 ? 0 : 2); /* a good first bet */ + } name = names[currname++]; loadflags = 0; - if (currname == NUMNAMES) - currname = 0; getbootdev(&loadflags); - if (openrd()) { + switch(openrd()) { + case 0: + loadprog(loadflags); + break; + case -1: + currname--; + break; + default: printf("Can't find %s\n", name); - goto loadstart; + break; } - loadprog(loadflags); + if (currname == NUMNAMES) + currname = 0; goto loadstart; } @@ -128,8 +144,6 @@ loadprog(howto) return; } - poff = N_TXTOFF(head); - startaddr = (int)head.a_entry; addr = (startaddr & 0x00f00000); /* some MEG boundary */ printf("Booting %s(%d,%c)%s @ 0x%x\n", @@ -149,7 +163,8 @@ loadprog(howto) /* LOAD THE TEXT SEGMENT */ /********************************************************/ printf("%d", head.a_text); - xread(addr, head.a_text); + pcpy(&head, addr, sizeof(head)); + xread(addr+sizeof(head), head.a_text - sizeof(head)); #ifdef CHECKSUM if (cflag) printf("(%x)", cksum(addr, head.a_text)); @@ -223,6 +238,9 @@ loadprog(howto) } putchar(']'); +#ifdef DOSREAD + doclose(); +#endif /********************************************************/ /* and that many bytes of (debug symbols?) */ |