summaryrefslogtreecommitdiffstats
path: root/src/core/main.c
diff options
context:
space:
mode:
authorMichael Brown2006-12-20 08:04:08 +0100
committerMichael Brown2006-12-20 08:04:08 +0100
commit84202d89f0fa83790a4d3f78119f1fb62c1b3d9b (patch)
tree066eba0ee9db7e82922e662e7d6e5c29ac59d021 /src/core/main.c
parentExplicitly call erase(), to cope with platforms where the ANSI clear (diff)
downloadipxe-84202d89f0fa83790a4d3f78119f1fb62c1b3d9b.tar.gz
ipxe-84202d89f0fa83790a4d3f78119f1fb62c1b3d9b.tar.xz
ipxe-84202d89f0fa83790a4d3f78119f1fb62c1b3d9b.zip
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.
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 191ba841..0a8ea1f1 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -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 ();