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

Re: Simulator/Emulator for Raspberry Pi?

Sun Sep 18, 2011 10:11 pm

Hi emercer,
before I tried with Windows XP, but I get only ARM926 to run there.
Then I come to the idea, that this may be not the fault of qemu but that all the avaible Debian packages for ARM ONLY give support for ARM926. This is just true.
But now I have a Kernel, that can boot ARM1176 and all is open again:-).
XP, Debian, XP is slow as much as possible.
But on real Hardware, only Debian, XP via Qemu has to work and to make XP small and quick, there I am good in,
nice to hear from you and what happens to you
Dietmar

PS: From where do you get a Kernel from Debian, that supports ARM1176? I am really curious.

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

Re: Simulator/Emulator for Raspberry Pi?

Sun Sep 18, 2011 10:52 pm

I've gotten Debian for arm installed, and it's booting just fine. Woo! This brings up a few more things however:

1.) I still can't boot with the "-cpu arm1176" option. Leaving it out works. Does this just mean that the Armel Debian isn't compatible with the arm1176, or what?
2.) I tried installing x11-common, xserver-xorg, and lxde, but it, well, isn't working :D It's just saying something about x not being configured properly. Anybody gotten this working yet?

Besides that it seems to be working. It's using only ~10MB of RAM at this point, so that's a good start. Desktop Environment should add quite a bit to that, but LXDE is fairly light weight.

Thanks,

- Jesse

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6194
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?

Mon Sep 19, 2011 3:12 am

I don't understand why people are struggling. Should I do a tutorial on how to get Debian going?

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

Re: Simulator/Emulator for Raspberry Pi?

Mon Sep 19, 2011 3:45 am

I'm not sure why I'm having issues at all to be honest. I understood what was going on the entire duration of the tutorials. However, whenever I got to the final step of running the VM, it never seemed to work as expected.

I did get Debian running. From there, I didn't try too much else.

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?

Mon Sep 19, 2011 3:31 pm

Quote from Jesse B on September 18, 2011, 23:52
1.) I still can't boot with the "-cpu arm1176" option. Leaving it out works. Does this just mean that the Armel Debian isn't compatible with the arm1176, or what?


Can't boot with -cpu arm1176 either. I get
Error: unrecognized/unsupported processor variant (0x4107b362)
when trying to boot kernel version 2.6.32-5 from the Debian ARMEL repositories. It does boot (and install) fine with the default processor for the versatilepb platform. It also installed and ran X just fine, I've tried Iceweasel with success on the emulated platform. I'm going to write a tutorial for QEMU on Windows (specially the tricky parts like bridging your internet connection to TAP) and upload a working disk image later (mine is in Brazilian portuguese, I'm re-installing in en-uk as I type this).

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6194
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?

Mon Sep 19, 2011 3:58 pm

yes, the kernel they provide does not support the processor.

here are the files I created to install and use Debian:

http://thoronir.net/raspi-dev/.....d-raspi.gz
http://thoronir.net/raspi-dev/.....rnel-raspi

create the filesystem where the root filesystem will be installed and call it debian.hda
create a file which we will use as swap and call it swap

To install, run this:
qemu-system-arm -M versatilepb -cpu arm1176 -hda debian.hda -hdb swap -kernel kernel-raspi -no-reboot -append "console=tty0 root=/dev/sda1 rw panic=5" -initrd initrd-raspi.gz

When installing, ignore the modules, RAID and LVM warnings, they don't affect the install.
Do not select the desktop packages while installing.
Do not use guided partitioning. Manually create a root filesystem on /dev/sda and make it ext3 and make /dev/sdb swap.

Once installed, use this to run it:
qemu-system-arm -M versatilepb -cpu arm1176 -hda debian.hda -hdb swap -kernel kernel-raspi -no-reboot -append "console=tty0 root=/dev/sda1 rw panic=5"

You will need to extract the modules from the initrd image (/lib/modules/) and copy them onto your rootfs.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6194
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?

Mon Sep 19, 2011 4:01 pm


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?

Mon Sep 19, 2011 9:39 pm

Quote from ShiftPlusOne on September 19, 2011, 16:58
qemu-system-arm -M versatilepb -cpu arm1176 -hda debian.hda -hdb swap -kernel kernel-raspi -no-reboot -append "console=tty0 root=/dev/sda1 rw panic=5" -initrd initrd-raspi.gz


The command doesn't run. It won't even give me an error message.

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

Re: Simulator/Emulator for Raspberry Pi?

Mon Sep 19, 2011 11:39 pm

Hi all,
I just repaired an error in the file
qemu/tcg/arm/tcg-target.c
This means for me: Nobody can make Qemu run on any ARM machine before this was corrected:-).
I changed in this file (with editor from XP :-)) before compiling

