carmin3
Posts: 1
Joined: Thu Jan 10, 2013 1:16 am

Re: Wine on Raspberry Pi

Thu Jan 10, 2013 1:30 am

I know someone had already ask you about it, Dietmar, but there is still no answer.

I'm a noob, and english is not my own language, so i had some problem to follow the steps to gatering Windows Xp or Wine on my raspberry Pi.

Can you write a "step by step" tutorial about it?
I'm not asking a complete, full detailed tutorial, just something more clear then a post :)

I'll be really gratefull if you can do this

Ah, and sorry for my english :P

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

Re: Wine on Raspberry Pi

Sat Jan 12, 2013 6:38 pm

I added NPTL support in syscall.c for qemu-0.9.1 and enabled it in configure for x86 architecture.
After compiling this qemu, I try to start quake2 (i386 binary)
with qemu-i386 quake2. A hello word program works again with qemu-i386 hello on raspi.
After loading the base.pak , and soft-video for 30 min :mrgreen:
it gives me again

Code: Select all

qemu: uncaught target signal 11 (Segmentation fault) - exiting
brrr...
I know, that on new Qemu-1.3.0 user mode qemu-i386 is very fast on Raspi.
But there is also segfault, meaning no nptl works there too. I tested every patch today avaible for nptl,
Dietmar

P.S. Because nptl not works, my next try is with pthreads on Kernel-2.4.21 and glibc-2.3.2 compiled without any nptl but with the old linuxthreads.

User avatar
felix3008
Posts: 38
Joined: Sun Dec 30, 2012 2:04 am

Re: Wine on Raspberry Pi

Sat Jan 12, 2013 10:40 pm

I'm also trying to archive the same goal, Qemu Thoronirs Version is currently compiling on my pi, wine 1.51 is currently compiling on my x86 ubuntu VM.

Will post results and a tutorial if I get it to work.

Felix3008

PS: My ultimate goal is to run the game "You dont know Jack" at full speed. I managed to run it in Win 95 running on the pi, but its far from full speed.

User avatar
felix3008
Posts: 38
Joined: Sun Dec 30, 2012 2:04 am

Re: Wine on Raspberry Pi

Sun Jan 13, 2013 4:17 pm

What i have accomplished so far:
- Compiled Qemu
- Compiled Wine
- Copied the /lib and /usr/lib folders from my debian x86 machine to /home/pi/experiments/i386libs/
- Copied wine to /home/pi/experiments/i386libs/usr/bin

Code: Select all

[email protected]:/home/pi/experiments/i386libs# qemu-i386 lib/ld-linux.so.2 --library-path lib usr/bin/wine
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault
[email protected]:/home/pi/experiments/i386libs#
Anyone a clue?

Felix3008

User avatar
felix3008
Posts: 38
Joined: Sun Dec 30, 2012 2:04 am

Re: Wine on Raspberry Pi

Sun Jan 13, 2013 4:28 pm

Never mind i kinda got it to work.... But got the same error message as shivansps:

Code: Select all

[email protected]:/home/pi/experiments/i386libs# qemu-i386 -L ../i386libs/ usr/bin/wine
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
[email protected]:/home/pi/experiments/i386libs# qemu-i386 -L ../i386libs/ usr/bin/wine /home/pi/experiments/wait.exe 4000
qemu: Unsupported syscall: 240
Segmentation fault
[email protected]:/home/pi/experiments/i386libs#

wait.exe is a x86 console programm to wait x seconds until it exits.

Does anyone know what the syscall 240 is?

Felix3008

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

Re: Wine on Raspberry Pi

Sun Jan 13, 2013 4:42 pm

Unsupported syscall: 240
means, that in all newer Qemu versions nptl is disabled for qemu-i386 usermode,
unimportand if you set nptl or not,
Dietmar

PS: Until now, I do not see ANY qemu version, which support nptl for qemu-i386.
This is naked truth :mrgreen: for now 10 years :? .

User avatar
felix3008
Posts: 38
Joined: Sun Dec 30, 2012 2:04 am

Re: Wine on Raspberry Pi

Sun Jan 13, 2013 5:11 pm

This is disappointing, maybe making a petition or a ticket to the wine dev team could help.
Because qemu-user runs at pretty high speed. It runs the x86 version of ViTetris, a terminal tetris clone, at full speed.
qemu-user.png
qemu-user.png (46.8 KiB) Viewed 9832 times
Felix3008

PS: @Dietmar You said something about enabling it in syscall.c... Any chance?

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

Re: Wine on Raspberry Pi

Sun Jan 13, 2013 5:49 pm

Hi felix,
until now I used only patches, that I found somewhere.
There exist really a lot of patches. There is a whole Linux distribution, Olmec,
which works for a year on qemu User mode. I have no idea, what is going on there,
only that with Kernel >= 2.6 no qemu-i386 works.
It is not an easy task to solve this problem.
In older qemu versions, you have a chance to understand, what is going on.
Paul Brook enabled a patch for nptl in qemu-i386 for Qemu-0.8.2 and qemu-0.9.0,1
He disabled threads in his patch in syscall.c. This is really funny. You have a patch for nptl,
which disabled nptl, means threading, at once :mrgreen: , crazy.
This problem happens not, when a complete processor was simulated, because this is 1 thread :lol: .
I make a try, because I know the power of qemu user mode,
but at a point I have to calculate advantage against heavy work,
Dietmar

User avatar
felix3008
Posts: 38
Joined: Sun Dec 30, 2012 2:04 am

Re: Wine on Raspberry Pi

Sun Jan 13, 2013 6:12 pm

Something i found on the internet:
Requirements to get Wine 1.5.11 and Qemu to work with Ubuntu 12.10 on ARM

1. VMSPLIT-3G and BINFMT_MISC must be compiled into the kernel.. It makes my kernel crash when I access the lan\wifi with traffic..
2. Use Qemu-0.14.1 with the NPTL Patch ./configure --enable-sdl --target-list=i386-linux-user --prefix=/usr --extra-cflags=-marm to compile.. I compile it in Ubuntu for Arm.
3. Compile Wine 1.5.11 on Ubuntu 12.10 32bit X86.
4. Create /usr/gnemul/qemu-i386/lib /usr/gnemul/qemu-i386/usr/local/lib, /usr/gnemul/qemu-i386/usr/local/lib/wine /usr/gnemul/qemu-i386/usr/lib /usr/gnemul/qemu-i386/usr/lib/i386-linux-gnu and copy the corresponding files from X86. Qemu\Wine will ask for them. Bring over your ~/.wine directory and put it in your home folder.
5. sudo apt-get build-dep wine (do this on arm)
6 Binfmt time. Here is my script to get wine to run
echo ':i386:M::\x7fELF\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff\xff:/usr/bin/qemu-i386:' >/proc/sys/fs/binfmt_misc/register
echo ':DOSWin:M::MZ::/usr/local/bin/wine:' >/proc/sys/fs/binfmt_misc/register

7. If you do ALL that... Then winecfg will run. About to start testing programs.

Pinball runs VERY FAST! VERY PLAYABLE NOW!!!!!!!!!!! :D

Justin Shafer
OnsiteDentalSystems.com
Trying right now....


Felix3008

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

Re: Wine on Raspberry Pi

Sun Jan 13, 2013 6:24 pm

By the way,
qemu-1.3.0 user mode is more as double :D as fast as that from qemu-0.14 with the nptl patch
Dietmar

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

Re: Wine on Raspberry Pi

Mon Jan 14, 2013 8:57 am

Me too.. Wondering how the latest qemu-i386 runs... or if it can run wine.

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

Re: Wine on Raspberry Pi

Mon Jan 14, 2013 9:51 am

I get a segmentation fault with 1.3.50 trying to run wine+qemu... :cry:

ota-kun
Posts: 36
Joined: Tue Jul 17, 2012 8:38 am

Re: Wine on Raspberry Pi

Tue Jan 15, 2013 11:58 am

Dietmar can you post a step by step description to get the current version running with user mode?

I want to speed up my Teamspeak 3 running in a x86 debian image using your new experience.

My progress so far is documented here:
http://raspberrypi.stackexchange.com/qu ... k-3-server

User avatar
felix3008
Posts: 38
Joined: Sun Dec 30, 2012 2:04 am

Re: Wine on Raspberry Pi

Tue Jan 15, 2013 2:25 pm

Sadly it didn't run as qemu refused to compile with the patches Dietmar provided (or i may have inserted them incorrectly)

I'm going to try to install the teamspeak server myself and if that works, I'm going to write a little tutorial how to get it working (qemu, not wine).
In performance terms, there should be no issues because a pi can handle a 10 slot minecraft server which is very heavy computing (even for my 6core 16gig machine).

Felix3008

ota-kun
Posts: 36
Joined: Tue Jul 17, 2012 8:38 am

Re: Wine on Raspberry Pi

Tue Jan 15, 2013 2:37 pm

My way already works (see the link I posted above), but It's not in user mode and Performance wise not the best.

User avatar
felix3008
Posts: 38
Joined: Sun Dec 30, 2012 2:04 am

Re: Wine on Raspberry Pi

Tue Jan 15, 2013 2:37 pm

Sorry, as teamspeak 3 apparently uses NPTL it refuses to run on the qemu i have installed.

Code: Select all

[email protected] ~/TeamspeakServer/teamspeak3-server_linux-x86 $ qemu-i386 -L /home/pi/raspidev/i386libs/ ts3server_linux_x86
qemu: Unsupported syscall: 240
qemu: Unsupported syscall: 240
qemu: Unsupported syscall: 240
qemu: Unsupported syscall: 240
qemu: Unsupported syscall: 240
2013-01-15 14:32:01.163252|INFO    |ServerLibPriv |   | TeamSpeak 3 Server 3.0.6.1 (2012-06-29 07:59:05)
qemu: Unsupported syscall: 240
Segmentation fault
[email protected] ~/TeamspeakServer/teamspeak3-server_linux-x86 $
Maybe on Dietmars version (that i cant get to run) , which is (i think) slow but works, teamspeak could be done.
@Dietmar could you give me instruction in how to insert your latest syscall.c patch?


Felix3008

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

Re: Wine on Raspberry Pi

Tue Jan 15, 2013 5:52 pm

I will show you the steps,
that work for me best until now with NPTL and qemu-i386 on Raspi. It is fast and some :? programs run.
My problem now is, that I do not understand all what happens in Qemu User mode.
In my next holidays I make a try of understanding :mrgreen: .
Then we get a qemu-i386 that works.
Until now we take the NPTL patch from Matthieu Castet, that we need to update for newest qemu.
http://lists.gnu.org/archive/html/qemu- ... 00870.html
Listen to Peter Maydell I chose carefull the libs for Raspi (Wheezy Armel) and qemu-i386 (SAME Wheezy version for I386).
Because no (?) source code is avaible until now for raspi,
I chose the soft-float Wheezy for Raspi 2012-08-08-wheezy-armel.img.
This I install on SD card and expand with raspi config to your whole SD card.
Run apt-get upgrade && apt-get update.
I do it just now on the 512 MB raspi, but this is not important.
Some programs do not work, because you have to give them some more memory with raspi config.
I chose 128/128 MB.
No turbo mode.

After this, get the latest qemu-linaro.
As sudo type

apt-get install git zlib1g-dev libsdl1.2-dev
mkdir raspidev
cd raspidev
git clone git://git.linaro.org/qemu/qemu-linaro.git
I just do this step by step now,
so be patient with next part :D
Dietmar

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

Re: Wine on Raspberry Pi

Tue Jan 15, 2013 6:59 pm

Because newest Qemu comes with pixman
you need
apt-get install libpixman-1-dev

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

Re: Wine on Raspberry Pi

Tue Jan 15, 2013 7:38 pm

When I have newest qemu in qemu-linaro folder
I go out there with halt.
Depending on how you can change or put new files to Raspi I do
the following: I rename in folder qemu-linaro
configure to configureold.
In folder qemu-linaro\linux-user
I rename syscall.c to syscallold.c
Then I copy each on their place my patched configure and syscall.c files.
After this I run chmod 777 configure (from folder qemu-linaro).

EDIT: Crazy, I cant upload here my files configure and syscall.c
So, edit configure by hand yourself, look for this piece of code and enable nptl

Code: Select all

target_long_alignment=4
target_llong_alignment=8
target_libs_softmmu=

TARGET_ARCH="$target_arch2"
TARGET_BASE_ARCH=""
TARGET_ABI_DIR=""

case "$target_arch2" in
  i386)
    target_nptl="yes"
  ;;
  x86_64)
    TARGET_BASE_ARCH=i386
    target_long_alignment=8
  ;;
  alpha)
    target_long_alignment=8
    target_nptl="yes"

And 2 parts in syscall.c

Code: Select all

#endif
        ts = g_malloc0(sizeof(TaskState));
        init_task_state(ts);
        /* we create a new CPU instance. */
        new_env = cpu_copy(env);
#if defined(TARGET_I386)
        new_env->idt.base = target_mmap(0, sizeof(uint64_t) * (env->idt.limit + 1),
                PROT_READ|PROT_WRITE,
                MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
        memcpy(g2h(new_env->idt.base), g2h(env->idt.base), sizeof(uint64_t) * (env->idt.limit + 1));
        new_env->gdt.base = target_mmap(0, sizeof(uint64_t) * TARGET_GDT_ENTRIES,
                PROT_READ|PROT_WRITE,
                MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
        memcpy(g2h(new_env->gdt.base), g2h(env->gdt.base), sizeof(uint64_t) * TARGET_GDT_ENTRIES);
#elif defined(TARGET_SPARC) || defined(TARGET_PPC)
        cpu_reset(ENV_GET_CPU(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;
        ts->info = parent_ts->info;
#if defined(CONFIG_USE_NPTL)
        nptl_flags = flags;

Code: Select all

    target_ldt_info->limit = tswap32(limit);
    target_ldt_info->flags = tswap32(flags);
    unlock_user_struct(target_ldt_info, ptr, 1);
    return 0;
}
static inline void cpu_set_tls(CPUX86State *env, target_ulong newtls)
{
    do_set_thread_area(env, newtls);
    cpu_x86_load_seg(env, R_GS, env->segs[R_GS].selector);
}
#endif /* TARGET_I386 && TARGET_ABI32 */

#ifndef TARGET_ABI32
static abi_long do_arch_prctl(CPUX86State *env, int code, abi_ulong addr)
{
    abi_long ret = 0;
    abi_ulong val;
    int idx;

    switch(code) {

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

Re: Wine on Raspberry Pi

Tue Jan 15, 2013 8:08 pm

In folder qemu-linaro type
./configure --help
to see, if you have a working configure.
I noticed sometimes a crazy behavior with bash...blabla cant find...work.
It is, because configure is build with a script and you have to be very carefull with spaces or tab.
If this happens, copy and past the changes to you original configure file.
I configure type

Code: Select all

./configure --target-list=i386-linux-user --enable-sdl --prefix=/usr
make
and after some :mrgreen: time
make install.
For qemu user mode you do not need sdl. So, some programs can be started from command line,
without any startx and are much faster because no heavy weight of LXDE or something like.
Good luck,
Dietmar


PS: Your I386 libs put in a folder /usr/gnemul/qemu-i386/lib

There, qemu looks automatically for them. Best is, to use only i386 Wheezy libs.

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

Re: Wine on Raspberry Pi

Tue Jan 15, 2013 10:20 pm

The compiled Qemu works,
but the Wheezy soft version seems to me much more unstable than Raspian :?
Dietmar

ota-kun
Posts: 36
Joined: Tue Jul 17, 2012 8:38 am

Re: Wine on Raspberry Pi

Tue Jan 15, 2013 10:41 pm

I compiled qemu using your description, except that I stayed on Raspbian.

I also copied my debian x86 wheezy /usr/lib to Pis /usr/gnemul/qemu-i386/usr/lib

As far I understand /usr/gnemul/qemu-i386/ represents the root directory of the qemu-system.

The first error trying to start Teamspeak server in usermode using qemu-i386 was quiet easy, the local libraries in the TS directory couldn't be found. I copied them to /usr/gnemul/qemu-i386/usr/lib and they were found.

Now comes the error Dietmar already recognized:
When the server starts a thread for the filemanager it fails. The last log output is
2013-01-15 22:32:03.125488|INFO |FileManager | | listening on 0.0.0.0:30033

And when I activate strace I see the clone command, which seems to be the core of the problem.
So I saw already these two bug entries:
https://bugs.launchpad.net/qemu/+bug/1035572
https://bugs.launchpad.net/qemu/+bug/739785

I still have hope, but I don't think it will be easy.

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

Re: Wine on Raspberry Pi

Wed Jan 16, 2013 7:59 am

Any chance of a Github repo ?
Or at least uploading the complete pathed file(s) in a zip file ?
The forum accpets zip attachments !

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

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

Re: Wine on Raspberry Pi

Wed Jan 16, 2013 9:21 am

Dietmar wrote: but the Wheezy soft version seems to me much more unstable than Raspian :?
Dietmar
No surprise there. It seems that most of the software improvements are coming to Raspain.

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

Re: Wine on Raspberry Pi

Wed Jan 16, 2013 3:21 pm

Here are the NPLT patched configure and syscall.c files for Qemu-1.3.0
Good luck,
Dietmar
Attachments
syscall.zip
(48.06 KiB) Downloaded 349 times
configure.zip
(27.12 KiB) Downloaded 337 times

Return to “Other projects”