浏览代码

Until we have a functioning UDP stack and PXE API again, there's not much

point trying to use the old boot sequence.  Replaced with a call to the
AoE demo code, so that people can at least build and try something useful.
tags/v0.9.3
Michael Brown 18 年前
父节点
当前提交
d6866202f9
共有 1 个文件被更改,包括 10 次插入75 次删除
  1. 10
    75
      src/core/main.c

+ 10
- 75
src/core/main.c 查看文件

@@ -141,6 +141,8 @@ static int exit_status;
141 141
 static int initialized;
142 142
 
143 143
 
144
+extern struct net_device static_single_netdev;
145
+
144 146
 
145 147
 /**************************************************************************
146 148
 MAIN - Kick off routine
@@ -151,88 +153,22 @@ int main ( void ) {
151 153
 	int skip = 0;
152 154
 
153 155
 	/* Call all registered initialisation functions */
156
+	init_heap();
154 157
 	call_init_fns ();
158
+	probe_devices();
155 159
 
156
-	/* Print out configuration */
157
-	print_config();
158
-
159
-	/*
160
-	 * Trivial main loop: we need to think about how we want to
161
-	 * prompt the user etc.
162
-	 *
163
-	 */
164
-	for ( ; ; disable ( &dev ), call_reset_fns() ) {
165
-
166
-		/* Get next boot device */
167
-		if ( ! find_any_with_driver ( &dev, skip ) ) {
168
-			/* Reached end of device list */
169
-			printf ( "No more boot devices\n" );
170
-			skip = 0;
171
-			sleep ( 2 );
172
-			continue;
173
-		}
174
-
175
-		/* Skip this device the next time we encounter it */
176
-		skip = 1;
177
-
178
-		/* Print out device information */
179
-		printf ( "%s (%s) %s at %s\n",
180
-			 dev.bus_driver->name_device ( &dev.bus_dev ),
181
-			 dev.device_driver->name,
182
-			 dev.type_driver->name,
183
-			 dev.bus_driver->describe_device ( &dev.bus_dev ) );
184
-
185
-		/* Probe boot device */
186
-		if ( ! probe ( &dev ) ) {
187
-			/* Device found on bus, but probe failed */
188
-			printf ( "...probe failed: %m\n" );
189
-			continue;
190
-		}
191
-
192
-		/* Print out device information */
193
-		printf ( "%s %s has %s\n",
194
-			 dev.bus_driver->name_device ( &dev.bus_dev ),
195
-			 dev.type_driver->name,
196
-			 dev.type_driver->describe_device ( dev.type_dev ) );
197
-
198
-		/* Configure boot device */
199
-		if ( ! configure ( &dev ) ) {
200
-			/* Configuration (e.g. DHCP) failed */
201
-			printf ( "...configuration failed: %m\n" );
202
-			continue;
203
-		}
160
+	test_aoeboot ( &static_single_netdev );
161
+	printf ( "Press any key to exit\n" );
162
+	getchar();
204 163
 
205
-		/* Load boot file from the device */
206
-		if ( ! autoload ( &dev, &image, &image_context ) ) {
207
-			/* Load (e.g. TFTP) failed */
208
-			printf ( "...load failed: %m\n" );
209
-			continue;
210
-		}
211
-
212
-		/* Print out image information */
213
-		printf ( "\nLoaded %s image\n", image->name );
214
-
215
-		/* Disable devices? */
216
-		cleanup();
217
-		/* arch_on_exit(0); */
218
-
219
-		/* Boot the image */
220
-		if ( ! image->boot ( image_context ) ) {
221
-			/* Boot failed */
222
-			printf ( "...boot failed: %m\n" );
223
-			continue;
224
-		}
225
-		
226
-		/* Image returned */
227
-		printf ( "...image returned\n" );
228
-	}
229
-
230
-	/* Call registered per-object exit functions */
164
+	remove_devices();
231 165
 	call_exit_fns ();
232 166
 
233 167
 	return exit_status;
234 168
 }
235 169
 
170
+#if 0
171
+
236 172
 void exit(int status)
237 173
 {
238 174
 	while(!exit_ok)
@@ -242,7 +178,6 @@ void exit(int status)
242 178
 }
243 179
 
244 180
 
245
-#if 0
246 181
 
247 182
 static int main_loop(int state)
248 183
 {

正在加载...
取消
保存