From owner-freebsd-hackers Wed May 10 16:59:46 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id QAA09884 for hackers-outgoing; Wed, 10 May 1995 16:59:46 -0700 Received: from cs.weber.edu (cs.weber.edu [137.190.16.16]) by freefall.cdrom.com (8.6.10/8.6.6) with SMTP id QAA09878 for ; Wed, 10 May 1995 16:59:44 -0700 Received: by cs.weber.edu (4.1/SMI-4.1.1) id AA27802; Wed, 10 May 95 17:52:54 MDT From: terry@cs.weber.edu (Terry Lambert) Message-Id: <9505102352.AA27802@cs.weber.edu> Subject: Re: question on sun cds To: rgrimes@gndrsh.aac.dev.com (Rodney W. Grimes) Date: Wed, 10 May 95 17:52:54 MDT Cc: imp@village.org, hackers@FreeBSD.org In-Reply-To: <199505102312.QAA08704@gndrsh.aac.dev.com> from "Rodney W. Grimes" at May 10, 95 04:12:25 pm X-Mailer: ELM [version 2.4dev PL52] Sender: hackers-owner@FreeBSD.org Precedence: bulk > > Greetings, > > I have a need, from time to time, to read SunOS ufs formatted > > cds. These are from both SunOS 4.1.x and SunOS 5.x, aka Solaris. Is > > there something I've overlooked in FreeBSD 2.0R (or -current or 2.0.5) > > that will allow me to do this, ideally as a normal file system? > > No, you have not over looked anything. There is a fundemental problem > that makes this very hard to do. Can you say BIG_INDIAN vs LITTLE_INDIAN. > > I thought so.... Actually, for everything but the block offset calculations, the numbers are little other than tokens that get replaced in core by vnode addresses anyway. The big buggaboo is the volume label and directory entry structure differences that SunOS has. The zeroed inode number as a tag for an empty file system block is "different" in the directory entries themselves. Given the structure of the ffs/ufs division right now, I'd think you could share almost all the code except a block lookup function, which would add a function dereference overhead on block references (and another for direct inode lookups). You could get around that by pushing the two or three other ufs references into the ffs layer and making an endian-specific ffs layer for both. The overhead of a function pointer dereference compared to the layering abstraction itself as it currently sits isn't significant enough that I'd really worry about it anyway. I think it's just noise, since most of the block can come from the cache and you can use the inverted values as cache tags so no conversion is necessary for hits. > > Baring functional code, anybody have any ideas on how to procede? > > Major reworking of the ufs layer to do INDIAN conversion based on > volume label magic values. Can you say slow ufs after you do this? I'd say only a teeny bit slower FFS after this. The big buggaboo, like I said, is the volume label, and that's mostly clean bit handling and a couple of stamps for file system events that it'd be pretty easy to deal with. If you were trying to write a FS for a Solaris box instead, that'd be a much bigger pain (it'd have to be kernel preeemption safe and Sun did it the wrong way, IMO). Terry Lambert terry@cs.weber.edu --- Any opinions in this posting are my own and not those of my present or previous employers.