static void tcg_out_addi(TCGContext *s, int reg, tcg_target_long val)

against

static inline void tcg_out_addi(TCGContext *s, int reg, tcg_target_long val)

Yeeah, now I am installing Qemu on an Arm machine for to see the screen from XP,
nice to hear from you
Dietmar

EDIT: I succeeded to compile Qemu running on an ARM machine. This Qemu starts,
tomorrow more :-):-)
EDIT2: The same error in qemu\tcg\i386\tcg-target.c
stops the compiler. So, if you want to emulate PC machine,
it is impossible until you do the same fix as above. Strange for me, looks that somebody does not want, that this works :-)...

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

Re: Simulator/Emulator for Raspberry Pi?

Tue Sep 20, 2011 4:43 am

Victory!

Thank you very much for all your time and effort!

EDIT: More victory!

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6194
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?

Tue Sep 20, 2011 8:13 am

Quote from Jesse B on September 20, 2011, 05:43
Victory!

Thank you very much for all your time and effort!

EDIT: More victory!


That's awesome! How did you end up getting it to work?

Quote from emercer on September 19, 2011, 22:39
Quote from ShiftPlusOne on September 19, 2011, 16:58
qemu-system-arm -M versatilepb -cpu arm1176 -hda debian.hda -hdb swap -kernel kernel-raspi -no-reboot -append "console=tty0 root=/dev/sda1 rw panic=5" -initrd initrd-raspi.gz


The command doesn't run. It won't even give me an error message.

Hop on the IRC channel so we can work out what's going wrong.

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

Re: Simulator/Emulator for Raspberry Pi?

Tue Sep 20, 2011 2:25 pm

Quote from ShiftPlusOne on September 20, 2011, 09:13
That's awesome! How did you end up getting it to work?

I just followed the instructions that you recently posted in this thread, and everything worked as expected. Once I have some spare time (hopefully tonight) I'm going to attempt to investigate what wasn't working previously. But it's nice to have a working model.

x11-common, xserver-xorg, and lxde all installed and ran without a hitch this time as well.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6194
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?

Tue Sep 20, 2011 2:45 pm

Excellent

I am currently trying to get sound working. Since qemu doesn't emulate any sound hardware for the board, I am trying to use pulseaudio. I hope it works with usermode networking. I've tried setting up the TAP device, but it's too much hassle.

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?

Wed Sep 21, 2011 5:02 am

Okay, I didn't manage to get ARM11 emulation working, but I've written a little tutorial on setting QEMU up in Windows, setting up TAP and installing Debian. Here's the link:

http://cronicasredux.blogspot......el-on.html

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

Re: Simulator/Emulator for Raspberry Pi?

Wed Sep 21, 2011 11:26 am

