From owner-freebsd-arm@freebsd.org Thu Dec 24 15:48:38 2015 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 150ACA50B1B for ; Thu, 24 Dec 2015 15:48:38 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D38221A34 for ; Thu, 24 Dec 2015 15:48:37 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Thu, 24 Dec 2015 15:48:55 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id tBOFmZmE005842; Thu, 24 Dec 2015 08:48:35 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1450972115.25138.253.camel@freebsd.org> Subject: Re: Booting the ELF kernel without ubldr on Raspberry Pi From: Ian Lepore To: Sylvain Garrigues Cc: Tim Kientzle , freebsd-arm Date: Thu, 24 Dec 2015 08:48:35 -0700 In-Reply-To: References: <32849B9F-C7B8-4A86-B8F1-043F62D2E64C@kientzle.com> <8F62699C-126D-492D-8B7E-8C250ED5BC07@gmail.com> <1450970414.25138.238.camel@freebsd.org> Content-Type: text/plain; charset="iso-8859-7" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 15:48:38 -0000 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