From owner-freebsd-arm@FreeBSD.ORG Sun Sep 28 15:21:34 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D238CCD for ; Sun, 28 Sep 2014 15:21:34 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2117911C for ; Sun, 28 Sep 2014 15:21:34 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XYGHu-0009H3-Rq; Sun, 28 Sep 2014 15:21:26 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id s8SFLP2h009944; Sun, 28 Sep 2014 09:21:25 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX183GtMl/gBgH/FQf1jm9ZEH X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: Digi CCWMX53 From: Ian Lepore To: Rui Paulo In-Reply-To: <42B4958F-21B2-4ABB-82C9-3F0B328EFED0@me.com> References: <42B4958F-21B2-4ABB-82C9-3F0B328EFED0@me.com> Content-Type: text/plain; charset="us-ascii" Date: Sun, 28 Sep 2014 09:21:25 -0600 Message-ID: <1411917685.66615.309.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: freebsd-arm@freebsd.org, Russell Haley X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Sep 2014 15:21:34 -0000 On Sat, 2014-09-27 at 09:30 -0700, Rui Paulo wrote: > On Sep 26, 2014, at 23:19, Russell Haley wrote: > > > > Fantastic, > > > > Thanks so much Warner and Rui. > > > > Rui I've been pouring over your page trying to glean as much as I could > > from it. I'm working with someone else and he tried booting from the > > addresses on your page but since I wasn't building with the cross compiler > > the kernel was never going to boot. He was wondering why the offset for the > > go command when booting from the network (setenv bootcmd 'dhcp; tftpboot > > 0x70800000 kernel.ccwmx53; go 0x70800100')? > > The offset is the entry point of the ELF file. I think we could use U-Boot's bootelf, but I forgot if it works. > > -- > Rui Paulo We can use bootelf on ubldr, but not on the kernel, because our kernel linker script doesn't fill in the physical load address properly in the elf header (it would try to load the virtual address). So the two options for launching the kernel directly are: load kernel; go load kernel.bin; go The standard no-suffix kernel file is an elf binary with the wrong load address in the header, and the header is 0x100 bytes, so the entry point is immediately after that. The kernel.bin file is exactly the same as kernel, but with the elf header stripped off, so the entry point is at an offset of zero. An interesting thing about our kernel is that it can be loaded at any 1MB boundary in physical memory, not just the address it was linked at. There's no way to represent that in an elf header. This is true of both kernel and kernel.bin. -- Ian