summaryrefslogtreecommitdiffstats
path: root/src/hci
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/hci
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/hci')
-rw-r--r--src/hci/commands/boot_cmd.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/hci/commands/boot_cmd.c b/src/hci/commands/boot_cmd.c
new file mode 100644
index 00000000..0681ec54
--- /dev/null
+++ b/src/hci/commands/boot_cmd.c
@@ -0,0 +1,21 @@
+#include <vsprintf.h>
+#include <gpxe/command.h>
+#include <gpxe/autoboot.h>
+
+static int boot_exec ( int argc, char **argv ) {
+
+ if ( argc != 1 ) {
+ printf ( "Usage: %s\n"
+ "Attempts to boot the system\n", argv[0] );
+ return 1;
+ }
+
+ autoboot();
+
+ return 0;
+}
+
+struct command boot_command __command = {
+ .name = "boot",
+ .exec = boot_exec,
+};