Subject: 68LC040 FPE, PR #5133, UVM, and a security hole?
To: None <port-mac68k@NetBSD.ORG>
From: Rolf Braun <rbraun@cstone.net>
List: port-mac68k
Date: 05/07/1998 14:41:21
OK. I haven't posted to this list in ages, but here goes.

I'm still trying to get NetBSD running on a Performa 630, with a 68LC040
chip. I tried this about a year ago (with NetBSD-current, 1.2something) and
didn't get far due to continuous segfaulting. In addition, I had a weird
hard disk corruption problem where fsck turned up tons of errors that I
couldn't fix, even after only a few boots, all with clean shutdowns.

Now I've been playing with NetBSD 1.3 and 1.3.1 (generic). I continuously
got the esp0: !TC messages with these kernels which others had previously
reported in PR #5133, accompanied by more hard disk corruption. I'm using
an old, small Quantum drive (40MB) which I think has been implicated in
such errors, along with removable media. The system was basically unusable,
until I noticed the messages on this list about turning off write and read
cache.

I didn't have a good formatter other than HD SC Setup, so I waded through
the SCSI-2 spec and wrote a quick little ditty under Mac OS that turns off
the write and read caches on the hard disk. Once I'd fixed the cache,
voila, no more esp0 errors, and no more disk corruption. I haven't played
with the cache enough to see which cache (write or read) is causing the
errors, especially since I've configured my setup now and it's working
pretty nicely except for the FPE bug and I don't want to lose it again. :)

I'll be sending the source code to the SCSI utility I wrote in a bit, once
I've cleaned it up a little. Currently, it does a mode select without doing
a mode sense first, so you need to hard-code some data specific to your
disk first and recompile it before you run it; that data is easily
available from Apple's free SCSI Explorer utility.

The FPE bug is still segfaulting stuff a lot, but less than it did the
first time I tried NetBSD/mac68k. From reading the CHANGES file, I think
there was a change back in June 97 that may have fixed part of the FPE? I'm
glad to hear some progress is being made recently. If it is unfixable or
too hard to fix, I may try to find a full 68040. I've seen them for $129 at
MicroMac (much better than JNA's $259), but I heard someone talk about
getting one for $50 or so... where? :) I'm also going to try and get a
larger hard disk, which I need anyway since my Mac OS internal hard disk is
almost full.

Oddly, complicated stuff like dt and vi never segfaults, while ls and ps
are the worst segfaulters. (ls is usually usable, though; ps usually takes
several tries) Even csh occasionally segfaults, although tcsh (which I
installed from the package system to get command-line editing and history
and all that nice stuff) never does. The standard command-line utilities
like rm and cp never segfault unless they have to report an error, in which
case they segfault about half the time.

So far, I've had good results booting three kernels: the stock NetBSD 1.3
kernel (GENERIC #56), the stock NetBSD 1.3.1 kernel which I currently have
installed (GENERIC #0), and the latest HWDIRECT from 1.3 (#394). The
HWDIRECT Cuda support seems to work great, and it has the added benefit of
soft-power shutdown, but it has an odd bug that it seems to think caps lock
is down every time it boots, so I have to hit caps lock at the first login
prompt. Oh well. :)

I have _NOT_ had good results with the latest snapshot kernel. My problems
are pretty much like those of the person trying to boot the Q700 off that
kernel. It just doesn't work. It always crashes in uvm_fault() shortly
after the adb0 line in the boot messages. I'd suggest getting that new UVM
virtual memory stuff far away from the generic kernels until it's really
proven to work well. The standard -current stuff should be compiled without
it, since it seems to be extremely buggy, while the old VM works fine.
(Yeah, I know the -current is meant for testing stuff, but people often
need to run it in a stable configuration for good reasons, like improved
ethernet or maybe the upcoming FPE fix?)

I've gotten PPP working, too, and telnet works perfectly. ftp sometimes
segfaults in the middle of a large download, but turning off the progress
bar seems to help. I haven't been able to run the packaged lynx or irc due
to the segfaulting. (actually, those are two things I'd like to compile
myself when I get the disk space anyhow, rather than running them packaged,
but at the moment I can't install comp.tgz because I don't have enough
space) I'd like to endorse the pppnat HOWTO on www.macbsd.com for anyone
looking for an easy way to set up PPP. The multiple ISP/peers stuff works
great.

Finally, I'll note what might be a security bug: /dev/adb and /dev/grf0 are
chmod 666 by default. I was kinda surprised when I could access dt from a
non-root account. I changed both of those to 660 and chowned them to
root.wheel, so anyone trusted enough to be in wheel can use them but not
anyone else.

Thanks to everyone who's worked on NetBSD/mac68k; despite the bugs, it's
looking really, really good.

--
- Rolf Braun ... e-mail: rbraun@cstone.net
- Web: http://www.cstone.net/~rbraun/
- Sassy Software: cool software for your Macintosh or Apple IIgs
- Rolf's HTML & Stuff: creative web design for less

- Anyone attempting to post messages or send e-mail using my address
- without my permission will be held legally liable for forgery, and
- may be subject to legal action and severe legal penalties.