Wine on Raspberry Pi


123 posts   Page 2 of 5   1, 2, 3, 4, 5
by Dietmar » Mon Jul 30, 2012 3:33 pm
Hi rvalles,
I will try this. I just make a try to compile a part of reactos for Raspi. Only problem ist, that you need a lot of time for to overcome all the errormessages. The program for Qemu userspace disappeared from their homepage
Dietmar

PS: I think, porting of Reactos to the Raspi is a really nice thing!
This would give a boost to this interesting project.
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm
by Dietmar » Mon Jul 30, 2012 4:24 pm
I just see
http://www.youtube.com/watch?v=mMzTFMpAQVM
So even this will work, fast as much as possible^^

qemu-i386 Moorhuhn.exe

But until now I have to study the syntax of this, I think
that I have to compile Qemu via Wine on Raspi with --target-list="i386-linux-user"
and we will see
Dietmar
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm
by Dietmar » Mon Jul 30, 2012 4:34 pm
When I first saw this video
http://www.youtube.com/watch?v=erTkTsCO ... re=related
I thought it was a fake,
but now............................................... :mrgreen:
Dietmar

PS: I just see, that the video is a fake, because you can see in the commandline q3ce typing,
but I make this true.
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm
by Dietmar » Mon Jul 30, 2012 4:41 pm
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm
by Dietmar » Mon Jul 30, 2012 4:52 pm
"The qemu-user emulator can run binaries for other architectures but with the same operating system as the current one. "

What do you want more :mrgreen:
Dietmar
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm
by Dietmar » Mon Jul 30, 2012 5:44 pm
I am just going to compile Thoronirs Qemu 0.15.50 for Wine. It is like crosscompile.
First problem is, that I want to set the switches in ./configure.
This I want to do in the Linux environment.
So, after I correctet the error in tcg/arm/tcg-target.c by hand
I run in commandline on raspi

./configure --target-list="i386-softmmu i386-linux-user" --enable-sdl --prefix=/usr --extra-cflags="-O2 -mfloat-abi=hard -mfpu=vfp -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -march=armv6zk"

After this
winemaker --lower-all -DSTRICT /home/pi/raspidev/qemu
and after long list
make

Waiting for errors..
Dietmar


EDIT: Yes, this will be a hard job to compile Qemu for Windows on ARM, because winemaker produces new makefiles, but not always with the right structure of folders...
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm
by Dietmar » Mon Jul 30, 2012 6:18 pm
Ok, lets make things easier.
I put everything out of the folder qemu,
which has no link to "i386-linux-user"
and prepare makefile by hand.
The problem is, that Qemu isnt a program with source-code for Windows.
This makes some things easier and some things harder for to compile it for Windows on ARM,
Dietmar
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm
by Dietmar » Mon Jul 30, 2012 6:58 pm
Another question is,
if user space modus for Qemu can be build for Windows on ARM on left side and Windows on i386 on right side.
When I crosscompiled Qemu 0.15.50 for Windows (works only with Thoronirs qemu source)
I noticed that there was only i386-linux-user in the build for Linux, but not in the build for Windows.
Som, may be there is no i386-windows-user. I will look, if somewhere a wine
But Qemu has a lot of surprises,
so we will see :-),
Dietmar

PS: Hihi, I think the problem can be overcome: Dont use
ARM LINUX WINE WINDOWS ARM QEMU USERMODE i386 WINDOWS but
ARM LINUX QEMU USERMODE LINUX i386 WINE WINDOWS

Hm, this can be tested very quick: Compile Qemu just for "i386-linux-user" on raspi, and then let the normal wine for i386 start as programm in this qemu.
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm
by Dietmar » Tue Jul 31, 2012 11:26 am
Qemu does not support User mode until now, when host is Raspberry Pi.
I produced a simple hello executable file in Ubuntu 12.04.
On raspi in commandline

qemu-i386 ./hello
Error -13 while loading ./hello

So, until now qemu cant be used this way. I do not know, what is the reason for.
Some others give a similar report for Qemu User mode, when the host is an ARM processor with Linux
and the guest an Linux i386.
Any ideas?
Dietmar

EDIT: When I type in folder /lib
qemu-i386 ld-linux.so.3
comes message about wrong architekture for this.
I never worked with Qemu in User mode before. But now I think, may be the reason is just,
that qemu does not find the right libs, that it need for the hello executable file. Ok, how can I show Qemu, which libs it has to use???
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm
by Dietmar » Tue Jul 31, 2012 1:50 pm
The syntax I get, it is easy
qemu-i386 -L (path to lib) ./program

But I think the lib has to be made of the same sourcecode,
one compiled for Raspi ARM and one compiled for Linux i386.

Is there a possibility to get the same Source-code,
from which the new official Wheezy with hard-float enabled (Raspbian) is compiled from?

I would be happy :-) to get,

Dietmar
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm
by Dietmar » Wed Aug 01, 2012 3:54 pm
YEEEAAAH :D :D :D ,
I got it, Qemu0.15.50 compiled for Raspi, in User Mode on Raspberry Pi.
For this I installed on my i386 Desktop compi Debian Wheezy.
Then I copied the lib-files from THAT Debian i386 from
lib/i386-linux-gnu to the folder lib on Raspberry Pi.
What a work, but now can be done
Raspi...ARM Linux...qemu-i386Linux...Wine i386...Windows :mrgreen:
Nice to hear from you,
Dietmar

PS: Until now I can start an executable hello, compiled on Debian Wheezy i386,
from any place in Raspi with the command qemu-i386 hello

Image
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm
by Dietmar » Wed Aug 01, 2012 4:24 pm
Just in this moment I am compiling wine-1.5.10 on my Debian Wheezy Desktop i386 compi,
this is fun :mrgreen:
Dietmar
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm
by Dietmar » Wed Aug 01, 2012 7:43 pm
Jepp, the harmless error message above is gone with as root
apt-get remove raspi-copies-and-fills
One file is removed,
Dietmar
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm
by Dietmar » Thu Aug 02, 2012 8:55 pm
I do a lot of tests, to understand how Qemu works in User Mode.
The Linux on the left and the Linux on the right side from Qemu seems to need to be mostly
the same Linux versions. And you get Error -13, when you do not have chmod 777 your hello (linuxi386executable). This is a really crazy behavior, because there are such a lot ot possibilities,
to get Qemu NOT to work in User Mode :? . When the executable file is not found at all, you get Error -1. I take a look, which files from the lib folder of Debian i386 are really needed for a working Hello World (dynamic linked). Only two files you need for Hello World:

1.) ld-linux.so.2 from Debian i386 folder lib
2.) libc.so.6 from the Debian i386 folder i386-linux-gnu (is inside of this lib).

Be very careful: When I chmod 777 my folder lib on Raspi, it does not start after this operation again.
I am very happy, that I made a whole copy with WinHex of my SD card before. You are an expert,
when you have done all the errors, mistakes, that are possible and you are still alive :mrgreen: .
I have no idea, how to put those 2 files in the folder lib on Raspi.
So, I like Windows, copy and past them into lib of Raspi, works. For this you need to have installed the Hitachi Micro drive driver, I posted here somewhere. Only then you see more than one partition on your SD card. And you need to have installed the EXT driver, that shows you EXT3, 4 partitions.
When you click on this partitions in EXT, make them writable or in other case you have the same situation as in Linux before,
Dietmar

PS: May be a lot more files from lib of Debian i386 are needed for a working Wine i386.
But now it is much more easy, because you know the steps how to bring those files to lib of Raspi.
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm
by Dietmar » Thu Aug 02, 2012 9:42 pm
I just run the executable test files for i386 Linux from the page of qemu, go down to their side and get. http://wiki.qemu.org/Testing
Work (exact like my Hello World): ls, sha1, testsig
Others needs a little bit more,

Dietmar

PS: Dont forget to chmod 777 each executable file, or you get always Error -13 :mrgreen: .
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm
by Dietmar » Thu Aug 02, 2012 11:05 pm
Ok, next one is ldconfig from qemu i386 tests, which runs:-) in Qemu User mode.
testthread from qemu i386 tests gives
qemu: Unsupported syscall: 240
Segmentation fault

Dietmar
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm
by Dietmar » Sun Aug 05, 2012 3:21 pm
Yeeah,
small but important step:
I make two qemu-i386 from the Thoronir Qemu 0.15.50 on Raspi.
1.) --enable-nptl
2.)--disable-nptl

Then I compared those files after building binary with WinHex editor.
No difference at all. Now I understand:
NO NPTL at all for qemu-i386 on Raspi is implemented at all.
Now it is clear, what you have to change :mrgreen:
Dietmar

PS: I noticed, that in Qemu always NPTL is enabled, even when not set.
Clear, because it is not there...
You have to --disable-nptl in ./configure. Until now no need, because not there at all.
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm
by Dietmar » Sun Aug 05, 2012 7:01 pm
Next small step:
Given in comandline
getconf GNU_LIBPTHREAD_VERSION
NPTL 2.13

This is for Raspbian Wheezy with hf on real Raspi,
so there is a chance to tell Qemu about NPTL in User Mode
with qemu-i386 wine
Dietmar
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm
by Dietmar » Mon Aug 06, 2012 1:06 am
Hi,
I think I know what to do to enable NPTL, meaning that qemu-i386 wine
will work on Raspi.
I give the systemcall 240 ( is for futex) from program (here wine in Linux i386) direkt to the (Linux ARM) host, Raspi via futex. Only the numbers and adresses have been to told to futex. This means simple, that the hack will stop the programm who tells 240, will be stopped for a few msec:-), so it is happy.
It is some kind of hack, but this is the only way for me to make it work :mrgreen: .
For this, very small changes has to be done in main.c and syscall.c in folder linux-user of Qemu.
Also I set NPTL as always true for target i386 in config and I define CONFIG_USE_NPTL for target i386.
I see some attemps in Internet too, but I wonder why nothing of them has been put to Qemu source,
Dietmar
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm
by Dietmar » Mon Aug 06, 2012 11:58 am
Hi,
I just noted, that some patch code for to enable NPTL in qemu-i386 from Thoronir Qemu 0.15.50 are implemented in folder qemu/linux-user/syscall.c
from David Woodhouse and Alexander Graf.
When this makes any sense, somebody tested qemu-i386 for NPTL but then stops to make it work.
But for me it is a great help, because now I have the actual corresponding line numbers and name of the variables :-). Now I am near to 100% sure that it will work,
Dietmar
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm
by Dietmar » Mon Aug 06, 2012 7:56 pm
Yeaah,
I am doing some BIG steps :mrgreen: :mrgreen: :mrgreen: .
May be tomorrow I can give you a patched Qemu 15.50,
that works with Raspbian Raspi as host and Debian i386 as guest via
qemu-i386 program (in i386 linux)

