Subject: Questions on Kernel VM space
To: port-mac68k <port-mac68k@netbsd.org>
From: Bob Nestor <rnestor@metronet.com>
List: port-mac68k
Date: 02/05/1999 16:24:48
While poking around trying to stumble over something that might be 
causing the random panics some of us are seeing I noticed something in 
machdep.c.  Most other ports have code in their machdep.c cpu_startup 
that marks Page 0 as inaccessible and protects the memory space occupied 
by the Kernel against writes.  The comments all seem to indicate this is 
done to keep from doing a "COW" on the text segment.

Marking Page 0 as inaccessible makes sense since this would provide a 
great way for trapping NULL pointers, i.e. program access thru address 0 
causes an addressing error.

I'm not sure what the "COW" means (Copy On Write?), but it seems to make 
sense to mark the Kernel as Read/Execute to keep stray writes in 
ill-behaved code from taking the system down.

The real question is, why aren't we doing these things in the mac68k 
port?  Is it because the ADB/MRG code might need to do writes to low-core 
memory?  If so, could these protections be enabled for Kernels running 
the non-MRG implementation?  Obviously this might cause problems for the 
SLOTMAN kernels, but if this helps identify our random kernel panic it 
might be a good thing in the short term.

thanks,
-bob