
Thanks for pointing this out, I'll see what I can do about it.
cooky451 wrote: Then I tried
-kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -append "root=/dev/sda2" -hda 2012-07-15-wheezy-raspbian.img
You're trying to do very different thing here. Running with the "-M versatilepb" option emulates ARM's Versatile Platform Baseboard series' hardware. Using "-M raspi" option emulates the RasPi (badly) based on my patches.cooky451 wrote: If I start with
-kernel my_kernel -cpu arm1176 -m 256 -M raspi
qemu immediately crashes, even if the "my_kernel" does nothing else than while (true);
Correct me if I am wrong, Torlus. It should be possible to compile qemu-rpi the same way you would compile regular qemu. I've compiled qemu for windows a few times, but it's certainly not worth the effort. I may give this a go if I get some free time, though I suspect someone else will beat me to it.cooky451 wrote:So what you're saying is that qemu-rpi is probably not going to run on windows?Emulating a Linux system to emulate the rpi seems kinda annoying to me.
Yes it should be possibleShiftPlusOne wrote:Correct me if I am wrong, Torlus. It should be possible to compile qemu-rpi the same way you would compile regular qemu. I've compiled qemu for windows a few times, but it's certainly not worth the effort. I may give this a go if I get some free time, though I suspect someone else will beat me to it.cooky451 wrote:So what you're saying is that qemu-rpi is probably not going to run on windows?Emulating a Linux system to emulate the rpi seems kinda annoying to me.
Code: Select all
ENTRY(_start)
MEMORY
{
kernel : org = 0x8000, len = 1M
}
SECTIONS
{
.text : { *(.text*) } >kernel
.bss : { *(.bss) } >kernel
.data : { *(.data) } >kernel
.rodata : { *(.rodata) } >kernel
}
Code: Select all
~/rpi/usr/bin/qemu-system-arm -kernel zImage -cpu arm1176 -m 512 -M raspi -no-reboot -serial stdio -append "rw earlyprintk loglevel=8 panic=120 keep_bootcon rootwait dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1024 bcm2708_fb.fbheight=768 bcm2708.boardrev=0xf bcm2708.serial=0xcad0eedf smsc95xx.macaddr=B8:27:EB:D0:EE:DF sdhci-bcm2708.emmc_clock_freq=100000000 vc_mem.mem_base=0x1c000000 vc_mem.mem_size=0x20000000 dwc_otg.lpm_enable=0 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait" -sd 2012-12-16-wheezy-raspbian.img -device usb-kbd -device usb-mouse -S -s -d guest_errors
Code: Select all
~/rpi/arm-2011.03/bin/arm-none-linux-gnueabi-gdb linux/vmlinux
GNU gdb (Sourcery G++ Lite 2011.03-41) 7.2.50.20100908-cvs
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi".
For bug reporting instructions, please see:
<https://support.codesourcery.com/GNUToolchain/>...
Reading symbols from /home/greg/rpi/linux/vmlinux...done.
(gdb) target remote:1234
Remote debugging using :1234
0x00000000 in ?? ()
(gdb) display/i $pc
1: x/i $pc
=> 0x0: mov r0, #0
(gdb) ni
0x00000004 in ?? ()
1: x/i $pc
=> 0x4: ldr r1, [pc, #4] ; 0x10
(gdb)
Code: Select all
~/rpi/usr/bin/qemu-system-arm -M raspi -cpu arm1176 -kernel kernel.img -initrd kernel.img
Code: Select all
$ ./configure --prefix=/home/neumaennl/qemu-rpi
$ make all
$ make install
Ah, that's it! Adding "-initrd kernel.img" makes it work. ISTR I saw that somewhere but didn't pay much attention.Then, make sure you're running your own kernel like this :Code: Select all
~/rpi/usr/bin/qemu-system-arm -M raspi -cpu arm1176 -kernel kernel.img -initrd kernel.img
Anyone know what gives?LINK arm-softmmu/qemu-system-arm.exe
../qemu-char.o: In function `qemu_chr_open_udp':
f:\XEC\qemu/qemu-char.c:2300: undefined reference to `io_channel_from_socket'
../qemu-char.o: In function `udp_chr_update_read_handler':
f:\XEC\qemu/qemu-char.c:2266: undefined reference to `io_add_watch_poll'
../qemu-char.o: In function `tcp_chr_connect':
f:\XEC\qemu/qemu-char.c:2541: undefined reference to `io_add_watch_poll'
../qemu-char.o: In function `tcp_chr_add_client':
f:\XEC\qemu/qemu-char.c:2571: undefined reference to `io_channel_from_socket'
../qemu-char.o: In function `qemu_chr_open_socket_fd':
f:\XEC\qemu/qemu-char.c:2702: undefined reference to `io_channel_from_socket'
f:\XEC\qemu/qemu-char.c:2711: undefined reference to `io_channel_from_socket'
../qemu-char.o: In function `tcp_chr_write':
f:\XEC\qemu/qemu-char.c:2344: undefined reference to `io_channel_send_all'
collect2.exe: error: ld returned 1 exit status
make[1]: *** [qemu-system-arm.exe] Error 1
make: *** [subdir-arm-softmmu] Error 2
Hi Torlus, thanks for this great work, it works pretty good with 2013-02-09-wheezy-raspbian (after commenting out the contents of /etc/ld.so.preload).Torlus wrote:Hi,
I've been working for a few weeks on a QEMU backend for RPi emulation.
It's now advanced enough to boot an unmodified Linux kernel, along with its associated SD image.
Get it here : https://github.com/Torlus/qemu-rpi
Please read carefully the instructions.
It's far from being complete, but well, I'm releasing it anyway.![]()
Hope it helps, and feel free to contribute.
Regards,
Greg