nghia
Posts: 18
Joined: Fri Aug 26, 2011 11:02 pm

Re: Simulator/Emulator for Raspberry Pi?

Sat Aug 27, 2011 8:45 pm

Hi,

Is there any simulator/emulator I can use to test whether an existing specific Linux application would run on the Raspberry Pi and its performance?

Can't wait until November ....

Thx
Nghia

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6074
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Simulator/Emulator for Raspberry Pi?

Sat Aug 27, 2011 8:49 pm

qemu with the -M versatilepb -cpu arm1136-r2 options

stuporhero
Posts: 125
Joined: Fri Aug 19, 2011 2:02 pm

Re: Simulator/Emulator for Raspberry Pi?

Sun Aug 28, 2011 11:59 am

Found an emulator for Windows, strangely installing qemu in Ubuntu didn't give me an ARM option :(

Just need to find a (free) IDE now :D

obarthelemy
Posts: 1399
Joined: Tue Aug 09, 2011 10:53 pm

Re: Simulator/Emulator for Raspberry Pi?

Sun Aug 28, 2011 12:32 pm

google it ?

stuporhero
Posts: 125
Joined: Fri Aug 19, 2011 2:02 pm

Re: Simulator/Emulator for Raspberry Pi?

Sun Aug 28, 2011 12:59 pm

Indeed - keep coming up against an old project for eclipse that was last updated a few years back :(

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6074
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Simulator/Emulator for Raspberry Pi?

Sun Aug 28, 2011 1:09 pm

No qemu-system-arm executable with ubuntu's qemu package? That's strange.

I've compiled it for windows as well. You need to apply some patches to get it to compile everything properly. Do you want me to upload the binaries somewhere so that you don't have to go through that?

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6074
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Simulator/Emulator for Raspberry Pi?

Sun Aug 28, 2011 1:18 pm

Windows binary... let me know if anything is missing.
http://dl.dropbox.com/u/175702.....em-arm.zip

Also, the linux kernel needs a patch from Aboriginal linux to support the CPU properly on a Versatile board. I've included a compiled kernel as well.

stuporhero
Posts: 125
Joined: Fri Aug 19, 2011 2:02 pm

Re: Simulator/Emulator for Raspberry Pi?

Sun Aug 28, 2011 1:56 pm

That's awesome, thank you! :D

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6074
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Simulator/Emulator for Raspberry Pi?

Sun Aug 28, 2011 1:58 pm

There's no rootfs, so it's not very useful yet.

Dietmar
Posts: 361
Joined: Sun Sep 04, 2011 5:43 pm
Contact: Website

Re: Simulator/Emulator for Raspberry Pi?

Sat Sep 17, 2011 9:09 pm

Hi all,
the nice Tutorial from ShiftPlusO-ne
works. Now I have a Kernel, where I am sure that it supports
the ARM1176 CPU,
and soon I hope to send pictures from running XP and fps for Quake II here,
nice to hear from you
Dietmar

Jesse B
Posts: 15
Joined: Thu Sep 15, 2011 12:03 am

Re: Simulator/Emulator for Raspberry Pi?

Sat Sep 17, 2011 9:49 pm

I've boon fooling around using QEMU. I installed the armel version of Debian, just to make sure it all worked. Followed this guide:
Installing Debian Lenny on virtualized ARM arch (with QEMU) on Ubuntu Karmic Koala

It all works just fine. One thing I tried to do was add "-cpu arm1136-r2" to the command that starts the VM, but it just hangs. The QEMU window won't even open. If I remove it it boots fine and there's no issues. What's the reason for this?

Dietmar
Posts: 361
Joined: Sun Sep 04, 2011 5:43 pm
Contact: Website

Re: Simulator/Emulator for Raspberry Pi?

Sat Sep 17, 2011 10:20 pm

Hi Jesse,
I noticed the same behavior. Which version of Qemu are you using?
All below 0.15.0.0 give very bad results for any ARM CPU.
And there are two possibilities of mistake: The Linux may not work with the ARM 1136 CPU and/or Qemu also do not like.
For to test this, I compiled a new Kernel and Qemu 0.15.50 following the nice tutorial from
http://raspi.springnote.com/pa.....es/8234994

Now I have a Kernel, that boots with ARM 1176 CPU , that from Raspberry Pi, via Qemu 0.15.50 on Ubuntu 11.04
nice to hear from you
Dietmar

Update: I got it: It is the problem of the used Linux and not of Qemu.
The Linux from Debian has only support for Arm926 and not for ARM1136.
I found this out with Qemu 0.15.50. The Kernel with support for all ARM starts but not any other from the Debian server for ARMEL or ARM, brrr. So, you need a Linux, that supports ARM1136 CPU or ARM1176 (from Raspberry).

Jesse B
Posts: 15
Joined: Thu Sep 15, 2011 12:03 am

Re: Simulator/Emulator for Raspberry Pi?

Sat Sep 17, 2011 11:44 pm

Alright, thank you very much! I've read through the raspi tutorials you linked me to, but haven't tried it yet. I guess I'll be compiling my own kernel :D

Thanks again,

- Jesse

Jesse B
Posts: 15
Joined: Thu Sep 15, 2011 12:03 am

Re: Simulator/Emulator for Raspberry Pi?

Sun Sep 18, 2011 12:58 am

Alright, well I've gone through the guides that you linked to. I followed everything to the t, with the exception of the kernel downloaded (I got the latest stable release from github, due to the fact that kernel.org is down. Still version 3.0.x though). Everything went fine until trying to run the machine.

I ran the following command:
qemu-system-arm -M versatilepb -cpu arm1176 -hda rootfs.ext2 -no-reboot -kernel zImage -append "root=/dev/sda panic=1" -m 256

It opens up a qemu window, spits out a bunch of text, and closes. Here's a screenshot of the moment before it terminates:


I feel like I've missed something, but who knows at this point. I thought I followed the guide pretty thoroughly.

Thanks,

- Jesse

Dietmar
Posts: 361
Joined: Sun Sep 04, 2011 5:43 pm
Contact: Website

Re: Simulator/Emulator for Raspberry Pi?

Sun Sep 18, 2011 1:16 am

Hi Jesse,
make a try with
-append "root=/dev/sda1 panic=1"
I am much better in XP than in Linux :-),
but I think all is ok with your Kernel and Qemu.
You use Red Hat, long time ago..
have a nice day and big success,
Dietmar

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6074
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Simulator/Emulator for Raspberry Pi?

