|
@@ -162,7 +162,6 @@ void initialise ( void ) {
|
162
|
162
|
MAIN - Kick off routine
|
163
|
163
|
**************************************************************************/
|
164
|
164
|
int main ( void ) {
|
165
|
|
- struct buffer buffer;
|
166
|
165
|
int skip = 0;
|
167
|
166
|
|
168
|
167
|
/* Print out configuration */
|
|
@@ -215,15 +214,21 @@ int main ( void ) {
|
215
|
214
|
}
|
216
|
215
|
|
217
|
216
|
/* Load boot file from the device */
|
218
|
|
- init_buffer ( &buffer, 0x7c00, 0x100 );
|
219
|
|
- if ( ! load ( &dev, &buffer ) ) {
|
220
|
|
- /* Load (e.g. TFTP failed) */
|
|
217
|
+ init_buffer ( &load_buffer );
|
|
218
|
+ if ( ! load ( &dev, &load_buffer ) ) {
|
|
219
|
+ /* Load (e.g. TFTP) failed */
|
221
|
220
|
printf ( "...load failed\n" );
|
222
|
221
|
continue;
|
223
|
222
|
}
|
224
|
223
|
|
225
|
|
- printf ( "Loaded file of size %d\n", buffer.fill );
|
226
|
|
-
|
|
224
|
+ /* Boot the loaded image */
|
|
225
|
+ if ( ! boot_image ( &load_buffer ) ) {
|
|
226
|
+ /* Boot failed (e.g. invalid image) */
|
|
227
|
+ printf ( "...boot failed\n" );
|
|
228
|
+ continue;
|
|
229
|
+ }
|
|
230
|
+
|
|
231
|
+ /* Image returned */
|
227
|
232
|
}
|
228
|
233
|
|
229
|
234
|
/* Call registered per-object exit functions */
|