diff options
author | joerg <joerg@FreeBSD.org> | 1995-06-25 14:02:57 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1995-06-25 14:02:57 +0000 |
commit | c54e2295b7f2db09802e0bc1874072840e4d75f7 (patch) | |
tree | 11d2af9626479eeb2779d418af536370d62162a8 /sys | |
parent | adeb3e01da6a734bd8cba36acb8160a633948c35 (diff) | |
download | FreeBSD-src-c54e2295b7f2db09802e0bc1874072840e4d75f7.zip FreeBSD-src-c54e2295b7f2db09802e0bc1874072840e4d75f7.tar.gz |
Reset defaults in case of boot() is looping several times (e.g. the
user has entered a bogus kernel name in the first place).
Also fix the broken #ifdef FORCE_COMCONSOLE, it has been disabled by
accident. (NB: the keyboard probe remains disabled however.)
Few cosmetic fixes (declare functions to be void instead of int),
while i've been at this.
Pointed out by: wosch@cs.tu-berlin.de (Wolfram Schneider), for the init bug
Diffstat (limited to 'sys')
-rw-r--r-- | sys/i386/boot/biosboot/boot.c | 13 | ||||
-rw-r--r-- | sys/i386/boot/biosboot/boot.h | 9 | ||||
-rw-r--r-- | sys/i386/boot/biosboot/io.c | 7 | ||||
-rw-r--r-- | sys/i386/boot/biosboot/sys.c | 4 | ||||
-rw-r--r-- | sys/i386/boot/biosboot/table.c | 5 |
5 files changed, 21 insertions, 17 deletions
diff --git a/sys/i386/boot/biosboot/boot.c b/sys/i386/boot/biosboot/boot.c index 723a829..c4e7b85 100644 --- a/sys/i386/boot/biosboot/boot.c +++ b/sys/i386/boot/biosboot/boot.c @@ -24,7 +24,7 @@ * the rights to redistribute these changes. * * from: Mach, [92/04/03 16:51:14 rvb] - * $Id: boot.c,v 1.43.2.1 1995/05/31 21:42:38 jkh Exp $ + * $Id: boot.c,v 1.44 1995/06/11 19:31:10 rgrimes Exp $ */ @@ -74,21 +74,20 @@ void boot(int drive) { int ret; - char *t; -#if 0 #ifndef FORCE_COMCONSOLE +#ifdef notyet if (probe_keyboard()) { init_serial(); loadflags |= RB_SERIAL; printf("\nNo keyboard found."); } -#else +#endif /* notyet */ +#else /* FORCE_COMCONSOLE */ init_serial(); loadflags |= RB_SERIAL; printf("\nSerial console forced."); -#endif -#endif +#endif /* FORCE_COMCONSOLE */ /* Pick up the story from the Bios on geometry of disks */ @@ -125,6 +124,8 @@ loadstart: ouraddr, bootinfo.bi_basemem, bootinfo.bi_extmem, devs[maj], unit, name); + name = dflname; /* re-initialize in case of loop */ + loadflags &= RB_SERIAL; /* clear all, but leave serial console */ getbootdev(namebuf, &loadflags); ret = openrd(); if (ret != 0) { diff --git a/sys/i386/boot/biosboot/boot.h b/sys/i386/boot/biosboot/boot.h index 11dd6d9..e054257 100644 --- a/sys/i386/boot/biosboot/boot.h +++ b/sys/i386/boot/biosboot/boot.h @@ -24,7 +24,7 @@ * the rights to redistribute these changes. * * from: Mach, Revision 2.2 92/04/04 11:35:03 rpd - * $Id: boot.h,v 1.9 1995/04/21 16:50:32 bde Exp $ + * $Id: boot.h,v 1.10 1995/05/30 07:58:29 rgrimes Exp $ */ #include <sys/types.h> @@ -34,7 +34,8 @@ #include <ufs/ffs/fs.h> #include <ufs/ufs/inode.h> -extern char *devs[], *name, *iodest; +extern char *devs[], *iodest; +extern char *name, dflname[]; extern struct fs *fs; extern struct inode inode; extern int dosdev, unit, slice, part, maj, boff, poff, bnum, cnt; @@ -74,7 +75,7 @@ int badsect(int dosdev, int sector); /* io.c */ void gateA20(void); -int printf(const char *format, ...); +void printf(const char *format, ...); void putchar(int c); int getchar(int in_buf); void delay1ms(void); @@ -93,7 +94,7 @@ int serial_ischar(void); void init_serial(void); /* sys.c */ -int xread(char *addr, int size); +void xread(char *addr, int size); void read(char *buffer, int count); int find(char *path); int block_map(int file_block); diff --git a/sys/i386/boot/biosboot/io.c b/sys/i386/boot/biosboot/io.c index 394c271..a9d4844 100644 --- a/sys/i386/boot/biosboot/io.c +++ b/sys/i386/boot/biosboot/io.c @@ -24,7 +24,7 @@ * the rights to redistribute these changes. * * from: Mach, Revision 2.2 92/04/04 11:35:57 rpd - * $Id: io.c,v 1.13 1995/04/14 21:26:51 joerg Exp $ + * $Id: io.c,v 1.14 1995/05/30 07:58:33 rgrimes Exp $ */ #include "boot.h" @@ -68,13 +68,14 @@ gateA20(void) /* printf - only handles %d as decimal, %c as char, %s as string */ +void printf(const char *format, ...) { int *dataptr = (int *)&format; char c; dataptr++; - while (c = *format++) + while ((c = *format++)) if (c != '%') putchar(c); else @@ -110,7 +111,7 @@ printf(const char *format, ...) case 'c': putchar((*dataptr++)&0xff); break; case 's': { char *ptr = (char *)*dataptr++; - while (c = *ptr++) + while ((c = *ptr++)) putchar(c); break; } diff --git a/sys/i386/boot/biosboot/sys.c b/sys/i386/boot/biosboot/sys.c index c88fb3d..e04110e 100644 --- a/sys/i386/boot/biosboot/sys.c +++ b/sys/i386/boot/biosboot/sys.c @@ -24,7 +24,7 @@ * the rights to redistribute these changes. * * from: Mach, Revision 2.2 92/04/04 11:36:34 rpd - * $Id: sys.c,v 1.8 1995/04/14 21:26:53 joerg Exp $ + * $Id: sys.c,v 1.9 1995/05/30 07:58:34 rgrimes Exp $ */ #include "boot.h" @@ -45,7 +45,7 @@ char buf[BUFSIZE], fsbuf[BUFSIZE], iobuf[BUFSIZE]; char mapbuf[MAPBUFSIZE]; int mapblock; -int +void xread(char *addr, int size) { int count = BUFSIZE; diff --git a/sys/i386/boot/biosboot/table.c b/sys/i386/boot/biosboot/table.c index e9774f4..aa97789 100644 --- a/sys/i386/boot/biosboot/table.c +++ b/sys/i386/boot/biosboot/table.c @@ -24,7 +24,7 @@ * the rights to redistribute these changes. * * from: Mach, Revision 2.2 92/04/04 11:36:43 rpd - * $Id: table.c,v 1.6 1995/04/14 21:26:53 joerg Exp $ + * $Id: table.c,v 1.7 1995/05/30 07:58:36 rgrimes Exp $ */ /* @@ -137,5 +137,6 @@ struct pseudo_desc Idtr_real = { 0x400 - 1, 0x0, 0x0 }; * fragmentation. */ char *devs[] = { "wd", "hd", "fd", "wt", "sd", 0 }; -char *name = "/kernel"; +char dflname[] = "/kernel"; +char *name = dflname; unsigned long tw_chars = 0x5C2D2F7C; /* "\-/|" */ |