Subject: ffs problems w/ Carrera040 kernel
To: NetBSD Port-mac68k <port-mac68k@netbsd.org>
From: I-Jong Lin <ijonglin@EE.Princeton.EDU>
List: port-mac68k
Date: 09/02/1998 21:04:43
Dear Kernel-hacking types,

   The kernel that I've built for my CArrera040 accelerator works fine
in single user mode.  Unfortunately, it seems that when the kernel
is able to start writing to disks, I run into a problem.  
It works for a little while (I can pack ten files out of tarball)
and then this happens:

	/: bad dir ino 4160 at offset 512: mangled entry

and then screws up the whole partition, making unbootable and unreadable.

So, I have a couple of questions:

1.  What could cause this problem?  (Keep in mind that I'm running
a 90Mhz '040 and the booter could possibly be sending the wrong
information).

2.  What files in the source code control writes to an ffs filesystem?

3.  Does the code use the processor number information that the Booter
passes in?  I didn't see any places, but I might not have been looking
hard enough.


Here's what the errors look like:
--------
....(etc.)...
macvid0 at nubus0 slot a: Macintosh Display Card
macvid0: 640 x 480, monochrome
grf0 at macvid0
ite0 at grf0 (minimal console)
macvid1 at nubus0 slot b: Macintosh Display Card
macvid1: 640 x 480, monochrome
grf1 at macvid1
ite at grf1 not configured
fpu0 at mainbus0 (mc68040)
boot device: sd1
root on sd1a dumps on sd1b
sd1: mode sense (4) return nonsense; using fictitious geometry
mountroot: trying ffs...
sd1: mode sense (4) returned nonsense; using fictitious geometry
time read from PRAM: 0xb2133f9d
Date and time: September 2, 1998 18:31:57
PRAM: 0x35ed8f1d, mocos_boottime: 0x35ed8f10
root file system type: ffs
init: copying out path `/sbin/init' 11
swapctl: adding /dev/sd1b as swap device at priority 0
Automatic boot in progress: starting file system checks.
/dev/rsd1a: file system is clean; not checking
setting tty flags
starting network
configuring network interfaces:.
starting system logger
check for core dump...
savecore: no core dump
starting rpc daemons: portmap.
starting nfs daemons:.
creating runtime link editor directory cache.
/: bad dir ino 4160 at offset 512: mangled entry
panic: bad dir
Stopped at 		_Debugger+0x6:	unlk a6
db>
 (computer freezes)