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
This commit is contained in:
parent
adeb3e01da
commit
c54e2295b7
@ -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 @@ boot(int drive)
|
||||
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) {
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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; /* "\-/|" */
|
||||
|
Loading…
Reference in New Issue
Block a user