Subject: Re: kernel info
To: Ji Bae <jhb8@cornell.edu>
From: Simon Burge <simonb@netbsd.org>
List: port-pmax
Date: 11/02/1999 18:48:22
Ji Bae wrote:

> At 10:30 AM 11/2/1999 +1100, you wrote:
> >About the best doco we have is in /sys/arch/pmax/stand and
> >/sys/arch/pmax/include/dec_*.  I'm almost finished redoing
> >the bootblocks (again!), and I'm hoping to update and write
> >a few manpages when I get the code side of things finished.
> >
> >If you've got specific questions, just ask on the list.
> >
> >Simon.
> 
> Ok, here's a first question to throw out.  I'm (trying) to run a NetBSD
> kernel on a MIPS R3000 based simulator.  At a certain point, it seems that
> the kernel jumps to a particular memory location and then just loops
> infinitely.  Examining the simulator PC and the kernel's assembly code, it
> appears to be repeatedly executing this particular line of code:
> 
> 80118388:       080460e2        j       80118388 <prom_halt+0x8c>
> 
> So my question is: what is it doing?  Is it waiting for an interrupt?

Here's the code:

	volatile void
	prom_halt(howto, bootstr)
		int howto;
		char *bootstr;
	{
		if (callv != &callvec)
			(*callv->_rex)((howto & RB_HALT) ? 'h' : 'b');
		else {
			volatile void (*f) __P((void));

			f = (howto & RB_HALT)
				? (void *)DEC_PROM_REINIT
				: (void *)DEC_PROM_AUTOBOOT;
			(*f)();
		}

		while(1) ;      /* fool gcc */
		/*NOTREACHED*/
	}

The "jump to myself" would be the "while (1); " at the end of the
function.  Basically, when you call these prom routines, they shouldn't
return!  Unfortunately you'll need to emulate some of these calls if you
want to do a complete DECstation simulator.  The document referenced by
Tohru may help you here.

Simon.