[ELDK] [eldk 5] [arm] [qemu] init not tainted...
gilles B
gnetwb at hotmail.com
Fri Apr 18 11:17:20 CEST 2014
Hi,
I would like to install a light linux on Qemu ARM VersatilePB.
I use my Intel Core i3 to cross compile linux kernel 3.11.
So, i've installed ELDK 5 to cross compile to ARM:
http://www.denx.de/wiki/ELDK-5/WebHome
I followed installation process and all seems ok.
In ARM compilation environment:
source /opt/eldk-5.5/armv6/environment-setup-armv6-vfp-linux-gnueabi
I've configured linux 3.11 kernel to use "versatile_defconfig" :
make versatile_defconfig
and I've added EABI option.
I can't use make menuconfig because it needs ncurses shared libraries and i don't know how to install them with cross-compilation tools.
Any idea how to use ncurses with ARM ELDK ? (i tried to cross compile ncurses but i can't generate shared libraries).
So I've edited .config file and modified CONFIG_AEABI to yes: CONFIG_AEABI=y
I compiled linux kernel without any problem.
For
my tiny test, i want to load kernel without root file system, just ram
disk (initrd) and just an 'init' programm that displays 'hello' every
seconds.
I've compiled this code 'hello.c':
#include <stdio.h>
#include <stdlib.h>
main (int ac, char **av)
{
while (1) {
printf ("Hello\n");
sleep (1);
}
}
I tried this : arm-linux-gnueabi-gcc -static -o init hello.c
Command failed:
...../arm-linux-gnueabi/4.8.1/ld: cannot find -lc
collect2: error: ld returned 1 exit status
Like said by Wolfgang Denk, it seems that static option is not well supported by kernel : http://lists.denx.de/pipermail/eldk/2012-July/002162.html
Unfortunately my test has became a little bit more complex because I've to manage shared libraries by compiling without static option.
Last part, before to test with qemu-system-arm,I created an init ram disk with these files into a tmp directory:
/dev/ttyAMA0
/init
/lib/ld-linux.so.3
/lib/libc.so.6
I used commands:
cd tmp
find ./ | cpio --dereference -H newc -o | gzip -9 > ../rootfs_qemu.gz
I've launched qemu with :
qemu-system-arm
-M versatilepb -m 64 -kernel linux-3.11/arch/arm/boot/zImage -initrd
rootfs_qemu.gz -nographic -serial stdio -append
"console=ttyAMA0,115200 mem=64M"
And that fails with :
CPU: 0 PID: 1 Comm: init Not tainted 3.11.0 #1
Any idea to help me ?
Thank you very much.
Bet regards,
Gilles.
More information about the eldk
mailing list