mirror of
https://github.com/ipxe/ipxe
synced 2025-12-22 04:50:25 +03:00
Load buffer is now handled by the autoload() function.
This commit is contained in:
@@ -24,6 +24,7 @@ Literature dealing with the network protocols:
|
|||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
|
#include "image.h"
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#ifdef CONFIG_FILO
|
#ifdef CONFIG_FILO
|
||||||
@@ -162,6 +163,8 @@ void initialise ( void ) {
|
|||||||
MAIN - Kick off routine
|
MAIN - Kick off routine
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
int main ( void ) {
|
int main ( void ) {
|
||||||
|
struct image *image;
|
||||||
|
void *image_context;
|
||||||
int skip = 0;
|
int skip = 0;
|
||||||
|
|
||||||
/* Print out configuration */
|
/* Print out configuration */
|
||||||
@@ -214,21 +217,28 @@ int main ( void ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Load boot file from the device */
|
/* Load boot file from the device */
|
||||||
init_buffer ( &load_buffer );
|
if ( ! autoload ( &dev, &image, &image_context ) ) {
|
||||||
if ( ! load ( &dev, &load_buffer ) ) {
|
|
||||||
/* Load (e.g. TFTP) failed */
|
/* Load (e.g. TFTP) failed */
|
||||||
printf ( "...load failed\n" );
|
printf ( "...load failed\n" );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Boot the loaded image */
|
/* Print out image information */
|
||||||
if ( ! boot_image ( &load_buffer ) ) {
|
printf ( "\nLoaded %s image\n", image->name );
|
||||||
/* Boot failed (e.g. invalid image) */
|
|
||||||
|
/* Disable devices? */
|
||||||
|
cleanup();
|
||||||
|
/* arch_on_exit(0); */
|
||||||
|
|
||||||
|
/* Boot the image */
|
||||||
|
if ( ! image->boot ( image_context ) ) {
|
||||||
|
/* Boot failed */
|
||||||
printf ( "...boot failed\n" );
|
printf ( "...boot failed\n" );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Image returned */
|
/* Image returned */
|
||||||
|
printf ( "...image returned\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Call registered per-object exit functions */
|
/* Call registered per-object exit functions */
|
||||||
|
|||||||
Reference in New Issue
Block a user