72,73d71
< #define KSTACK_REGION_VA 0x20040000
<
518c516
< kernel_end = ROUNDUP8K(m5Conf.kernEnd);
---
> kernel_end = ksp_top = ROUNDUP8K(m5Conf.kernEnd);
530a529,532
> /* 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));
> //}
532,533c534,535
< ksp_bottom = (ulong)unix_boot_alloc(1);
< ksp_top = ksp_bottom + PAGE_SIZE;
---
> ksp_top = (ulong)unix_boot_alloc(1);
> ksp = ksp_top + PAGE_SIZE;
535,539c537,548
< 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 */
---
> //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 */
544c553
< ksp = ksp_top - 8; /* Back up one longword */
---
> ksp -= 8; /* Back up one longword */
603c612
< thisCPU->rpb_pcb.rpb_ksp = (KSTACK_REGION_VA + 2*PAGE_SIZE - (ksp_top - ksp));
---
> thisCPU->rpb_pcb.rpb_ksp = (0x20044000 - 0x18);
626c635
< rpb_ctb->rpb_type = CONS_DZ;
---
> rpb_ctb->rpb_type = CONS_REM;
632,637c641,643
< ctb_tt->ctb_csr = 0;
< ctb_tt->ctb_tivec = 0x6c0; /* matches tlaser pal code */
< ctb_tt->ctb_rivec = 0x680; /* matches tlaser pal code */
< ctb_tt->ctb_term_type = 2;
< ctb_tt->ctb_put_sts = 0;
< ctb_tt->ctb_get_sts = 0;
---
> ctb_tt->ctb_tintr_vec = 0x6c0; /* matches tlaser pal code */
> ctb_tt->ctb_rintr_vec = 0x680; /* matches tlaser pal code */
> ctb_tt->ctb_term_type = CTB_GRAPHICS;