panic("kernel too big\n");
}
printf_lock("kstart = 0x%x, kend = 0x%x, kentry = 0x%x, numCPUs = 0x%x\n", m5Conf.kernStart, m5Conf.kernEnd, m5Conf.entryPoint, m5Conf.numCPUs);
- /* Map the kernel's pages into the third level of region 2 */
- //for (ptr = m5Conf.kernStart; ptr < kernel_end; ptr += PAGE_SIZE) {
- // third_kernel[THIRD_XXX(ptr)] = KPTE(PFN(ptr));
- //}
-
- ksp_top = (ulong)unix_boot_alloc(1);
- ksp = ksp_top + PAGE_SIZE;
--
- //if (ksp - m5Conf.kernStart > (0x800000*NUM_KERNEL_THIRD)) {
- // printf_lock("Kernel stack pushd us over 8MB\n");
- // panic("ksp too big\n");
- //}
- //if (THIRD_XXX((ulong)ksp_top) > NUM_KERNEL_THIRD * 1024) {
- // panic("increase NUM_KERNEL_THIRD, and change THIRD_XXX\n");
- //}
- ptr = (ulong) ksp_top;
- bzero((char *)ptr, PAGE_SIZE * 2);
- dbPage[THIRD(0x20040000)] = 0; /* Stack Guard Page */
- dbPage[THIRD(0x20042000)] = KPTE(PFN(ptr)); /* Kernel Stack Pages */
- dbPage[THIRD(0x20046000)] = 0; /* Stack Guard Page */
+ ksp_bottom = (ulong)unix_boot_alloc(1);
+ ksp_top = ksp_bottom + PAGE_SIZE;
-
+ ptr = (ulong) ksp_bottom;
+ bzero((char *)ptr, PAGE_SIZE);
+ dbPage[THIRD(KSTACK_REGION_VA)] = 0; /* Stack Guard Page */
+ dbPage[THIRD(KSTACK_REGION_VA + PAGE_SIZE)] = KPTE(PFN(ptr)); /* Kernel Stack Page */
+ dbPage[THIRD(KSTACK_REGION_VA + 2*PAGE_SIZE)] = 0; /* Stack Guard Page */
/* put argv into the bottom of the stack - argv starts at 1 because
* the command thatr got us here (i.e. "unixboot) is in argv[0].