OESF Portal | OESF Forum | OESF Wiki | LinuxPDA | #planetgemini chat on matrix.org | #gemini-pda chat on Freenode | #zaurus and #alarmz chat on Freenode | ELSI (coming soon) | Ibiblio

IPB

Welcome Guest ( Log In | Register )

2 Pages V   1 2 >  
Reply to this topicStart new topic
> Alarmz On Qemu
TheWalt
post Dec 7 2015, 07:42 AM
Post #1





Group: Members
Posts: 178
Joined: 11-August 05
Member No.: 7,836



Ok so I thought this would be easy but I am (probably) one step in over my head so maybe someone can help.

QEMU has native support for the Zaurus line of product under ARM emulation. After a little google search it seemed running a debian install worked good so why not get ALARMZ going.

So the steps I have done so far is as follows.

I had to create a raw disk image to run from, so did this to make a 6gig image.

CODE
dd if=/dev/null of=alarm.img bs=1M seek=6114


Then I had to format the image.

CODE
mkfs.ext4 -F alarm.img


Then I mounted it and untar the file system just like you would on real hardware.

CODE
mkdir /mnt/alarm
mount -t ext4 -o loop alarm.img /mnt/alarm
bsdtar xvf alarm-zaurus-c3x00-minimal-rootfs-october2015.tar.xz -C /mnt/alarm/


Now I thought that would be it, start up the VM and watch the magic happen. Unfortunately no such luck.

CODE
qemu-system-arm -machine spitz alarm.img

qemu: fatal: Trying to execute code outside RAM or ROM at 0x00800000

R00=00000000 R01=00000000 R02=00000000 R03=00000000
R04=00000000 R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=00000000 R14=00000000 R15=00800000
PSR=400001d3 -Z-- A svc32
FPSCR: 00000000
Aborted


So I'm not sure where to go from here. Looking at other start-up strings it does seem like I might be missing -kernel and -initrd files but have no idea where to get them.

If anyone can point me in a direction I'll try to do the leg work
Go to the top of the page
 
+Quote Post
TheWalt
post Dec 7 2015, 10:07 AM
Post #2





Group: Members
Posts: 178
Joined: 11-August 05
Member No.: 7,836



Ok, got the machine to boot at least using the zImage found in the file system. It now kernel panics though which is for sure over my head.

CODE
qemu-system-arm -M terrier alarm.img -m 64 -kernel zImage-4.2.3-c3x00 -append root=/dev/sda
Go to the top of the page
 
+Quote Post
greguu
post Dec 8 2015, 01:02 AM
Post #3





Group: Moderators
Posts: 372
Joined: 14-November 05
From: New Zealand
Member No.: 8,535



QUOTE(TheWalt @ Dec 7 2015, 07:07 PM) *
Ok, got the machine to boot at least using the zImage found in the file system. It now kernel panics though which is for sure over my head.

CODE
qemu-system-arm -M terrier alarm.img -m 64 -kernel zImage-4.2.3-c3x00 -append root=/dev/sda


Hi TheWalt,

sorry I have been away for some time.

Try to append "root=/dev/sda1" and use "-M borzoi"

Cheers!
Go to the top of the page
 
+Quote Post
TheWalt
post Dec 8 2015, 06:03 AM
Post #4





Group: Members
Posts: 178
Joined: 11-August 05
Member No.: 7,836



I get the same error, and then kernel panic.

