/*
* Copyright (c) 1996
* Matthias Drochner. All rights reserved.
* Copyright (c) 1996
* Perry E. Metzger. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgements:
* This product includes software developed for the NetBSD Project
* by Matthias Drochner.
* This product includes software developed for the NetBSD Project
* by Perry E. Metzger.
* 4. The names of the authors may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef SMALL
if (!(boot_params.bp_flags & X86_BP_FLAGS_NOBOOTCONF)) {
parsebootconf(BOOTCFG_FILENAME);
} else {
bootcfg_info.timeout = boot_params.bp_timeout;
}
/*
* If console set in boot.cfg, switch to it.
* This will print the banner, so we don't need to explicitly do it
*/
if (bootcfg_info.consdev) {
command_consdev(bootcfg_info.consdev);
} else {
clearit();
print_bootcfg_banner(bootprog_name, bootprog_rev);
}
/* Display the menu, if applicable */
twiddle_toggle = 0;
if (bootcfg_info.nummenu > 0) {
/* Does not return */
doboottypemenu();
}
#else
twiddle_toggle = 0;
clearit();
print_bootcfg_banner(bootprog_name, bootprog_rev);
#endif
printf("Press return to boot now, any other key for boot menu\n");
printf("booting netbsd - starting in ");
#ifdef SMALL
c = awaitkey(boot_params.bp_timeout, 1);
#else
c = awaitkey((bootcfg_info.timeout < 0) ? 0 : bootcfg_info.timeout, 1);
#endif
if ((c != '\r') && (c != '\n') && (c != '\0') &&
((boot_params.bp_flags & X86_BP_FLAGS_PASSWORD) == 0
|| check_password((char *)boot_params.bp_password))) {
printf("type \"?\" or \"help\" for help.\n");
bootmenu(); /* does not return */
}
/*
* The file name provided here is just a default. If the
* DHCP server provides a file name, we'll use that instead.
*/
bootit("netbsd", 0);
/*
* If that fails, let the BIOS try the next boot device.
*/
return (1);
}
/*
* dummy function to satisfy link against call in
* sys/arch/i386/stand/lib/bootmenu.c:do_bootcfg_command()
*/