david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

Use the global load_buffer, and the boot_image function.

This commit is contained in:
Michael Brown 2005-05-09 18:10:04 +00:00
parent f649a4d0fd
commit a5a14dc05d
1 changed files with 11 additions and 6 deletions

View File

@ -162,7 +162,6 @@ void initialise ( void ) {
MAIN - Kick off routine MAIN - Kick off routine
**************************************************************************/ **************************************************************************/
int main ( void ) { int main ( void ) {
struct buffer buffer;
int skip = 0; int skip = 0;
/* Print out configuration */ /* Print out configuration */
@ -215,15 +214,21 @@ int main ( void ) {
} }
/* Load boot file from the device */ /* Load boot file from the device */
init_buffer ( &buffer, 0x7c00, 0x100 ); init_buffer ( &load_buffer );
if ( ! load ( &dev, &buffer ) ) { 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;
} }
printf ( "Loaded file of size %d\n", buffer.fill ); /* Boot the loaded image */
if ( ! boot_image ( &load_buffer ) ) {
/* Boot failed (e.g. invalid image) */
printf ( "...boot failed\n" );
continue;
}
/* Image returned */
} }
/* Call registered per-object exit functions */ /* Call registered per-object exit functions */