Actual Kernel for Qemu


14 posts
by PIstolero » Fri Aug 31, 2012 1:01 am
Has anybody compiled the newest Kernel for Qemu?
I donwload the latest Kernel from https://github.com/raspberrypi/linux.git, patch it with linux-arm.patch and compile it like here.
http://xecdesign.com/compiling-a-kernel/
When I´m trying to boot the raspian image in Qermu with it I got an illegal instruction and it stays in runlevel 2. Am I missing something?
Attachments
Illegal_instruction.png
Illegal_instruction.png (62.44 KiB) Viewed 5647 times
User avatar
Posts: 101
Joined: Mon Jul 23, 2012 6:28 am
Location: paradise city, where the grass is green and the girls are pretty
by plugwash » Fri Aug 31, 2012 2:02 am
When you started qemu did you specify the CPU type?
Forum Moderator
Forum Moderator
Posts: 1982
Joined: Wed Dec 28, 2011 11:45 pm
by PIstolero » Fri Aug 31, 2012 2:13 am
Yes, I use -cpu arm1176, with the kernel 3.1.9 (the one from the all-in-one download) raspian is running.
To check if I have made some mistake with the kernel config I tried the config file from Drogon (only changed the path to the CONFIG_CROSS_COMPILE):
http://unicorn.drogon.net/rpi/
I got the same illegal instruction.
User avatar
Posts: 101
Joined: Mon Jul 23, 2012 6:28 am
Location: paradise city, where the grass is green and the girls are pretty
by aaa801 » Fri Aug 31, 2012 3:37 pm
can you logcat it?
Posts: 423
Joined: Mon Jun 04, 2012 9:06 pm
Location: Berkshire
by PIstolero » Fri Aug 31, 2012 3:56 pm
I don´t know what logcat is but if I need to login to do that then it will not work (no login possible)
User avatar
Posts: 101
Joined: Mon Jul 23, 2012 6:28 am
Location: paradise city, where the grass is green and the girls are pretty
by PIstolero » Thu Sep 06, 2012 10:49 am
I tried it again today and got it working. I don´tknow what the problem was, probably I just missed something. :oops:
The only thing I changed was the Linaro toolchain.
https://launchpad.net/linaro-toolchain- ... /+download
Kernel3.2.27.png
Kernel3.2.27.png (47.01 KiB) Viewed 5536 times
User avatar
Posts: 101
Joined: Mon Jul 23, 2012 6:28 am
Location: paradise city, where the grass is green and the girls are pretty
by aaa801 » Thu Sep 06, 2012 5:47 pm
can you upload the kernel ?
Posts: 423
Joined: Mon Jun 04, 2012 9:06 pm
Location: Berkshire
by PIstolero » Fri Sep 07, 2012 4:54 am
Yes, but I don´t know where (The attachment’s file size is too large, the maximum forum upload size is 2 MB)
I´m behind a restritive proxy so most filehoster are blocked.
If you want I also compiled qemu-system-arm 1.2.0 (out since yesterday) for Windows and Opensuse but it also has more than 2MB.
User avatar
Posts: 101
Joined: Mon Jul 23, 2012 6:28 am
Location: paradise city, where the grass is green and the girls are pretty
by PIstolero » Fri Sep 07, 2012 9:43 am
OK, I found a filehoster that is not blocked here:
Thats Kernel 3.2.27 for Qemu:
http://www.file-upload.net/download-4761016/zImage.html

To try it out just put it in the download folder from here:
http://sourceforge.net/projects/rpiqemuwindows/

And change the .bat file to (my kernel is zImage, the original was kernel-qemu):
-kernel zImage

If you want to change your Qemu to the new 1.2.0 just download this file and put in the download folder (overwrite the old qemu-system-arm.exe or backup it):
http://www.file-upload.net/download-476 ... m.exe.html

qemu1.2.0.png
qemu1.2.0.png (28.42 KiB) Viewed 5466 times
User avatar
Posts: 101
Joined: Mon Jul 23, 2012 6:28 am
Location: paradise city, where the grass is green and the girls are pretty
by PIstolero » Mon Sep 17, 2012 6:16 am
I put the kernel 3.2.27 at the wiki, it is a better place as the filehoster (too much adds)
http://elinux.org/images/6/68/ZImage.7z
Unzip it it first.
User avatar
Posts: 101
Joined: Mon Jul 23, 2012 6:28 am
Location: paradise city, where the grass is green and the girls are pretty
by PIstolero » Tue Oct 16, 2012 5:35 pm
I saw that the Kernel 3.6.1 is avaible for the RPI so I compiled it for Qemu.
https://github.com/raspberrypi/linux/tree/rpi-3.6.y
I got this bug when I tried to compile it:
/home/ich/dev/raspberrypi-tools-9c3d7b6/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-ld: cannot find drivers/misc/vc04_services/built-in.o: No such file or directory
make[2]: *** [drivers/misc/built-in.o] Fehler 1
make[1]: *** [drivers/misc] Fehler 2

The solution:
Open driver/misc/Makefile with an editor and change:
-obj-y += vc04_services/
to
+obj-$(CONFIG_BCM2708_VCHIQ) += vc04_services/

Then it compiles. If you don´t want to compile your own for Qemu, here it is:
http://elinux.org/File:ZImage.7z
Take the right one and unzip it first (7zip)

kernel_3.6.1.png
kernel_3.6.1.png (28.19 KiB) Viewed 4990 times
User avatar
Posts: 101
Joined: Mon Jul 23, 2012 6:28 am
Location: paradise city, where the grass is green and the girls are pretty
by Torlus » Mon Nov 19, 2012 8:36 am
PIstolero wrote:Has anybody compiled the newest Kernel for Qemu?
I donwload the latest Kernel from https://github.com/raspberrypi/linux.git, patch it with linux-arm.patch and compile it like here.
http://xecdesign.com/compiling-a-kernel/
When I´m trying to boot the raspian image in Qermu with it I got an illegal instruction and it stays in runlevel 2. Am I missing something?


I did the same, and got the same error. However, using the soft-float Debian wheezy image instead of raspbian worked fine, so it seemed related to floating-point support.
I activated the VFP support in the kernel (in the "Floating point emulation" section), recompiled it, and it worked fine with raspbian image too.
Hope this helps,
Greg
Posts: 43
Joined: Mon Nov 19, 2012 8:26 am
by iwl » Tue Dec 18, 2012 3:24 pm
PIstolero wrote:I saw that the Kernel 3.6.1 is avaible for the RPI so I compiled it for Qemu.
Then it compiles. If you don´t want to compile your own for Qemu, here it is:
http://elinux.org/File:ZImage.7z


This 3.6.1 Kernel hangs at my QEMU 1.3 with latest Pi-Packages.

QEMU screen remains black CPU 100% (the Core it runs on)

The 3.2.7 Kernel works
Posts: 16
Joined: Mon Dec 17, 2012 5:35 pm
by ShiftPlusOne » Wed Dec 19, 2012 3:13 am
I wrote that article on xecdesign a while back. I am in the process of transferring the domain name, so it's not accessible right now.

While I did update the article recently to include hardfloat support, if you tried the instructions a while back, there was a step missing. You have to enable VFP in the kernel config to make sure raspbian boots properly.
Forum Moderator
Forum Moderator
Posts: 1211
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy