Better documentation, 1ms calibration, default 5 seconds BOOTWAIT

Reviewed by:	adam
Submitted by:	rgrimes
This commit is contained in:
adam 1994-09-20 22:25:00 +00:00
parent 599e28bed9
commit 516108a214
6 changed files with 58 additions and 28 deletions

View File

@ -20,7 +20,7 @@
# the rights to redistribute these changes.
#
# from: Mach, Revision 2.2 92/04/04 11:33:46 rpd
# $Id: Makefile,v 1.14 1994/09/18 19:10:11 swallace Exp $
# $Id: Makefile,v 1.15 1994/09/19 19:54:49 adam Exp $
#
wd0:
@ -32,9 +32,9 @@ wd0:
NOPROG= noprog
NOMAN= noman
# tunable loopcount parameter, waiting for keypress (*1/100s)
BOOTWAIT?= 1000
# tunable timeout parameter, waiting for keypress, calibrated in mS
BOOTWAIT?= 5000
CFLAGS = -O2 -DDO_BAD144 -DBOOTWAIT=${BOOTWAIT} -I${.CURDIR}
LIBS= -lc
INC= -I${.CURDIR}/../..

View File

@ -20,7 +20,7 @@
# the rights to redistribute these changes.
#
# from: Mach, Revision 2.2 92/04/04 11:33:46 rpd
# $Id: Makefile,v 1.14 1994/09/18 19:10:11 swallace Exp $
# $Id: Makefile,v 1.15 1994/09/19 19:54:49 adam Exp $
#
wd0:
@ -32,9 +32,9 @@ wd0:
NOPROG= noprog
NOMAN= noman
# tunable loopcount parameter, waiting for keypress (*1/100s)
BOOTWAIT?= 1000
# tunable timeout parameter, waiting for keypress, calibrated in mS
BOOTWAIT?= 5000
CFLAGS = -O2 -DDO_BAD144 -DBOOTWAIT=${BOOTWAIT} -I${.CURDIR}
LIBS= -lc
INC= -I${.CURDIR}/../..

View File

@ -25,7 +25,7 @@
* the rights to redistribute these changes.
*
* from: Mach, Revision 2.2 92/04/04 11:35:57 rpd
* $Id: io.c,v 1.7 1994/09/16 13:33:17 davidg Exp $
* $Id: io.c,v 1.8 1994/09/18 07:39:55 swallace Exp $
*/
#include <machine/cpufunc.h>
@ -139,9 +139,20 @@ getchar()
}
#if BOOTWAIT
spinwait(i)
int i;
/*
* This routine uses an inb to an unused port, the time to execute that
* inb is approximately 1.25uS. This value is pretty constant across
* all CPU's and all buses, with the exception of some PCI implentations
* that do not forward this I/O adress to the ISA bus as they know it
* is not a valid ISA bus address, those machines execute this inb in
* 60 nS :-(.
*
* XXX we need to use BIOS timer calls or something more reliable to
* produce timeouts in the boot code.
*/
delay1ms()
{
int i = 800;
while (--i >= 0)
(void)inb(0x84);
}
@ -154,7 +165,7 @@ char *buf;
char *ptr=buf;
#if BOOTWAIT
for (i = BOOTWAIT; i>0; spinwait(10000),i--)
for (i = BOOTWAIT; i>0; delay1ms(),i--)
#endif
if (ischar())
for (;;)

View File

@ -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.3 1993/10/16 19:11:39 rgrimes Exp $
* $Id: sys.c,v 1.4 1994/08/21 17:47:26 paul Exp $
*/
#include "boot.h"
@ -178,12 +178,16 @@ openrd()
/*******************************************************\
* Look inside brackets for unit number, and partition *
\*******************************************************/
/*
* Allow any valid digit as the unit number, as the BIOS
* will complain if the unit number is out of range.
* Restricting the range here prevents the possibilty of using
* BIOSes that support more than 2 units.
* XXX Bad values may cause strange errors, need to check if
* what happens when a value out of range is supplied.
*/
if (*cp >= '0' && *cp <= '9')
if ((unit = *cp++ - '0') > 1)
{
printf("Bad unit\n");
return 1;
}
unit = *cp++ - '0';
if (!*cp || (*cp == ',' && !*++cp))
return 1;
if (*cp >= 'a' && *cp <= 'p')

View File

@ -25,7 +25,7 @@
* the rights to redistribute these changes.
*
* from: Mach, Revision 2.2 92/04/04 11:35:57 rpd
* $Id: io.c,v 1.7 1994/09/16 13:33:17 davidg Exp $
* $Id: io.c,v 1.8 1994/09/18 07:39:55 swallace Exp $
*/
#include <machine/cpufunc.h>
@ -139,9 +139,20 @@ getchar()
}
#if BOOTWAIT
spinwait(i)
int i;
/*
* This routine uses an inb to an unused port, the time to execute that
* inb is approximately 1.25uS. This value is pretty constant across
* all CPU's and all buses, with the exception of some PCI implentations
* that do not forward this I/O adress to the ISA bus as they know it
* is not a valid ISA bus address, those machines execute this inb in
* 60 nS :-(.
*
* XXX we need to use BIOS timer calls or something more reliable to
* produce timeouts in the boot code.
*/
delay1ms()
{
int i = 800;
while (--i >= 0)
(void)inb(0x84);
}
@ -154,7 +165,7 @@ char *buf;
char *ptr=buf;
#if BOOTWAIT
for (i = BOOTWAIT; i>0; spinwait(10000),i--)
for (i = BOOTWAIT; i>0; delay1ms(),i--)
#endif
if (ischar())
for (;;)

View File

@ -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.3 1993/10/16 19:11:39 rgrimes Exp $
* $Id: sys.c,v 1.4 1994/08/21 17:47:26 paul Exp $
*/
#include "boot.h"
@ -178,12 +178,16 @@ openrd()
/*******************************************************\
* Look inside brackets for unit number, and partition *
\*******************************************************/
/*
* Allow any valid digit as the unit number, as the BIOS
* will complain if the unit number is out of range.
* Restricting the range here prevents the possibilty of using
* BIOSes that support more than 2 units.
* XXX Bad values may cause strange errors, need to check if
* what happens when a value out of range is supplied.
*/
if (*cp >= '0' && *cp <= '9')
if ((unit = *cp++ - '0') > 1)
{
printf("Bad unit\n");
return 1;
}
unit = *cp++ - '0';
if (!*cp || (*cp == ',' && !*++cp))
return 1;
if (*cp >= 'a' && *cp <= 'p')