MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mi_startup

Function mi_startup

freebsd/kern/init_main.c:229–346  ·  view source on GitHub ↗

* System startup; initialize the world, create process 0, mount root * filesystem, and fork to create init and pagedaemon. Most of the * hard work is done in the lower-level initialization routines including * startup(), which does memory initialization and autoconfiguration. * * This allows simple addition of new kernel subsystems that require * boot time initialization. It also allows su

Source from the content-addressed store, hash-verified

227 * module. Finally, it allows for optional "kernel threads".
228 */
229void
230mi_startup(void)
231{
232
233 struct sysinit **sipp; /* system initialization*/
234 struct sysinit **xipp; /* interior loop of sort*/
235 struct sysinit *save; /* bubble*/
236
237#if defined(VERBOSE_SYSINIT)
238 int last;
239 int verbose;
240#endif
241
242 TSENTER();
243
244 if (boothowto & RB_VERBOSE)
245 bootverbose++;
246
247 if (sysinit == NULL) {
248 sysinit = SET_BEGIN(sysinit_set);
249 sysinit_end = SET_LIMIT(sysinit_set);
250 }
251
252restart:
253 /*
254 * Perform a bubble sort of the system initialization objects by
255 * their subsystem (primary key) and order (secondary key).
256 */
257 for (sipp = sysinit; sipp < sysinit_end; sipp++) {
258 for (xipp = sipp + 1; xipp < sysinit_end; xipp++) {
259 if ((*sipp)->subsystem < (*xipp)->subsystem ||
260 ((*sipp)->subsystem == (*xipp)->subsystem &&
261 (*sipp)->order <= (*xipp)->order))
262 continue; /* skip*/
263 save = *sipp;
264 *sipp = *xipp;
265 *xipp = save;
266 }
267 }
268
269#if defined(VERBOSE_SYSINIT)
270 last = SI_SUB_COPYRIGHT;
271 verbose = 0;
272#if !defined(DDB)
273 printf("VERBOSE_SYSINIT: DDB not enabled, symbol lookups disabled.\n");
274#endif
275#endif
276
277 /*
278 * Traverse the (now) ordered list of system initialization tasks.
279 * Perform each task, and continue on to the next task.
280 */
281 for (sipp = sysinit; sipp < sysinit_end; sipp++) {
282 if ((*sipp)->subsystem == SI_SUB_DUMMY)
283 continue; /* skip dummy task(s)*/
284
285 if ((*sipp)->subsystem == SI_SUB_DONE)
286 continue;

Callers

nothing calls this directly

Calls 6

mtx_assertFunction · 0.85
printfFunction · 0.70
symbol_nameFunction · 0.70
freeFunction · 0.70
mtx_unlockFunction · 0.70
swapperFunction · 0.50

Tested by

no test coverage detected