Booting the ELF kernel without ubldr on Raspberry Pi
Ian Lepore
ian at freebsd.org
Thu Dec 24 15:48:38 UTC 2015
On Thu, 2015-12-24 at 16:40 +0100, Sylvain Garrigues wrote:
> Hello Ian,
>
> I’m using u-boot from the ports (sysutils/u-boot-rpi2). It doesn’t
> display anything about cache being enabled.
>
> I was just comparing the time it takes to have the Linux kernel
> prints its first lines, and the time it takes for the FreeBSD kernel
> to print its own (the « Copyright » line) when used with u
> -boot+loader.
> For the former, it’s under a second, for the latter it’s about 3-4
> seconds (mainly spent when the loader loads the elf kernel).
>
> So I was wondered how they made it and was led to believe the Linux
> kernel is compressed (and self-extracting), leading to less loading
> time from the SD card which apparently is the bottleneck.
>
> So since the FreeBSD kernel has no « self-extracting » feature, and
> since ubldr doesn’t seem to support the extracting of a gzip kernel
> (well it seems to work with LOADER_GZIP_SUPPORT but I see no gain), I
> was trying to use the compression and extraction feature of u-boot
> with the use of recent mkimage with support for lzma compression. I
> thought I could boot directly a LZMA compressed kernel.bin with
> mkimage, without ubldr. But I forgot about the kernel expecting a
> variable with the DTB address, which is set up by ubldr, so I give up
> and will wait to see if someone is interested in implementing a self
> -extracting kernel in the future.
>
> Best,
> Sylvain
Don't hold your breath for a self-extracting armv6 kernel, that seems
highly unlikely, especially considering that LOADER_GZIP_SUPPORT
apparently works (I've been meaning to test that for months).
Hmm, in our config patches for rpi2 u-boot I see
+#define CONFIG_SYS_DCACHE_OFF
that's probably why loading the kernel is so slow. It was probably
disabled because it caused problems in ubldr, but I've developed some u
-boot patches since then to do proper cache maintenance before
launching standalone apps.
-- Ian
More information about the freebsd-arm
mailing list