Subject: Re: Broken kernels?
To: Michael L. Hitch <osymh@gemini.oscs.montana.edu>
From: Eduardo E. Horvath eeh@btr.com <eeh@btr.btr.com>
List: amiga-dev
Date: 03/14/1994 08:59:09
On Sun, 13 Mar 1994, Michael L. Hitch wrote:

>   You could put a test in after pagetable_size is computed and check it for
> a reasonable amount.  If it's too large (or negative), set the screen color
> and hang in a loop.

OK, I tried adding this code:
  for (; 
       i < vstart + (UPAGES + 1)*AMIGA_PAGE_SIZE;
       i += AMIGA_PAGE_SIZE, pg_proto += AMIGA_PAGE_SIZE)
    *pg++ = pg_proto;

*((short*)0xdff180) = 0x050;

while( pg > 0x0600000 )
  while(1)
    *((short*)0xdff180) = 0x0f00;
  
while( pagetable_pa > 0x0600000 )
  while(1)
    *((short*)0xdff180) = 0x0f0;
/* it freezes right here ^^^^^^ */

while( pagetable_size > 0x0400000 )
  while(1)
    *((short*)0xdff180) = 0x0f;

while( pagetable_pa + pagetable_size > 0x0400000 )
  while(1)
    *((short*)0xdff180) = 0x0ff;

while( pagetable_pa + pagetable_size <= 0 )
  while(1)
    *((short*)0xdff180) = 0x0ff0;


  /* invalidate remainder of kernel PT */
  while (pg < ((u_int *) (pagetable_pa + pagetable_size)))
    *pg++ = PG_NV;

*((short*)0xdff180) = 0x0500;

When I try to boot, it flashes bright green for almost a second,
implying that pagetable_pa > 6MB, then goes bright red.  That should
not happen.  Here's the assembly code for that while loop:

	cmpl #6291456,d3
	jls L82
	movel #14676352,a0
L83:
	movew #240,a0@		| These two lines are the 
	jra L83			| 	infinite loop.
L82:
	cmpl #4194304,a6@(-20)


I see now way to exit that loop without some sort of asynchronous
event (i.e. interrupt).  Seems that whatever the problem is, it may
not be in amiga_init.c.  Any ideas now?

=========================================================================
Eduardo Horvath				eeh@btr.com
					..!{decwrl,mips,fernwood}!btr!eeh
	"Trust me, I am cognizant of what I am doing." - Hammeroid


------------------------------------------------------------------------------