Sun Sep 18, 2011 3:01 am

Yup, looks like the kernel compiled properly and qemu works as it should.

/dev/sda1 shouldn't help because the root filesystem is ext2 without the MBR. If there was a partition table there then you would use /dev/sda1 and sda1 would be listed under "available partitions".

Anyway, the problem is with the root filesystem. Either it's not compatible with the particular arm processor or you need to specify a different init.

Where did you get the rootfs from?

If you're following the first tutorial you linked to ( Installing Debian Lenny on virtualized ARM arch (with QEMU) on Ubuntu Karmic Koala) make sure you use the initrd image they give you.

Jesse B
Posts: 15
Joined: Thu Sep 15, 2011 12:03 am

Re: Simulator/Emulator for Raspberry Pi?

Sun Sep 18, 2011 6:28 am

I actually followed the guides in your signature to get to that point. I'm not sure if the issue stemmed from using the 3.0 kernel on github (which I didn't have much choice, kernel.org still isn't working) or what.

I didn't see any initrd file included on that guide, so I'm a tad confused.

EDIT: Basically I've done the following:

Downloaded Sourcery toolchain and 3.0 kernel from GitHub
Patched kernel with linux-arm.patch
Ran make ARCH=arm versatile_defconfig & make ARCH=arm menuconfig
Ran through specified configuration, saved config
Ran make ARCH=arm & make ARCH=arm INSTALL_MOD_PATH=../modules modules_install

Compiled & Configured QEMU

Ran qemu-img create rootfs.ext2 2G & mkfs.ext2 rootfs.ext2

Dietmar
Posts: 361
Joined: Sun Sep 04, 2011 5:43 pm
Contact: Website

Re: Simulator/Emulator for Raspberry Pi?

Sun Sep 18, 2011 8:21 am

Hi Jesse,
make a try with FAT32 filesystem,
nice to hear from you
Dietmar

ahven
Posts: 12
Joined: Tue Aug 30, 2011 2:02 pm

Re: Simulator/Emulator for Raspberry Pi?

Sun Sep 18, 2011 8:22 am

Quote from Jesse B on September 18, 2011, 07:28
I actually followed the guides in your signature to get to that point. I'm not sure if the issue stemmed from using the 3.0 kernel on github (which I didn't have much choice, kernel.org still isn't working) or what.

I didn't see any initrd file included on that guide, so I'm a tad confused.

EDIT: Basically I've done the following:

Downloaded Sourcery toolchain and 3.0 kernel from GitHub
Patched kernel with linux-arm.patch
Ran make ARCH=arm versatile_defconfig & make ARCH=arm menuconfig
Ran through specified configuration, saved config
Ran make ARCH=arm & make ARCH=arm INSTALL_MOD_PATH=../modules modules_install

Compiled & Configured QEMU