The idea depends only on two lines

static inline void cpu_set_tls(CPUState *env, target_ulong newtls)

do_set_thread_area(env, newtls)

Dietmar
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm
by Dietmar » Mon Aug 06, 2012 10:38 pm
Yeeeeaaaaa I got it :mrgreen: :D :mrgreen: ,
Qemu User Mode on Raspi, what a hack with two lines, means not perfect.., but
I can run NPTL programs with
qemu-i386 program (i386, NPTL).
I have no idea about linux,
but with some time you can learn all^^
Dietmar

Image
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm
by Dietmar » Tue Aug 07, 2012 11:03 am
hihi,
I can run wine on Raspi :mrgreen: via
qemu-i386

Notepad works, even with a lot of error messages.
My problem is, how to install Wine with right directory names :?
Dietmar

Image
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm
by Dietmar » Wed Aug 08, 2012 1:08 pm
Hi,
after a lot of tests here are two patches for qemu-0.14.1 :mrgreen:
In Version 0.15.50 is target_arch2 suddently 64 bit, so it does not work there.

patchconfigure.txt adds NPTL support in configure in folder qemu-0.14.1
patchsyscall.txt makes NPTL work, patch for syscall.c in folder qemu-0.14.1/linux-user

Dietmar

PS: Copy and paste, rename it patchconfigure.txt and install the patch in qemu-0.14.1 folder via
patch -p1 configure < patchconfigure.txt

Code: Select all
@@ -2910,6 +2910,7 @@
 case "$target_arch2" in
   i386)
     target_phys_bits=32
+    target_nptl="yes"
   ;;
   x86_64)
     TARGET_BASE_ARCH=i386


copy and paste and rename it patchsyscall.txt
Then go to folder qemu-0.14.1/linux-user
patch -p1 syscall.c < patchsyscall.txt

Code: Select all
@@ -3761,7 +3761,7 @@
         init_task_state(ts);
         /* we create a new CPU instance. */
         new_env = cpu_copy(env);
-#if defined(TARGET_I386) || defined(TARGET_SPARC) || defined(TARGET_PPC)
+#if defined(TARGET_SPARC) || defined(TARGET_PPC)
         cpu_reset(new_env);
 #endif
         /* Init regs that differ from the parent.  */
@@ -3777,8 +3777,14 @@
             ts->child_tidptr = child_tidptr;
         }
 
-        if (nptl_flags & CLONE_SETTLS)
+        if (nptl_flags & CLONE_SETTLS) {
+#if defined(TARGET_I386) && defined(TARGET_ABI32)
+            do_set_thread_area(new_env, newtls);
+            cpu_x86_load_seg(new_env, R_GS, new_env->segs[R_GS].selector);
+#else
             cpu_set_tls (new_env, newtls);
+#endif
+        }
 
         /* Grab a mutex so that thread setup appears atomic.  */
         pthread_mutex_lock(&clone_lock);
@@ -3852,8 +3858,14 @@
             if (flags & CLONE_PARENT_SETTID)
                 put_user_u32(gettid(), parent_tidptr);
             ts = (TaskState *)env->opaque;
-            if (flags & CLONE_SETTLS)
+            if (flags & CLONE_SETTLS) {
+#if defined(TARGET_I386) && defined(TARGET_ABI32)
+                do_set_thread_area(env, newtls);
+                cpu_x86_load_seg(env, R_GS, env->segs[R_GS].selector);
+#else
                 cpu_set_tls (env, newtls);
+#endif
+            }
             if (flags & CLONE_CHILD_CLEARTID)
                 ts->child_tidptr = child_tidptr;
 #endif
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm
by Dietmar » Wed Aug 08, 2012 2:55 pm
Crazy syntax with diff and patch and Raspi even itself produce zerobyte files,
ok next attempt:-)

In Folder qemu-0.14.1
type
patch configure < configurepatch.txt

Copy and paste this content and name it configurepatch.txt
Dietmar

Code: Select all
--- configure   2011-05-06 21:01:44.000000000 +0200
+++ configureh   2012-08-08 00:57:04.000000000 +0200
@@ -2910,6 +2910,7 @@
 case "$target_arch2" in
   i386)
     target_phys_bits=32
+    target_nptl="yes"
   ;;
   x86_64)
     TARGET_BASE_ARCH=i386
Posts: 349
Joined: Sun Sep 04, 2011 5:43 pm