U-boot FFS/UFS support
October 31st, 2008
Yes, it’s there. Well, you might say I was supposed to do something useful instead like improving FreeBSD rather than fighting with this huge and unstructured piece of code… However, for some time u-boot will be here for FreeBSD too before we will be able to roll out a featue-comparable embedded bootloader.
So I spend a couple of days and implemented FFS support for u-boot. This means now you’re able to have a complete FreeBSD system booting directly from FFS-formatted media from u-boot. Both UFS1 and UFS2 should be supported, though I only tested UFS2 support. This listing shows at91’s uboot displaying the listing of FFS-formatted CompactFlash partiton:
ATAMAN-TB> ffsls ide 0:1 /
INODE SIZE NAME
2 512 ./
2 512 ../
3 512 .snap/
4 2322058 kernel
5 578 rc.conf
You can grab the patch here: FFS patch. This should apply clearly on u-boot 1.3.4 tree.
To build U-boot on FreeBSD you will also need the ompatibilty patch which could be downloaded here. After that you can use toolchains provided by devel/cross-gcc and devel/cross-binutils ports to build u-boot for the required platform.
2 Responses to “U-boot FFS/UFS support”
Sorry, comments are closed for this article.
November 2nd, 2008 at 06:44 AM
What does this accomplish that /usr/src/sys/boot/* doesn't? Perhaps I'm missing something here. Will this allow you to (for instance) boot to the OS on a UFS partition from another OS such as Windows?
November 3rd, 2008 at 09:43 AM
Well, sys/boot can do that certainly too. But FreeBSD boot isn't very functional on embedded platfoms (ARM, MIPS, PowerPC) yet, so u-boot project loader often used instead of this. Not speaking of most of the boards come with u-boot preinstalled and it's not simple enough to replace it in some cases (as u-boot in fact servers a BIOS-like role in emedded boards). This patch allows one to load the FreeBSD kernel directly from u-boot without boot0 involvement.