[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Porting Debian to the Excito B3



Hi all!

On Wednesday 26 January 2011 12:14:01 Matthew Palmer wrote:
> On Wed, Jan 26, 2011 at 11:43:12AM +0100, Tanguy Ortolo wrote:
...
> 
> > 2. How can such a kernel, prepended with some bytes, be
> >    bootable at all, as this shifts its entry point and all its data?
> 
> That's an excellent question.  I kinda assumed that the bytes were actually
> ARM machine code, but I've never thought much about it.

(At least ARM) Kernel code is relocatable (position independant).

This hack is only necessary if the bootloader does not pass the
good machine id in the r1 register.

I tried that :
devio > "/tmp/toto" 'wl 0xe3a01c06,4' 'wl 0xe3811031,4'
objdump -m arm -b binary -D toto
...
00000000 <.data>:
   0:   e3a01c06        mov     r1, #1536       ; 0x600
   4:   e3811031        orr     r1, r1, #49     ; 0x31

So sure, it is arm code, and it places 0x631 into r1!

Best regards

Marc


Reply to: