I ‘ve cross compiled a Linux Kernel (for ARM on i686 – using Cross-LFS).
Now I’m trying to boot this Kernel using QEMU.
$ qemu-system-arm -m 128 -kernel /mnt/clfs-dec4/boot/clfskernel-2.6.38.2 --nographic -M versatilepb
Then, it shows this line and waits for infinite time !!
Uncompressing Linux... done, booting the kernel.
So, I want to debug the kernel, so that I can study what exactly is happening.
I’m new to these kernel builds, Can someone please help me to debug my custom built kernel as it is not even showing anything after that statement. Is there any possibility of the kernel being broken? ( I dont think so, b’se it didnot give any error while compiling )
And my aim is to generate a custom build very minimal Linux OS. Any suggestions regarding any tool-chains etc which would be easy & flexible depending on my requirements like drivers etc.,
ThankYou
You can use GDB to debug your kernel with QEMU you can use
-s -Soptions. If you want a simple and reliable toolchain, you can useELDKfrom DENX (http://www.denx.de/wiki/DULG/ELDK).You can install it like this (It’s not the last version, but you got the idea):
sudo mkdir -p /mnt/cdrom(if necessary)The command above should install the toolchain under
$HOLE/EMBEDDED_TOOLS/ELDK(modify it if you need)You can then see the version of your ARM toolchain like this:
You can test a hello_world.c program like this:
And you type: file hello_wrold to see the target architecture of the binary, it should be something like this:
Now if you want to compile a production kernel, you need to optimize it (i suggest using
busybox) and if you want just one for testing now, try this steps:Create a script to set your chain tool set_toolchain.sh:
#! /usr/bin/shPATH=$PATH:$HOME/EMBEDDED_TOOLS/ELDK/ELDK42/usr/binARCH=armCROSS_COMPILE=arm-linux-gnueabi-export PATH ARCH CROSS_COMPILEAnd run your script (
source ./set_toolchain.sh)Inside your unzipped kernel:
Here we use versatile chip, you may need to use
make menuconfigto modify the optionOABIand set it toARM EABI, this option is underKernel features menuAfter all this steps, you can compile you kernel:
if you want verbose compilation
make v=1After this you got your kernel under
arch/arm/boot/zImage.Hope this help.
Regards.