Subject: Re: ffs problems w/ Carrera040 kernel
To: Colin Wood <cwood@ichips.intel.com>
From: I-Jong Lin <ijonglin@EE.Princeton.EDU>
List: port-mac68k
Date: 09/03/1998 00:40:06
> 
> I-Jong Lin wrote:
> > 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.
> 
> perhaps something still thinks it's an '040?
>  

I don't think so.  Basically, the machine and mmu type seems to be correctly
guessed during the boot-up.  Also, it seems the file system stuff is
in the machine independent section of the source.  Also, I force the 
environment variable PROCESSOR to be an '040.  So, I don't know what else
could be going on.



> > 2.  What files in the source code control writes to an ffs filesystem?
> 
> well, quite a few, actually.  take a look at src/sys/ufs, i think.  also,
> you'll want to look at the SCSI drivers.....in all reality, this could be
> really nasty to debug :-(
> 

ugh. :(  It just seems rather bizarre that I can read from the disk,
but I am unable to write to it.  This assymetry bothers me.


> > db>
> >  (computer freezes)
> 
> can you do a 'trace' in the debugger at this point?  it might help.
> 

If a 'trace' involves any typing, I am unable to type anything in at 
the prompt, so I'm pretty much stuck there.


Here's some more weirdness that I've gotten from testing the system.
So, I fall into single user mode w/ the root directory mounted r/w.
It seems that I can play around indefinitely as long as I don't
write to the disk.  I can create a small files, but when I
create a large file, the command completes, but the / directory
is no longer visable, although its subdirectories are.   So, I
can "ls /usr/bin" and run the normal system commands, but "/"
directory is just gone.    When I run fsck to try to fix it,
it tells me the number of free blocks is wrong and superblock
magic number is also wrong.

Help!

I-Jong