Ran qemu-img create rootfs.ext2 2G & mkfs.ext2 rootfs.ext2
That is correct for the kernel part, but you need to install/download a rootfs, can't find any links to the Aboriginal premade things but the guidelines for your install can be found here, for example: http://dev.emcelettronica.com/.....n-arm-qemu I had to actually use the debian provided debian kernel when running the installer inside qemu, later on switched to my prebuilt. Directory "modules" must be copied to /lib under the rootfs when you use your kernel. Hope I made some sence :)

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6074
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Simulator/Emulator for Raspberry Pi?

Sun Sep 18, 2011 10:38 am

You're trying to boot a root filesystem which is empty.

My tutorial only deals with compiling the kernel, qemu and using qemu. I don't go into how to get a working root filesystem. That's all documented by the distro of your choice.

obarthelemy
Posts: 1399
Joined: Tue Aug 09, 2011 10:53 pm

Re: Simulator/Emulator for Raspberry Pi?

Sun Sep 18, 2011 3:17 pm

Found this by chance, doesn't seem to be linked in the forums (couldn't find 'aurel32'). Hope this helps !
http://www.aurel32.net/info/de.....m_qemu.php

Dietmar
Posts: 361
Joined: Sun Sep 04, 2011 5:43 pm
Contact: Website

Re: Simulator/Emulator for Raspberry Pi?

Sun Sep 18, 2011 3:42 pm

Hi obarthelem-y,
now I think, that something went wrong during the building of the new Kernel 3.0.4
When all is ok, automatically during compiling of the Kernel is a file config-3.0.4 build in /boot/config-3.0.4. Exact this file is missing. So you get a message
modprobe: FATAL: Could not load /lib/modules/3.0.4/modules.dep: No such file or directory . Can this happen, that the settings for the new Kernel are not stored?
I am not good enough in Linux,
but I think this is what happens,
Dietmar

EDIT: initrd only works, if the drivers for the file system are fix compiled into the kernel. Initrd will not work, if the needed drivers are compiled as modules.

EDIT2: yepp :-) cp -v .config /boot/config-3.0.4
So, the configurationsfile is just on wrong place.

EDIT3: request_module: runaway loop modprobe binfmt-464c
If you are getting this error right after linux kernel initialization, you are likely booting a 32-bit kernel with a 64-bit OS. ???
EDIT4: Is at any place in the config menu for the kernel compile a flag set,
that can be interpreted as 64 BIT ???

EDIT5: From Internet (not me)
request_module: runaway loop modprobe binfmt-464c
The toolchain I used for building busybox was for an x86-64 machine. But my target is an x86-32 machine. After building with the right toolchain the message disappeared.

User avatar
ukscone
Forum Moderator
Forum Moderator
Posts: 4182
Joined: Fri Jul 29, 2011 2:51 pm
Contact: Website

Re: Simulator/Emulator for Raspberry Pi?

Sun Sep 18, 2011 4:10 pm

i might be remembering incorrectly but i believe eben (or liz or jamesh or someone) said that the kernel that will be shipped with the educational version at least is one of the later 2.6 series. for some reason i seem to remember 2.6.35 being mentioned.

This info might be out of date by now as the boards are int he distro's hands and it's their decision mostly but for tests and messing around you might want to build a 2.6 series kernel too

Dietmar
Posts: 361
Joined: Sun Sep 04, 2011 5:43 pm
Contact: Website

Re: Simulator/Emulator for Raspberry Pi?

Sun Sep 18, 2011 9:46 pm

Hi ukscone,
to compile the Kernel 2.6.35 for ARM1176 with the Tutorial does not work.
Even I put the arm-kernel patch with hand in, starting this Kernel says it runs out of memory :-), and before where also some error messages during compile.

So, I build Kernel zImage new from Linux-3.0.4 with the nice Tutorial. Exact the same happens as before. But then I come to the idea to use download via Debian, so that my not recogniced Harddisk is unimportant. This works!!!
In this moment it is installing...
My commandline for qemu is

qemu-system-arm -M versatilepb -cpu arm1176 -kernel zImage -initrd initrd.gz -hda harddisk.img -append "root=/dev/ram" -m 256

before I build harddisk with

qemu-img create harddisk.img 8G

By the way, this Kernel does not support ext3 filesystem, only ext2.
Now I am happy and tired,
greetings Dietmar

PS: Only partitioniering with hand works. The debian installer also cannot build a filesystem with ext3 on it, but ext2 from hand works.

User avatar
emercer
Posts: 165
Joined: Sun Aug 07, 2011 1:54 am
Location: Sao Paulo, Brazil
Contact: Website

Re: Simulator/Emulator for Raspberry Pi?

Sun Sep 18, 2011 9:53 pm

@Dietmar

Are you running qemu-system-arm on a Windows host or Linux host? I'm finishing installing Debian on a Windows 7 64 host, will report on my successes/failures as soon as it's done.

Return to “Other projects”