Added "fallback" and fixed some minor bugs.

This commit is contained in:
erich 1998-06-01 00:18:11 +00:00
parent e1a55a7b85
commit 79d769da3f

View file

@ -53,10 +53,11 @@ cmos_read_byte(int loc)
#endif /* DEBUG */ #endif /* DEBUG */
/* /*
* This is used for determining of the command-line should ask the user * These are used for determining if the command-line should ask the user
* to correct errors. * to correct errors during scripts.
*/ */
int fallback = -1; int fallback = -1;
int protected = 0;
char * char *
skip_to(int after_equal, char *cmdline) skip_to(int after_equal, char *cmdline)
@ -158,7 +159,7 @@ enter_cmdline(char *script, char *heap)
mbi.flags |= MB_INFO_MEM_MAP; mbi.flags |= MB_INFO_MEM_MAP;
/* BSD and chainloading evil hacks !! */ /* BSD and chainloading evil hacks !! */
bootdev = set_bootdev(); bootdev = set_bootdev(0);
if (!script) if (!script)
{ {
@ -171,10 +172,17 @@ restart:
{ {
if (errnum) if (errnum)
{ {
if (fallback != -1) if (fallback < 0)
return 0; goto returnit;
print_error(); print_error();
if (protected || errnum == ERR_BOOT_COMMAND)
{
printf("Press any key to continue...");
getc();
returnit:
return 0;
}
run_cmdline = 1; run_cmdline = 1;
if (!have_run_cmdline) if (!have_run_cmdline)
{ {
@ -222,19 +230,8 @@ restart:
if (!type) if (!type)
{ {
printf(" Error, cannot boot unless kernel loaded.\n"); errnum = ERR_BOOT_COMMAND;
goto restart;
if (fallback != -1)
return 0;
if (script)
{
printf("Press any key to continue...");
getc();
return 1;
}
else
goto restart;
} }
/* this is the final possibility */ /* this is the final possibility */
@ -271,7 +268,8 @@ restart:
} }
else if (strcmp("root", cur_heap) < 1) else if (strcmp("root", cur_heap) < 1)
{ {
set_device(cur_cmdline); int hdbias = 0;
char *biasptr = skip_to(0, set_device(cur_cmdline));
/* this will respond to any "rootn<XXX>" command, /* this will respond to any "rootn<XXX>" command,
but that's OK */ but that's OK */
@ -285,7 +283,9 @@ restart:
if (cur_heap[4] != 'n') if (cur_heap[4] != 'n')
{ {
/* BSD and chainloading evil hacks !! */ /* BSD and chainloading evil hacks !! */
bootdev = set_bootdev(); safe_parse_maxint(&biasptr, &hdbias);
errnum = 0;
bootdev = set_bootdev(hdbias);
print_fsys_type(); print_fsys_type();
} }
@ -309,7 +309,7 @@ restart:
#ifndef NO_DECOMPRESSION #ifndef NO_DECOMPRESSION
/* this will respond to any "modulen<XXX>" command, /* this will respond to any "modulen<XXX>" command,
but that's OK */ but that's OK */
if (cur_heap[6] = 'n') if (cur_heap[6] == 'n')
no_decompression = 1; no_decompression = 1;
#endif /* NO_DECOMPRESSION */ #endif /* NO_DECOMPRESSION */