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

Re: Porting Debian to the Excito B3

On Wed, Jan 26, 2011 at 11:43:12AM +0100, Tanguy Ortolo wrote:
> Now, I have questions about the machine id. In flash-kernel, this is a
> number that is prepended to the kernel before creating the uImage. For
> instance, for "Buffalo Linkstation Pro/Live":
>     kfile="/boot/vmlinuz-$kvers"
>     # Set machine id 1585 (0x0631)
>     devio > "$tmpdir/kernel" 'wl 0xe3a01c06,4' 'wl 0xe3811031,4
>     cat "$kfile" >> "$tmpdir/kernel"
>     mkimage -A arm -O linux -T kernel -C none -a 0x00008000 \
>             -e 0x00008000 -n "$desc" -d "$tmpdir/kernel" \
>             "$tmpdir/uImage.buffalo" >&2 1>/dev/null
>     mv "$tmpdir/uImage.buffalo" /boot/
> If I got it correctly, this machine id is used by the kernel to know
> what hardware it is running on, to drive the peripherals correctly, I
> suppose.

I believe it's something like that, yes.

> Though devio does not seem to be documented very well, I think this
> created "$tmpdir/kernel", putting some bytes at its beginning.

Yes, that's correct.

 I have
> some questions about that:
> 1. Why using devio at all, would not it be easier to use echo?

I'm *guessing* it's for readability, but honestly I have no idea.  Martin
Michlmayr is probably the go-to guy for that sort of thing.  The git logs
aren't even helping me.

> 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.

> 3. Where are these machine ids defined in the kernel? I hope Excito B3
>    are already known???

I believe the file of interest is arch/arm/tools/mach-types.  Depending on
whether the device is actually the same hardware as another, it may not need
it's own machine type ID; if it does, then it should already have one if
it's supported in the mainline kernel, and the Excito developers should know
about it.  Otherwise, it'll get one when it gets merged into mainline.

- Matt

Reply to: