Subject: Re: help wanted on nathanw_sa branch
To: Gregory McGarry <g.mcgarry@ieee.org>
From: Wayne Knowles <wdk@netbsd.org>
List: port-mips
Date: 02/11/2002 22:56:41
On Mon, 11 Feb 2002, Gregory McGarry wrote:

> A kernel from the nathanw_sa branch is claimed to work
> with mips3 ISA, but it doesn't currently work on my pmax.
> Everything appears to be in place, but I suspect there
> is some underlying assumption about TLB operations.
>
> mi_switch in : pid=0x0, curproc=0x802a3d00, l=0x802a3d00, new=0x0
> ...
> pmap_asid_alloc: curproc 1 'swapper' segtab 0x809b5000 asid 1
> mi_switch in : pid=0x1, curproc=0x809b6000, l=0x809b6000, new=0x0
> trap: TLB miss (load or instr. fetch) in kernel mode
> status=0x80004, cause=0x808, epc=0x802c0000, vaddr=0x6af0
> pid=2 cmd=asc0:0 usp=0x0 ksp=0xc3977dc8
> Stopped in asc0:0 at    0x802c0000:     lb      a1,27376(zero)
> db>
>
> The problem is around mip1_cpu_switch_resume() or with
> the code in locore.S marked /* XXX XXX XXX */.
> Setting breakpoints seems to affect how it fails.
>
> I guess it would be good to know if other mips1 machines
> are trying to run a kernel or if r4000 pmax machines can
> run a kernel.

Hi Greg,

The branch has only been tested on mips3 processors (under -sgimips).
Support for mips1 should work, but has not been tested yet.

Some minor changes to the MD startup routines are required to ensure
proc0paddr and curproc point to the correct structure.

The following diff is an example of the required changes that were done
to the sgimips port.  Similar changes for the pmax platform have not been
done yet - hopefully it is all that is missing to get pmax running for
you:


Index: syssrc/sys/arch/sgimips/sgimips/machdep.c
diff -c syssrc/sys/arch/sgimips/sgimips/machdep.c:1.30 syssrc/sys/arch/sgimips/sgimips/machdep.c:1.30.2.1
*** syssrc/sys/arch/sgimips/sgimips/machdep.c:1.30	Thu Nov 15 00:47:16 2001
--- syssrc/sys/arch/sgimips/sgimips/machdep.c	Sun Nov 18 03:28:32 2001
***************
*** 1,4 ****
! /*	$NetBSD: machdep.c,v 1.30 2001/11/14 22:47:16 mhitch Exp $	*/

  /*
   * Copyright (c) 2000 Soren S. Jorvang
--- 1,4 ----
! /*	$NetBSD: machdep.c,v 1.30.2.1 2001/11/18 01:28:32 wdk Exp $	*/

  /*
   * Copyright (c) 2000 Soren S. Jorvang
***************
*** 427,435 ****
  	 * Allocate space for proc0's USPACE.
  	 */
  	v = (caddr_t)uvm_pageboot_alloc(USPACE);
! 	proc0.p_addr = proc0paddr = (struct user *)v;
! 	proc0.p_md.md_regs = (struct frame *)(v + USPACE) - 1;
! 	curpcb = &proc0.p_addr->u_pcb;
  	curpcb->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */

  	/*
--- 427,435 ----
  	 * Allocate space for proc0's USPACE.
  	 */
  	v = (caddr_t)uvm_pageboot_alloc(USPACE);
! 	lwp0.l_addr = proc0paddr = (struct user *)v;
! 	lwp0.l_md.md_regs = (struct frame *)(v + USPACE) - 1;
! 	curpcb = &lwp0.l_addr->u_pcb;
  	curpcb->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */

  	/*



-- 
Wayne Knowles			NetBSD/mipsco port maintainer
wdk@netbsd.org			http://www.netbsd.org