Split the (quick hack) boot logic out from main.c to autoboot.c, add a

"boot" command to attempt booting from within the command shell, fall back
to shell if boot fails for any reason.
This commit is contained in:
Michael Brown
2006-12-20 07:04:08 +00:00
parent 9ab17484d0
commit 84202d89f0
7 changed files with 85 additions and 14 deletions

View File

@@ -143,6 +143,9 @@ REQUIRE_OBJECT ( pxe );
* Drag in all requested commands
*
*/
#ifdef BOOT_CMD
REQUIRE_OBJECT ( boot_cmd );
#endif
#ifdef NVO_CMD
REQUIRE_OBJECT ( nvo_cmd );
#endif

View File

@@ -150,26 +150,19 @@ void test_dhcp ( struct net_device *netdev );
MAIN - Kick off routine
**************************************************************************/
int main ( void ) {
struct net_device *netdev;
/* Call all registered initialisation functions */
init_heap();
call_init_fns ();
probe_devices();
if ( shell_banner() ) {
shell();
/* Try autobooting if we're not going straight to the shell */
if ( ! shell_banner() ) {
autoboot();
}
netdev = next_netdev ();
if ( netdev ) {
test_dhcp ( netdev );
} else {
printf ( "No network device found\n" );
}
printf ( "Press any key to exit\n" );
getchar();
/* Autobooting failed or the user wanted the shell */
shell();
remove_devices();
call_exit_fns ();