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

Re: Compiling arm kernel [was Re: Getting emdebian crush running: root passwort created by emsandboy and tty problem]



This is starting to get a little OT for debian-embedded  - hope people
don't mind.
The linux-arm-kernel list would probably be a better fit but its a)
moderated and b) quite high traffic.

> Hi Martin,
> thanks for your detailed description of how you cross compile the Kernel and the good luck wishes :). I downloaded the same kernel version as the Elions Distribution is running and used the same kernel .config file. I didn't touch the makefile as from reading it it should be possible to get the same when calling make appropriately, in my case:
> make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- menuconfig
> and then make ARCH=arm CROSS_COMPILE=arm-linux-gnueab-
>
>   
Yes you can do it that way - I just prefer not having to remember to
give the ARCH= option to every command..

> I got a vmlinux image in the source tree which I made "u-bootable" by:
> mkimage -A arm -O linux -T kernel -C none -a 0xa0008000 -e 0xa0008000 -n "Linux 2.6.22" -d vmlinux pImage
>
> The addresses where stolen from the uboot terminal when booting the Elinos Kernel.
> However, after "Kernel starting" pretty much nothing is happening using the new kernel. You mentioned something about a machine number which has to match with uboot and the kernel, I didn't understand this fully. Is mkimage not updating everything and adds the uboot header and checksum etc.? If something is not right to uboot I thought it issues statements like "bad magic number" (had this as well but I didn't feel anything magic about at all).
> I thought maybe it is only a console problem and after a certain time I tried to ping the board without success.
> What I am doing now is to compare the kernel building to the elinos one and afterwards trying to enable CONFIG_DEBUG_LL.
> If you have any hints on how to debug this it would be greatly appreciated as I think you have much more experience in this (for me it is the first time :))
>   
Yes you definitely need to enable CONFIG_DEBUG_LL
The "Kernel starting" message is coming from uboot not the kernel.

With CONFIG_DEBUG_LL you should then get :
Uncompressing Linux...................... done, booting the kernel.

At this point if your machine ID is wrong you will get an error message
telling you so.
For more info on the machine ID thing please read
Documentation/arm/Booting in the kernel source tree.
Basically the bootloader determines the machine ID in someway (often
simply compiled in constant but could be configuration or hardware
detection) and passes it to the kernel in the r1 register. This has
nothing to do with mkimage or the uboot headers etc (which just ensure
the image file was correctly transferred)

One you've got the Uncompressing message above, if it hangs without a
machine ID error but without showing any other output that means that
something is going wrong in the early stages of the kernel boot. You can
debug this by modifying kernel/printk.c as described here (interesting
stuff near the bottom):
http://lists.arm.linux.org.uk/lurker/message/20081210.174754.29691349.en.html

Also ensure you are passing a suitable console= command line argument to
the kernel!


Cheers,

Martin



Reply to: