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

Re: Wine on Raspberry Pi

Wed Aug 08, 2012 3:07 pm

And for the syscall.c file go into folder
qemu-0.14.1/linux-user
and type there

patch syscall.c < syscallpatch.txt

Copy and paste the following and name it syscallpatch.txt.
Hope that it now works:-)
Dietmar

Code: Select all

--- syscall.c	2011-05-06 21:01:44.000000000 +0200
+++ syscallh.c	2012-08-08 12:39:12.000000000 +0200
@@ -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

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

Re: Wine on Raspberry Pi

Wed Aug 08, 2012 4:06 pm

I just noticed,
that you also should set in syscall.c

#define NEW_STACK_SIZE 262144

because the 8192 there before are to small,
Dietmar

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

Re: Wine on Raspberry Pi

Wed Aug 08, 2012 5:55 pm

Yeeaahh :mrgreen: ,
getting better day by day,
NO illegal syscall at all now :lol:

Dietmar

Image

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

Re: Wine on Raspberry Pi

Wed Aug 08, 2012 7:47 pm

Hi,
pthread test is completed FULL,
copythread gives all copies,
but then hangs, so 90% ready :lol:
Dietmar

Image

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

Re: Wine on Raspberry Pi

Thu Aug 09, 2012 1:45 pm

Hi,
here comes the last, best :-) patch for syscall.c in folder qemu-0.14.1/linux-user.
I changed the NEW_STACK_SIZE at two places now to 0x40000. This helps a lot :D .
I make a working qemu-i386 with NPTL i386 support from this with

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

in Qemu,
Dietmar

PS: How to use this patch: 1.) The configure in Qemu is made by the same patch as before.
2.) This patch for syscall.c is too big for crazy diff in linux. So it delets ALL in old file and put ALL from new file in it.
So this pseudo difference becomes double size, about 500000Byte. Even the new syscall.c I cant post here, because limit is 60000 Byte. So I copy the NEW content of syscall.c here in the box. You see at once,
how to put this in your old syscall.c but for me it is just crazy.

Code: Select all

    return 0;
}
#endif

#endif /* defined(TARGET_I386) */

#define NEW_STACK_SIZE 0x40000
#if defined(CONFIG_USE_NPTL)


static pthread_mutex_t clone_lock = PTHREAD_MUTEX_INITIALIZER;
typedef struct {
    CPUState *env;
    pthread_mutex_t mutex;
    pthread_cond_t cond;
    /* never exits */
    return NULL;
}
#else
/* this stack is the equivalent of the kernel stack associated with a
   thread/process */

static int clone_func(void *arg)
{
    CPUState *env = arg;
    cpu_loop(env);
    /* never exits */
        pthread_attr_t attr;
#endif
        ts = qemu_mallocz(sizeof(TaskState));
        init_task_state(ts);
        /* we create a new CPU instance. */
        new_env = cpu_copy(env);
#if defined(TARGET_SPARC) || defined(TARGET_PPC)
        cpu_reset(new_env);
#endif
        /* Init regs that differ from the parent.  */
        cpu_clone_regs(new_env, newsp);
        new_env->opaque = ts;
        ts->bprm = parent_ts->bprm;
        flags &= ~CLONE_NPTL_FLAGS2;

        if (nptl_flags & CLONE_CHILD_CLEARTID) {
            ts->child_tidptr = child_tidptr;
        }

        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);

        memset(&info, 0, sizeof(info));
        pthread_mutex_init(&info.mutex, NULL);
               the child process gets its own copy of the lock.  */
            if (flags & CLONE_CHILD_SETTID)
                put_user_u32(gettid(), child_tidptr);
            if (flags & CLONE_PARENT_SETTID)
                put_user_u32(gettid(), parent_tidptr);
            ts = (TaskState *)env->opaque;
            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
        } else {
            fork_end(0);
        }

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

Re: Wine on Raspberry Pi

Fri Aug 10, 2012 1:29 am

Yeeah :mrgreen: :D :mrgreen: ,
I just succeeded with the brandnew Qemu Linaro Version 1.1.50
qemu-i386 User Mode works there now after small patch from me :lol: ,
it is 2...10 times faster than Qemu-0.14.1,
now really fun starts,
Dietmar

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

Re: Wine on Raspberry Pi

Fri Aug 10, 2012 8:00 pm

The BIG problem is
cpu_unlink_tb
in exec.c
I can start Quake2 onetime with
qemu-i386 quake2
on Raspi, after I deleted the function cpu_unlink_tb and all her entries before compiling
for i386-linux-user,
Dietmar

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

Re: Wine on Raspberry Pi

Mon Aug 20, 2012 9:54 pm

Hi,
after a lot of work, how qemu-i386 User Mode works in Qemu,
a little understanding in the *env, where the CPUX86state structure is stored,
using original documents from Fabrice Bellard from June 2003^^ how the function clone() works,
I succeed for the very first time to start the famous Moorhuhn via
qemu wine moorhuhn.exe
It is fast, and this qemu is the old form of today qemu-i386
Dietmar

PS: I compiled qemu-0.4.1 and Wine 0.9.14 for this. It is a long way, but Age of Empires,
Settlers 2 and all those games can run on Raspi with normal speed in Qemu User Mode.
Until now it works on any machine, but only with a Kernel number <= 2.4.

Image

Zane
Posts: 2
Joined: Mon Aug 20, 2012 10:22 pm

Re: Wine on Raspberry Pi

Mon Aug 20, 2012 10:24 pm

Hello Dietmar,

I see you have made a lot of progress getting Wine to work. You fixed the qemu i386 user mode right? If you can get Win 95 to run on the RPi, do you think it's possible to get Debian i386 to run via QEMU?

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

Re: Wine on Raspberry Pi

Mon Aug 20, 2012 10:42 pm

Hi Zane,
today I got an email, how to get Win XP to work with qemu on Raspi.
I have a small XP version, that starts now with Thoronir qemu 0.15.50 on real Raspi in about 1 min.
It is stable, but slow. So, tomorrow I make a test, if this procedure works also with a debian.img on Qemu.
I am not so good in Linux, so I do not know how to make Debian with less MB.
My last win 95 has a size of 2.8 MB^^ and boots to Desktop on Raspi, XP is about 13 MB,
Dietmar

Zane
Posts: 2
Joined: Mon Aug 20, 2012 10:22 pm

Re: Wine on Raspberry Pi

Mon Aug 20, 2012 11:05 pm

I see. I ask this because as of now i have a Printer with drivers only for the i386 architecture. The sources are available however some of the binaries in the sources are i386 only and no sources for those binaries are provided meaning there is no way to recompile the driver for ARM. That's why if QEMU is able to run i386, i'm thinking of running Debian i386 and setting up CUPS + printer driver.

How did you get Windows XP to be only 13mb?!

Actually, i could just run Windows XP on the RPi instead since it's also i386 and i think the drivers will work better. How is it?

kalon33
Posts: 1
Joined: Thu Sep 06, 2012 6:11 am

Re: Wine on Raspberry Pi

Thu Sep 06, 2012 6:15 am

Hi Dietmar,

Thanks for your work.

Can you supply a summary with all the process and modifications to do in order to get wine and qemu running on Raspberry pi?

It would be great to be able to reproduce it.

Thanks a lot.

teeth_03
Posts: 284
Joined: Sat Sep 08, 2012 12:02 am

Re: Wine on Raspberry Pi

Sun Sep 09, 2012 12:07 pm

If you have a slimmed version of Windows 95 running on the pi, will older games run off of it that way?

ghans
Posts: 7878
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Wine on Raspberry Pi

Wed Sep 26, 2012 10:16 am

@teeth_O3
Yes.

@Dietmar
Please come back !
This is insane ! :D
Awesome work.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

teeth_03
Posts: 284
Joined: Sat Sep 08, 2012 12:02 am

Re: Wine on Raspberry Pi

Wed Sep 26, 2012 10:21 am

Yeah, im interested in this, depending on how it runs i suppose...

orokusaki
Posts: 6
Joined: Tue Oct 16, 2012 3:48 am

Re: Wine on Raspberry Pi

Tue Oct 16, 2012 3:51 am

Image
HP Touchpad with Ubuntu 11.04 native
Wine 0.9.40 - Wine 1.0.1
Qemu 0.14 without patches.

orokusaki
Posts: 6
Joined: Tue Oct 16, 2012 3:48 am

Re: Wine on Raspberry Pi

Tue Oct 16, 2012 10:30 am

VERY cool.!

I am going to try this.. Can you compile to zip with patches and upload it somewhere???

User avatar
wallarug
Posts: 460
Joined: Mon May 14, 2012 8:21 am
Location: Sydney, Australia

Re: Wine on Raspberry Pi

Tue Oct 23, 2012 9:49 am

I like what you have been doing. Keep up the good work!

gambl0r
Posts: 1
Joined: Tue Oct 30, 2012 9:27 am

Re: Wine on Raspberry Pi

Tue Oct 30, 2012 9:47 am

Dietmar: thank you so much for your work on this.

I've followed your other thread (win95 on pi) and managed to compile qemu 0.15.50 from Thoronir with all your additional instructions, but I can't get Windows XP/2000 to install.

I did manage to get a version of Windows 2000 'Advanced Server' to install, but only gets 4 bars through the startup screen with -cpu 486. Without -cpu 486, it doesn't get past the black screen with the white bar.

Any luck with a different version of qemu?

Thanks :)

shivansps
Posts: 35
Joined: Thu Jan 26, 2012 5:11 pm

Re: Wine on Raspberry Pi

Fri Nov 09, 2012 12:21 am

Ok ive attempted this so far.

1) Compiled Wine on Ubuntu x86
2) Compiled Qemu on R-PI with NTPL option on.
3) Copied ld-linux.so.2 and i386-linux-gnu folder from the Ubuntu x86 /lib folder to /lib on R-PI, there seems to be no conflicts with ARM stuff.
4) I try to run "qemu-i386 /home/user/wine/loader/wine"
I get this:

Code: Select all

qemu: Unsupported syscall: 240
Usage: wine PROGRAM [ARGUMENTS...]   Run the specified program
       wine --help                   Display this help and exit
       wine --version                Output version information and exit
And thats it, if i try to run a .exe i get just the unsupported syscall and it exit.
Im missing something? i need to use a special qemu for wine?

avra
Posts: 8
Joined: Mon Jan 09, 2012 11:48 am
Contact: Website

Re: Wine on Raspberry Pi

Wed Nov 14, 2012 1:04 pm

Maybe similar idea can be used to finally run Skype on Raspberry Pi? Something like QEMU user mode emulation to run Linux x86 Skype in LXDE or use linux-x86-skypekit-voicertp-videortp directly from XBMC? Or repackaging Maemo as mentioned here: http://unix.stackexchange.com/questions ... ntu-on-arm?

orokusaki
Posts: 6
Joined: Tue Oct 16, 2012 3:48 am

Re: Wine on Raspberry Pi

Thu Nov 22, 2012 1:40 pm

I got Wine 1.5.11 to run! Reloaded and now it won't run anymore.. I will figure it out.. I still saved my gnemul folder and it still won't run.. Driving me insane!

I believe it has something to do with qemu more then wine right now...

I think it has something to do with sudo apt-get install libsdl* (not libsdl1.2-dev all by itself)

THEN try to compile qemu.. then patch ioctls.h

Trying this now. Crossing fingers. Wasted all day yesterday trying to narrow it down. Sleep helps.

RedRedKrovy
Posts: 9
Joined: Fri Dec 07, 2012 5:01 pm

Re: Wine on Raspberry Pi

Tue Jan 08, 2013 2:54 am

Did anybody ever get this working?

This thread went on forever and then just fizzled out.

User avatar
wallarug
Posts: 460
Joined: Mon May 14, 2012 8:21 am
Location: Sydney, Australia

Re: Wine on Raspberry Pi

Tue Jan 08, 2013 3:32 am

I'm still following it...like I have been for the past 3 months.

I don't think (personally) that this will ever work on the raspberry pi but I am still interested in the work that has been going on in this area.

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

Re: Wine on Raspberry Pi

Tue Jan 08, 2013 11:16 pm

Hi all,
in next days I make a try with older and newest qemu-i386 user mode and Wine,
with a simple trick: In the thinking it is only the fault of NPTL threadings build in in newer Kernels > 2.4,
I simple disable all of them via

Code: Select all

LD_ASSUME_KERNEL=2.4.21 
in commandline and then export LD_ASSUME_KERNEL. For this you need the libs for that Kernel
or you get message libm.so.6 is not found, even it is there, but for the wrong Kernel version.
Some times the simplest ideas are the best :mrgreen:
Dietmar

Return to “Other projects”