Browse Source

Load buffer is now handled by the autoload() function.

tags/v0.9.3
Michael Brown 19 years ago
parent
commit
022661283a
1 changed files with 15 additions and 5 deletions
  1. 15
    5
      src/core/main.c

+ 15
- 5
src/core/main.c View File

24
 #include "cpu.h"
24
 #include "cpu.h"
25
 #include "console.h"
25
 #include "console.h"
26
 #include "init.h"
26
 #include "init.h"
27
+#include "image.h"
27
 #include <stdarg.h>
28
 #include <stdarg.h>
28
 
29
 
29
 #ifdef CONFIG_FILO
30
 #ifdef CONFIG_FILO
162
 MAIN - Kick off routine
163
 MAIN - Kick off routine
163
 **************************************************************************/
164
 **************************************************************************/
164
 int main ( void ) {
165
 int main ( void ) {
166
+	struct image *image;
167
+	void *image_context;
165
 	int skip = 0;
168
 	int skip = 0;
166
 
169
 
167
 	/* Print out configuration */
170
 	/* Print out configuration */
214
 		}
217
 		}
215
 
218
 
216
 		/* Load boot file from the device */
219
 		/* Load boot file from the device */
217
-		init_buffer ( &load_buffer );
218
-		if ( ! load ( &dev, &load_buffer ) ) {
220
+		if ( ! autoload ( &dev, &image, &image_context ) ) {
219
 			/* Load (e.g. TFTP) failed */
221
 			/* Load (e.g. TFTP) failed */
220
 			printf ( "...load failed\n" );
222
 			printf ( "...load failed\n" );
221
 			continue;
223
 			continue;
222
 		}
224
 		}
223
 
225
 
224
-		/* Boot the loaded image */
225
-		if ( ! boot_image ( &load_buffer ) ) {
226
-			/* Boot failed (e.g. invalid image) */
226
+		/* Print out image information */
227
+		printf ( "\nLoaded %s image\n", image->name );
228
+
229
+		/* Disable devices? */
230
+		cleanup();
231
+		/* arch_on_exit(0); */
232
+
233
+		/* Boot the image */
234
+		if ( ! image->boot ( image_context ) ) {
235
+			/* Boot failed */
227
 			printf ( "...boot failed\n" );
236
 			printf ( "...boot failed\n" );
228
 			continue;
237
 			continue;
229
 		}
238
 		}
230
 		
239
 		
231
 		/* Image returned */
240
 		/* Image returned */
241
+		printf ( "...image returned\n" );
232
 	}
242
 	}
233
 
243
 
234
 	/* Call registered per-object exit functions */
244
 	/* Call registered per-object exit functions */

Loading…
Cancel
Save