Date: Sun, 28 Sep 2014 09:21:25 -0600 From: Ian Lepore <ian@FreeBSD.org> To: Rui Paulo <rpaulo@me.com> Cc: freebsd-arm@freebsd.org, Russell Haley <russ.haley@gmail.com> Subject: Re: Digi CCWMX53 Message-ID: <1411917685.66615.309.camel@revolution.hippie.lan> In-Reply-To: <42B4958F-21B2-4ABB-82C9-3F0B328EFED0@me.com> References: <CABx9NuQr%2BdEb_yj3ypEe6Sb_qPY%2BqP74n0x1K5=_K6Zoio2vkw@mail.gmail.com> <C439A1ED-8AA0-4CA5-B375-D80E8BD4C624@me.com> <CABx9NuQH36gyh1cT06fN7eJLZhrByzWpJH-RN8kb7hJi2ad9xw@mail.gmail.com> <42B4958F-21B2-4ABB-82C9-3F0B328EFED0@me.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 2014-09-27 at 09:30 -0700, Rui Paulo wrote: > On Sep 26, 2014, at 23:19, Russell Haley <russ.haley@gmail.com> 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 address + 100> load kernel.bin; go <load address> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1411917685.66615.309.camel>