From 022661283a79b264ce1e3e9a6b144cc476700f48 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 17 May 2005 13:44:08 +0000 Subject: [PATCH] Load buffer is now handled by the autoload() function. --- src/core/main.c | 20 +++++++++++++++----- 1 file 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 #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 */