Subject: Re: Filesystems vs. device sector sizes
To: None <pavel@netbsd.org>
From: Stephen M. Rumble <stephen.rumble@utoronto.ca>
List: tech-kern
Date: 07/27/2007 16:40:37
Quoting Pavel Cahyna <pavel@netbsd.org>:

> Could the driver (cd) be taught to support 512b requests from upper layers
> by splitting sectors itself? That is, effectively pretend that the device
> block is 512b?

> Actually this is apparently already implemented.

[snip]

> But apparently you need to set sector size in the disklabel to 512b
> otherwise cdstrategy will reject such requests.

I actually do this now in svhlabel (by mistake, originally). On my  
i386 laptop and in QEMU I can force the cd0 disklabel to 512b sectors  
and mount an EFS filesystem, but it eventually goes haywire. I don't  
recall exactly what went wrong (I had tried this quite a while ago),  
but I seem to recall piixide getting into some funny state that  
necessitates a reboot. I assumed it was getting upset after trying to  
access something unaligned. I have no idea if this is even possible,  
however. (Are the drives byte or block addressed?)

Interestingly, I've been told that on macppc EFS cd's cannot be  
mounted at all. Perhaps it's an endianness bug (EFS is BE and I've  
only tested on LE machines), so the EFS code could certainly be to  
blame, though swapping when I shouldn't seems sort of unlikely.

I had originally assumed that I was just getting lucky in being able  
to mount the file system and that something more fundamental was  
keeping it from working, hence why I started this thread. It now  
appears that there may be a bug somewhere else. I'll have to look into  
this further.

Thanks to all for the help,
Steve