summaryrefslogtreecommitdiffstats
path: root/src/core/main.c
diff options
context:
space:
mode:
authorMichael Brown2005-05-09 20:10:04 +0200
committerMichael Brown2005-05-09 20:10:04 +0200
commita5a14dc05d15dd8b5b3456e00661242df8787086 (patch)
tree5351b9b8a2c0aa92ea79bcf67283db3bf75f84f3 /src/core/main.c
parentAdd INIT_LOADBUF (diff)
downloadipxe-a5a14dc05d15dd8b5b3456e00661242df8787086.tar.gz
ipxe-a5a14dc05d15dd8b5b3456e00661242df8787086.tar.xz
ipxe-a5a14dc05d15dd8b5b3456e00661242df8787086.zip
Use the global load_buffer, and the boot_image function.
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 260a44b8..b26e9a3d 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -162,7 +162,6 @@ void initialise ( void ) {
MAIN - Kick off routine
**************************************************************************/
int main ( void ) {
- struct buffer buffer;
int skip = 0;
/* Print out configuration */
@@ -215,15 +214,21 @@ int main ( void ) {
}
/* Load boot file from the device */
- init_buffer ( &buffer, 0x7c00, 0x100 );
- if ( ! load ( &dev, &buffer ) ) {
- /* Load (e.g. TFTP failed) */
+ init_buffer ( &load_buffer );
+ if ( ! load ( &dev, &load_buffer ) ) {
+ /* Load (e.g. TFTP) failed */
printf ( "...load failed\n" );
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 */