I'm going through your guide right now emercer. Thanks a lot for taking the time to do a very nice write-up that not only tells us what to do but also explains a bit. I never actually knew what init-rd meant.
Everything is going fine for the moment. Taking ages though (AMD E-350).
Just a couple of remarks
- it's not very clear that we should unzip the packages as we DL them, and do that in their final dir as here is no install procedure. Fairly obvious once you tell us to actually run them though.
- When I did the Bridge dance, Windows not only asked for an IP adress, subnet mask, and gateway, but also forced me to manually enter DNSes. And then after I validted, it went into "fixing network problem - DNS" anyway for a while. My manual DNSes were correct though, right off ipconfig/all.

Right now I'm having problems with the mirror. It doesn't seem to find my default mirror, and the cursor keys on my 2 keyboards don't seem to work, so I have no clue if it's a network access problem, or a mirror down, since I can't change mirrors.

Edit. Problem solved, learned 2 things:
- cursor keys don't work, but whenever there's a list, typing a letter cycles you through all items starting with that letter... except it doesn't really cycle: once you reach the last item, you need to type another letter, and then the letter you want agin to restart at the top.
- leave the "domain" field of the network config blank. It's NOT your workgroup ^^

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

Re: Simulator/Emulator for Raspberry Pi?

Wed Sep 21, 2011 11:41 am

I'm stuck. "bad archive mirror" on the double-handfull of mirrors I've tried. It does sometimes spend a while at the checking phase though. Sometimes I get an immediate error, sometimes it seems to be doing something (progress bar going slowly up by 25% increments) for 1-2 mins, but then fails when reaching 100%.


Edit: I found the problem but not the solution: Windows keeps finding problems with my manual IP config and switching me back to DHCP. I've tried using the original NIC's IP or another one, using the original DNS servers or the gateway as in your screen shot... Nothing seems good enough for it.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6194
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?

Wed Sep 21, 2011 12:11 pm

kernel.org has been hacked and is down, so that might be a problem.

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

Re: Simulator/Emulator for Raspberry Pi?

Wed Sep 21, 2011 12:40 pm

OK thanks, giving up for now then. Re-did everything, "network autoconf has succeeded", and then looong "downloding release files", but again erroe at the end. My windows connection through the bridge is working OK.

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

Re: Simulator/Emulator for Raspberry Pi?

Wed Sep 21, 2011 1:02 pm

is there any way to check to 'net connectivity for the install shell command prompt ? ping and ifconfig not found.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6194
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?

Wed Sep 21, 2011 1:44 pm

I don't know, I never managed to get a bridge working, I've been using usermode.

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

Re: Simulator/Emulator for Raspberry Pi?

Wed Sep 21, 2011 1:46 pm

I'm running Windows ^^

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6194
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?

Wed Sep 21, 2011 2:12 pm

Ah, I should've noticed that from the screenshot. No idea then.

User avatar
crundy
Posts: 310
Joined: Fri Aug 12, 2011 7:47 am

Re: Simulator/Emulator for Raspberry Pi?

Wed Sep 21, 2011 2:42 pm

I'm following the tutorial but part way through installing I get "No disk drive was detected", even though I specified it on the command line (-hda hda.img). Is that normal and I have to pick one of the options or have I done something silly?

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

Re: Simulator/Emulator for Raspberry Pi?

Wed Sep 21, 2011 3:01 pm

do you actually have an hda.img file in your qemu folder ?
If not you need to creat it with
qemu-img create -f raw hda.img 4G
and then check it's indeed there ^^

User avatar
crundy
Posts: 310
Joined: Fri Aug 12, 2011 7:47 am

Re: Simulator/Emulator for Raspberry Pi?

Wed Sep 21, 2011 3:02 pm

Yup, it is there. I created it using:
qemu-img create -f raw hda.img 4G
Formatting 'hda.img', fmt=raw size=4294967296

Perhaps it doesn't like the size?

Edit: Wait, that's interesting: The file size is zero bytes for the file. I thought it created it quite quickly. Shouldn't it be 4Gb of reserved space?

Edit2: Just tried:
qemu-img create -f raw hda.img 8096M
As suggested in the tutorial and it is indeed 8Gb. Trying the installer again now.

Return to “Other projects”