/* * Initial boot sequence. */ static void boot(void) { /* * The order of these is important! * Don't go changing it without thinking about the consequences. * * Among other things, be aware that console output gets * buffered up at first and does not actually appear until * dev_bootstrap() attaches the console device. This can be * remarkably confusing if a bug occurs at this point. So * don't put new code before dev_bootstrap if you don't * absolutely have to. * * Also note that the buffer for this is only 1k. If you * overflow it, the system will crash without printing * anything at all. You can make it larger though (it's in * dev/generic/console.c). */ kprintf("\n"); kprintf("OS/161 base system version %s\n", BASE_VERSION); kprintf("%s", harvard_copyright); kprintf("\n"); kprintf("CS350-036's system version %s (%s #%d)\n", GROUP_VERSION, buildconfig, buildversion); kprintf("\n"); #if OPT_A0 hello(); #endif /* OPT_A0 */ ram_bootstrap(); scheduler_bootstrap(); thread_bootstrap(); vfs_bootstrap(); dev_bootstrap(); #if OPT_A3 vmstats_init(); #endif vm_bootstrap(); kprintf_bootstrap(); /* Default bootfs - but ignore failure, in case emu0 doesn't exist */ vfs_setbootfs("emu0"); #if OPT_A3 initSwapOps(); #endif /* * Make sure various things aren't screwed up. */ assert(sizeof(userptr_t)==sizeof(char *)); assert(sizeof(*(userptr_t)0)==sizeof(char)); }
/* ************************************************** */ int do_bootstrap(void) { if (rng_bootstrap() || /* rng */ bundle_bootstrap() || /* entity */ entity_bootstrap() || /* bundle */ monitor_bootstrap() || /* monitor */ measure_bootstrap() || /* measure */ medium_bootstrap() || /* medium */ mobility_bootstrap() || /* mobility */ modulation_bootstrap() || /* modulation */ noise_bootstrap() || /* noise */ node_bootstrap() || /* node */ packet_bootstrap() || /* packet */ scheduler_bootstrap()) { /* scheduler */ return -1; } return 0; }
/* * Initial boot sequence. */ static void boot(void) { /* * The order of these is important! * Don't go changing it without thinking about the consequences. * * Among other things, be aware that console output gets * buffered up at first and does not actually appear until * dev_bootstrap() attaches the console device. This can be * remarkably confusing if a bug occurs at this point. So * don't put new code before dev_bootstrap if you don't * absolutely have to. * * Also note that the buffer for this is only 1k. If you * overflow it, the system will crash without printing * anything at all. You can make it larger though (it's in * dev/generic/console.c). */ /* remove compiler warning */ //size_t memsize; /* ASST2: get memsize from new vm_bootstrap */ kprintf("\n"); kprintf("OS/161 base system version %s\n", BASE_VERSION); kprintf("%s", harvard_copyright); kprintf("\n"); kprintf("Group 36 system version %s (%s #%d)\n", GROUP_VERSION, buildconfig, buildversion); kprintf("\n"); ram_bootstrap(); #if OPT_DUMBVM vm_bootstrap(); #else memsize = vm_bootstrap(); /* ASST2: get memsize from new vm_bootstrap */ #endif scheduler_bootstrap(); pid_bootstrap(); /* ASST1: initialize pid management before threads */ thread_bootstrap(); vfs_bootstrap(); dev_bootstrap(); #if !OPT_DUMBVM /* only initialize swap if not using dumbvm */ swap_bootstrap(memsize); /* ASST2: initialize swap file after devices */ #endif kprintf_bootstrap(); // DEMKE: ASST1 - initialize user program console I/O //dumb_consoleIO_bootstrap(); /* Default bootfs - but ignore failure, in case emu0 doesn't exist */ vfs_setbootfs("emu0"); /* * Make sure various things aren't screwed up. */ assert(sizeof(userptr_t)==sizeof(char *)); assert(sizeof(*(userptr_t)0)==sizeof(char)); }