summaryrefslogtreecommitdiffstats
path: root/src/core/main.c
diff options
context:
space:
mode:
authorMichael Brown2005-05-17 15:44:08 +0200
committerMichael Brown2005-05-17 15:44:08 +0200
commit022661283a79b264ce1e3e9a6b144cc476700f48 (patch)
treec389050a0d3d2bbbef54d7ece278778104027a9a /src/core/main.c
parentMoved NBI support to nbi.c, modified to work with new load mechanism (diff)
downloadipxe-022661283a79b264ce1e3e9a6b144cc476700f48.tar.gz
ipxe-022661283a79b264ce1e3e9a6b144cc476700f48.tar.xz
ipxe-022661283a79b264ce1e3e9a6b144cc476700f48.zip
Load buffer is now handled by the autoload() function.
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/core/main.c b/src/core/main.c
index b26e9a3d..3a112eee 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -24,6 +24,7 @@ Literature dealing with the network protocols:
#include "cpu.h"
#include "console.h"
#include "init.h"
+#include "image.h"
#include <stdarg.h>
#ifdef CONFIG_FILO
@@ -162,6 +163,8 @@ void initialise ( void ) {
MAIN - Kick off routine
**************************************************************************/
int main ( void ) {
+ struct image *image;
+ void *image_context;
int skip = 0;
/* Print out configuration */
@@ -214,21 +217,28 @@ int main ( void ) {
}
/* Load boot file from the device */
- init_buffer ( &load_buffer );
- if ( ! load ( &dev, &load_buffer ) ) {
+ if ( ! autoload ( &dev, &image, &image_context ) ) {
/* Load (e.g. TFTP) failed */
printf ( "...load failed\n" );
continue;
}
- /* Boot the loaded image */
- if ( ! boot_image ( &load_buffer ) ) {
- /* Boot failed (e.g. invalid image) */
+ /* Print out image information */
+ printf ( "\nLoaded %s image\n", image->name );
+
+ /* Disable devices? */
+ cleanup();
+ /* arch_on_exit(0); */
+
+ /* Boot the image */
+ if ( ! image->boot ( image_context ) ) {
+ /* Boot failed */
printf ( "...boot failed\n" );
continue;
}
/* Image returned */
+ printf ( "...image returned\n" );
}
/* Call registered per-object exit functions */