Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jun 2009 12:23:06 -0500
From:      "Rick C. Petty" <rick-freebsd2008@kiwi-computer.com>
To:        Daniel O'Connor <doconnor@gsoft.com.au>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Loader reading FAT
Message-ID:  <20090616172306.GA91395@keira.kiwi-computer.com>
In-Reply-To: <200906162350.40221.doconnor@gsoft.com.au>
References:  <200906162350.40221.doconnor@gsoft.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jun 16, 2009 at 11:50:38PM +0930, Daniel O'Connor wrote:
> 
> Unfortunately I can't get the loader to read a FAT partition which 
> surprises me because I think it should be able to.. I believe that 
> libstand can do it (I can see the code :) however when I list the USB 
> stick device I get an empty directory listing.

I read somewhere that there isn't enough space in the boot2 loader to put
such logic.  You're only guaranteed 15 512-byte sectors or 7680 bytes, if
you use any UFS partition.  It's pretty tight; I think you will find it
difficult to insert another file system in there, especially one as
complicated as msdos.  libstand is 223 KB, so it's not as trivial as you
think.

Theoretically it would be possible: for example, if you're willing to set
aside a separate partition you would have as much room as you want.  Or if
you put it at the front of a UFS partition, you have just under 256 KB of
room since our UFS code will search for the superblock at a byte offset of
262144, but there aren't any knobs to newfs so you'd have to hack it
together.  Take a look at /usr/src/sys/boot/i386/boot2/ for starters.

-- Rick C. Petty



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090616172306.GA91395>