Digi CCWMX53

Ian Lepore ian at FreeBSD.org
Sun Sep 28 15:21:34 UTC 2014


On Sat, 2014-09-27 at 09:30 -0700, Rui Paulo wrote:
> On Sep 26, 2014, at 23:19, Russell Haley <russ.haley at 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




More information about the freebsd-arm mailing list