- kprintf("mem_size: %d M\n",mem_size / (1024 * 1024));
-
- /*
- * Initialize the pmap system, using space above `first_avail'
- * for the necessary data structures.
- * NOTE : assume that we'll have enough space mapped in already
- */
-
- first_phys_avail = static_memory_end;
- first_avail = adjust_bat_limit(first_phys_avail, 0, FALSE, FALSE);
-
- kmapsize = (round_page(exception_end) - trunc_page(exception_entry)) + /* Get size we will map later */
- (round_page(sectTEXTB+sectSizeTEXT) - trunc_page(sectTEXTB)) +
- (round_page(sectDATAB+sectSizeDATA) - trunc_page(sectDATAB)) +
- (round_page(sectLINKB+sectSizeLINK) - trunc_page(sectLINKB)) +
- (round_page(sectKLDB+sectSizeKLD) - trunc_page(sectKLDB)) +
- (round_page(static_memory_end) - trunc_page(end));
-
- pmap_bootstrap(mem_size,&first_avail,&first_phys_avail, kmapsize);
-
-#ifdef __MACHO__
-#if DEBUG
- kprintf("Mapping memory:\n");
- kprintf(" exception vector: %08X, %08X - %08X\n", trunc_page(exception_entry),
- trunc_page(exception_entry), round_page(exception_end));
- kprintf(" sectTEXTB: %08X, %08X - %08X\n", trunc_page(sectTEXTB),
- trunc_page(sectTEXTB), round_page(sectTEXTB+sectSizeTEXT));
- kprintf(" sectDATAB: %08X, %08X - %08X\n", trunc_page(sectDATAB),
- trunc_page(sectDATAB), round_page(sectDATAB+sectSizeDATA));
- kprintf(" sectLINKB: %08X, %08X - %08X\n", trunc_page(sectLINKB),
- trunc_page(sectLINKB), round_page(sectLINKB+sectSizeLINK));
- kprintf(" sectKLDB: %08X, %08X - %08X\n", trunc_page(sectKLDB),
- trunc_page(sectKLDB), round_page(sectKLDB+sectSizeKLD));
- kprintf(" end: %08X, %08X - %08X\n", trunc_page(end),
- trunc_page(end), static_memory_end);
-#endif /* DEBUG */
- pmap_map(trunc_page(exception_entry), trunc_page(exception_entry),
- round_page(exception_end), VM_PROT_READ|VM_PROT_EXECUTE);
- pmap_map(trunc_page(sectTEXTB), trunc_page(sectTEXTB),
- round_page(sectTEXTB+sectSizeTEXT), VM_PROT_READ|VM_PROT_EXECUTE);
- pmap_map(trunc_page(sectDATAB), trunc_page(sectDATAB),
- round_page(sectDATAB+sectSizeDATA), VM_PROT_READ|VM_PROT_WRITE);
-
-
- /* The KLD and LINKEDIT segments are unloaded in toto after boot completes,
- * but via ml_static_mfree(), through IODTFreeLoaderInfo(). Hence, we have
- * to map both segments page-by-page.
- */
- for (addr = trunc_page(sectKLDB);
- addr < round_page(sectKLDB+sectSizeKLD);