CODE
Inconsistency detected by ld.so: dynamic-link.h: 190: elf_get_dynamic_info: Assertion `info[20]->d_un.d_val == 17 || info[20]->d_un.d_val == 7' failed!



UPDATE:

I forgot to edit the alarm.img fstab and boot.cfg. Now that I have modified that I get the following error.

CODE
/sbin/init: error while loading shared libraries: librt.so.1: cannot open shared object file


Will continue to hack away biggrin.gif
Go to the top of the page
 
+Quote Post
TheWalt
post Dec 8 2015, 07:51 AM
Post #5





Group: Members
Posts: 178
Joined: 11-August 05
Member No.: 7,836



Ok, so I made a new image file with a partition this time to match the default config. I am starting the VM with the following which makes it use the image as a SD card, and uses the same string as in boot.cfg minus the error reporting so I can see what is happening.

CODE
qemu-system-arm -M borzoi -sd alarm2.img -m 64 -kernel zImage-4.2.3-c3x00 -append 'root=/dev/mmcblk0p1 rootfstype=ext4 fbcon=rotate:1 noinitrd cpufreq-pxa2xx.pxa27x_maxfreq=624' -portrait


Unfortunately it still stops after mount. Any ideas would be appreciated.

Go to the top of the page
 
+Quote Post
greguu
post Dec 8 2015, 08:43 PM
Post #6





Group: Moderators
Posts: 372
Joined: 14-November 05
From: New Zealand
Member No.: 8,535



QUOTE(TheWalt @ Dec 8 2015, 04:51 PM) *
Ok, so I made a new image file with a partition this time to match the default config. I am starting the VM with the following which makes it use the image as a SD card, and uses the same string as in boot.cfg minus the error reporting so I can see what is happening.

CODE
qemu-system-arm -M borzoi -sd alarm2.img -m 64 -kernel zImage-4.2.3-c3x00 -append 'root=/dev/mmcblk0p1 rootfstype=ext4 fbcon=rotate:1 noinitrd cpufreq-pxa2xx.pxa27x_maxfreq=624' -portrait


Unfortunately it still stops after mount. Any ideas would be appreciated.



Hi, what version of qemu are you using ?

I tested here with QEMU emulator version 2.4.0.1,

My alarm.img has ext4 and is actually recognized as "mmcblk0" but boots fine using same command you posted.

I suggest you try again and re-download all the files to make sure nothing is corrupt.

Cheers!
Go to the top of the page
 
+Quote Post
TheWalt
post Dec 9 2015, 06:34 AM
Post #7





Group: Members
Posts: 178
Joined: 11-August 05
Member No.: 7,836



HA!

I was running from 2.0.0 and when I updated to 2.4.1 it worked!

Now to get networking and should be good to go. Thanks for the heads up on the QEMU version, considering how old the Z is I'd never thougth that would be the issue.
Go to the top of the page
 
+Quote Post
greguu
post Dec 9 2015, 11:02 PM
Post #8





Group: Moderators
Posts: 372
Joined: 14-November 05
From: New Zealand
Member No.: 8,535



QUOTE(TheWalt @ Dec 9 2015, 03:34 PM) *
HA!

I was running from 2.0.0 and when I updated to 2.4.1 it worked!

Now to get networking and should be good to go. Thanks for the heads up on the QEMU version, considering how old the Z is I'd never thougth that would be the issue.


Great, good to know you got it going. For networking, qemu does a pass through mode by default, so setting your Z to dhcp and maybe editing resolv.conf should be enough.

If you want to be able to SSH to the Z you may need to look into "-net user,hostfwd=tcp::2222-:22" then you should be able to SSH to localhost:2222 and get into the Z.
Go to the top of the page
 
+Quote Post
ArchiMark
post Dec 10 2015, 09:41 PM
Post #9





Group: Admin
Posts: 1,646
Joined: 25-June 03
From: Silicon Valley
Member No.: 208



Excellent progress, Walt!
Go to the top of the page
 
+Quote Post
dmarschal
post Dec 13 2015, 12:29 AM
Post #10





Group: Members
Posts: 18
Joined: 22-November 09
Member No.: 54,656



Hello!
I'm trying to get qemu to work. No luck so far. I'm on windows 7 and did all the steps mentioned in this thread.

I've made a 1G image, formatted to ext4, extracted the minimal rootfs and copied the kernel to the root dir if it helps.

I always get the following error:
CODE
zImage-4.2.3-c3x00: No such file or directory
qemu: could not load kernel 'zImage-4.2.3-c3x00'


qemu version is 2.4.93

command line is
CODE
qemu-system-arm -M spitz -sd alarm3.img -m 64 -kernel /zImage-4.2.3-c3x00 -append "root=/dev/mmcblk0p1 rootfstype=ext4 fbcon=rotate:1 noinitrd cpufreq-pxa2xx.pxa27x_maxfreq=624" -portrait


Thank you in advance for any help.
Go to the top of the page
 
+Quote Post
TheWalt
post Dec 14 2015, 06:13 AM
Post #11





Group: Members
Posts: 178
Joined: 11-August 05
Member No.: 7,836



QUOTE(dmarschal @ Dec 13 2015, 03:29 AM) *
I always get the following error:
CODE
zImage-4.2.3-c3x00: No such file or directory
qemu: could not load kernel 'zImage-4.2.3-c3x00'


command line is
CODE
qemu-system-arm -M spitz -sd alarm3.img -m 64 -kernel /zImage-4.2.3-c3x00 -append "root=/dev/mmcblk0p1 rootfstype=ext4 fbcon=rotate:1 noinitrd cpufreq-pxa2xx.pxa27x_maxfreq=624" -portrait


Sounds like it just can't find the file, assuming you extracted it to a folder try using the full path to the zimage IE c:\zaurusfiles\zImage-4.2.3-c3x00 or wherever it exist on your system.
Go to the top of the page
 
+Quote Post
dmarschal
post Dec 14 2015, 07:03 AM
Post #12





Group: Members
Posts: 18
Joined: 22-November 09
Member No.: 54,656



QUOTE(TheWalt @ Dec 14 2015, 03:13 PM) *
QUOTE(dmarschal @ Dec 13 2015, 03:29 AM) *
I always get the following error:
CODE
zImage-4.2.3-c3x00: No such file or directory
qemu: could not load kernel 'zImage-4.2.3-c3x00'


command line is
CODE
qemu-system-arm -M spitz -sd alarm3.img -m 64 -kernel /zImage-4.2.3-c3x00 -append "root=/dev/mmcblk0p1 rootfstype=ext4 fbcon=rotate:1 noinitrd cpufreq-pxa2xx.pxa27x_maxfreq=624" -portrait


Sounds like it just can't find the file, assuming you extracted it to a folder try using the full path to the zimage IE c:\zaurusfiles\zImage-4.2.3-c3x00 or wherever it exist on your system.


It Works! Thank You so much!!!

I did not think the kernel is not loaded from the image file.
Go to the top of the page
 
+Quote Post
greguu
post Dec 14 2015, 09:56 PM
Post #13





Group: Moderators
Posts: 372
Joined: 14-November 05
From: New Zealand
Member No.: 8,535



QUOTE(TheWalt @ Dec 9 2015, 03:34 PM) *
HA!

I was running from 2.0.0 and when I updated to 2.4.1 it worked!

Now to get networking and should be good to go. Thanks for the heads up on the QEMU version, considering how old the Z is I'd never thougth that would be the issue.


Hi TheWalt.

did you have any success with the network?

I realized the qemu-system-arm does not allow the use of the virtual pcnet driver (pcnet is included as kernel module in ALARMZ)

If you found a way to get it working let me know, I guess I there might be a limitation and additional kernel modules may be required.

Cheers!
Go to the top of the page
 
+Quote Post
greguu
post Dec 14 2015, 11:40 PM
Post #14





Group: Moderators
Posts: 372
Joined: 14-November 05
From: New Zealand
Member No.: 8,535



Hi,
just as a note. ArchLinuxArm does not support qemu at all. I searched the alarm forums about qemu and the response is "not supported".
Saying that , there might be still a way to get networking going and I will put some effort in, but it is not my priority.
I only use qemu to test new build kernels boot process, not to test apps or network.
For testing apps etc, I recommend to use a SD card with alarm on it, so you test on SD first before going "production" on the CF card.
This way you can keep your main alarm on the CF "clean". I hope this makes sense, as there is no speed benefit from running qemu
and compiling applications under qemu is not recommended.
Cheers!
Go to the top of the page
 
+Quote Post
TheWalt
post Dec 15 2015, 10:01 AM
Post #15





Group: Members
Posts: 178
Joined: 11-August 05
Member No.: 7,836



QUOTE(daalnroti @ Dec 15 2015, 02:40 AM) *
Hi,
just as a note. ArchLinuxArm does not support qemu at all. I searched the alarm forums about qemu and the response is "not supported".
Saying that , there might be still a way to get networking going and I will put some effort in, but it is not my priority.
I only use qemu to test new build kernels boot process, not to test apps or network.
For testing apps etc, I recommend to use a SD card with alarm on it, so you test on SD first before going "production" on the CF card.
This way you can keep your main alarm on the CF "clean". I hope this makes sense, as there is no speed benefit from running qemu
and compiling applications under qemu is not recommended.
Cheers!


I unfortunately came to the same realization with networking, only loopback and IR (irda0) seems supported / detected. I really only wanted to get this working so anyone who did not own physical hardware could still compile for the Z.

But I got to thinking, really all someone would need is a system that compiled against the armv5 right? I wonder what other low end system would be compatible that could be purchased.
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 16th October 2019 - 10:15 AM