Sfoglia il codice sorgente

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

tags/v0.9.3
Michael Brown 19 anni fa
parent
commit
022661283a
1 ha cambiato i file con 15 aggiunte e 5 eliminazioni
  1. 15
    5
      src/core/main.c

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

@@ -24,6 +24,7 @@ Literature dealing with the network protocols:
24 24
 #include "cpu.h"
25 25
 #include "console.h"
26 26
 #include "init.h"
27
+#include "image.h"
27 28
 #include <stdarg.h>
28 29
 
29 30
 #ifdef CONFIG_FILO
@@ -162,6 +163,8 @@ void initialise ( void ) {
162 163
 MAIN - Kick off routine
163 164
 **************************************************************************/
164 165
 int main ( void ) {
166
+	struct image *image;
167
+	void *image_context;
165 168
 	int skip = 0;
166 169
 
167 170
 	/* Print out configuration */
@@ -214,21 +217,28 @@ int main ( void ) {
214 217
 		}
215 218
 
216 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 221
 			/* Load (e.g. TFTP) failed */
220 222
 			printf ( "...load failed\n" );
221 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 236
 			printf ( "...boot failed\n" );
228 237
 			continue;
229 238
 		}
230 239
 		
231 240
 		/* Image returned */
241
+		printf ( "...image returned\n" );
232 242
 	}
233 243
 
234 244
 	/* Call registered per-object exit functions */

Loading…
Annulla
Salva