Subject: MVME147 memory detection... bug?
To: None <port-mvme68k@netbsd.org>
From: Michael Kukat <michael@unixiron.org>
List: port-mvme68k
Date: 08/23/2003 18:11:36
Hello,

i just completed my homemade P2 "transition adapter" and got my MVME147 up and
running (disk was installed a while ago).
Now i wanted to switch over from Bug environment to System environment. Using
System environment, Bug displays offboard mem also when powering up. But when
booting, NetBSD crashes with a Long Bus Error right before the first message
appears. Okay, this is known to be something with the memory location pointers
at 0xfffe0764. A look there... Tadaa... Bug modified my values. I entered
800000 to ffffff, Bug changed them to 800000 to 1000000. So, in locore.c, this
happens:

        movl    #NBPG-1,%d0
        addl    0xfffe0764,%d0          | Start of offboard segment
        andl    #-NBPG,%d0              | Round up to page boundary
        jbeq    Lsavmaxmem              | Jump if none defined
-->     movl    #NBPG,%d1               | Note: implicit '+1'
        addl    0xfffe0768,%d1          | End of offboard segment
        andl    #-NBPG,%d1              | Round up to page boundary

NetBSD expects 0xffffff as end here, as before the rounding, one page is added.
If you have 0x1000000, NetBSD thinks about one more page, and crashes when
using it.

Was this ever tested? I will try to track down Bug's behaviour here a bit
deeper, and if everything is reproduceable, this movl i marked should also have
the "-1" added, so no "implicit '+1'".

...Michael

-- 
http://www.unixiron.org/    Home Powered by: (Net|Open|Free)BSD IRIX NonStop-UX
Solaris AIX HP-UX Tru64 MUNIX Ultrix VMS SINIX Dolphin_Unix OpenStep MacOS A/UX