Wine-linux-ppc32 working status and future enchantments

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
xexaxo
Newbie
Newbie
Posts: 4
Joined: Fri Jun 12, 2009 7:22 am

Wine-linux-ppc32 working status and future enchantments

Post by xexaxo »

Hello there Wine community
Thank you for developing and maintaining this wonderful project
I have been using YellowDog Linux on my PPC32 box for a while now, I was thinking if the good old wine project could be ported/expanded to this platform as well.

After a minor change in the source code ( letoh16 > lendian16toh) it compiled successfully ( without the tests ).
It even managed to get some of the "build-in" programs running, while others where

Code: Select all

while (!OUT_OF_MEM)
do 
       exec winedbg
done
Due to the side of the project, and the number of modules, it's taking ages to analyze it.
So I have the following questions about he structure of wine, and the implementation it on the different platforms/architectures.

1. During compile winelib and all ( or selected ) modules of wine ( ie dll ) are made in native target linux ( in mine case ppc32 ) binaries/libraries.

2. During the first run of wine a ~/.wine/ folder is created with all the *.reg and *inf files. Now correct me if I'm wrong wine calls winebuild to compile/convert the existing *.dll.so files by making them a Win PE32. Making a Win PE header file with all the necessary EXPORT and IMPORT functions but the EXPORT functions are actually implemented in a native way ( common on the platform and CPU architecture )

3. After the creation of .wine directory the program can be loaded and executed. All the IMPORT functions are handled properly but is there any "conversion" between the different architectures. Meaning does the parameters passed to the library are handled in a ASM or in any higher programing language.
How does wine actually interpret all the info in the file, variables, constants, internal functions (all of which in assembler format). Does it actually send them direct to the CPU.

If someone could be kind to share some light over these questions, it would be really nice.
Thank you for all your help

On my system the major problem occurs at step 2 with the compile/convert of the existing *.dll.so to a Win PE32 format.
Here is a short output

Code: Select all

wineboot -i
wine: created the configuration directory '/home/emo/.wine'
err:ole:CreateBindCtx reserved should be 0, not 0xe710c84
fixme:ole:TLB_ReadTypeLib Header type magic 0x4d534654 not supported.
err:ole:TLB_ReadTypeLib Loading of typelib L"mshtml.tlb" failed with error 2
err:mshtml:register_server typelib registration failed: 80029c4a
fixme:ole:TLB_ReadTypeLib Header type magic 0x4d534654 not supported.
err:ole:TLB_ReadTypeLib Loading of typelib L"C:\\windows\\system32\\msi.dll" failed with error 2
fixme:seh:call_stack_handlers not implemented on PowerPC
wine: Unhandled page fault on read access to 0x0ee69ff4 at address 0xebecb90 (thread 0014), starting debugger...
not done
not done
not done
memory.c:37: be_cpu_linearize: Assertion `addr->Mode == AddrModeFlat' failed.
fixme:seh:call_stack_handlers not implemented on PowerPC
wine: Assertion failed at address 0xf3f5a70 (thread 0016), starting debugger...
not done
not done
not done
memory.c:37: be_cpu_linearize: Assertion `addr->Mode == AddrModeFlat' failed.
fixme:seh:call_stack_handlers not implemented on PowerPC
wine: Assertion failed at address 0xf3f5a70 (thread 0018), starting debugger...
not done
not done
not done
memory.c:37: be_cpu_linearize: Assertion `addr->Mode == AddrModeFlat' failed.
fixme:seh:call_stack_handlers not implemented on PowerPC
wine: Assertion failed at address 0xf3f5a70 (thread 001a), starting debugger...
not done
not done
not done
memory.c:37: be_cpu_linearize: Assertion `addr->Mode == AddrModeFlat' failed.
fixme:seh:call_stack_handlers not implemented on PowerPC
wine: Assertion failed at address 0xf3f5a70 (thread 001c), starting debugger...
This is a output of the winecfg tool after clicking on Graphics/Desktop integration/Drives or Audio tab. Same thing occures on program close

Code: Select all

fixme:seh:call_stack_handlers not implemented on PowerPC
wine: Unhandled page fault on read access to 0x80610004 at address 0xe7ca6f4 (thread 0009), starting debugger...
not done
not done
not done
not done
memory.c:37: be_cpu_linearize: Assertion `addr->Mode == AddrModeFlat' failed.
fixme:seh:call_stack_handlers not implemented on PowerPC
wine: Assertion failed at address 0xf3f5a70 (thread 0012), starting debugger...
not done
not done
not done
not done
memory.c:37: be_cpu_linearize: Assertion `addr->Mode == AddrModeFlat' failed.
fixme:seh:call_stack_handlers not implemented on PowerPC
wine: Assertion failed at address 0xf3f5a70 (thread 0014), starting debugger...
not done
not done
not done
not done
memory.c:37: be_cpu_linearize: Assertion `addr->Mode == AddrModeFlat' failed.
fixme:seh:call_stack_handlers not implemented on PowerPC
wine: Assertion failed at address 0xf3f5a70 (thread 0016), starting debugger...
not done
not done
not done
not done
memory.c:37: be_cpu_linearize: Assertion `addr->Mode == AddrModeFlat' failed.
fixme:seh:call_stack_handlers not implemented on PowerPC
wine: Assertion failed at address 0xf3f5a70 (thread 0018), starting debugger...
not done
not done
not done
not done
memory.c:37: be_cpu_linearize: Assertion `addr->Mode == AddrModeFlat' failed.
fixme:seh:call_stack_handlers not implemented on PowerPC
wine: Assertion failed at address 0xf3f5a70 (thread 001a), starting debugger...
not done
not done
not done
not done
memory.c:37: be_cpu_linearize: Assertion `addr->Mode == AddrModeFlat' failed.
fixme:seh:call_stack_handlers not implemented on PowerPC
wine: Assertion failed at address 0xf3f5a70 (thread 001c), starting debugger...
not done
not done
not done
not done
memory.c:37: be_cpu_linearize: Assertion `addr->Mode == AddrModeFlat' failed.
fixme:seh:call_stack_handlers not implemented on PowerPC
wine: Assertion failed at address 0xf3f5a70 (thread 001e), starting debugger...
not done
not done
not done
not done
memory.c:37: be_cpu_linearize: Assertion `addr->Mode == AddrModeFlat' failed.
fixme:seh:call_stack_handlers not implemented on PowerPC
wine: Assertion failed at address 0xf3f5a70 (thread 0020), starting debugger...
austin987
Wine Developer
Wine Developer
Posts: 2383
Joined: Fri Feb 22, 2008 8:19 pm

Wine-linux-ppc32 working status and future enchantments

Post by austin987 »

On Fri, Jun 12, 2009 at 8:39 AM, xexaxo<[email protected]> wrote:
So I have the following questions about he structure of wine, and the implementation it on the different platforms/architectures.

1. During compile winelib and all ( or selected ) modules of wine ( ie dll ) are made in native target linux ( in mine case ppc32 ) binaries/libraries.
Yes.
2. During the first run of wine a ~/.wine/ folder is created with all the *.reg and *inf files. Now correct me if I'm wrong wine calls winebuild to compile/convert the existing *.dll.so files by making them a Win PE32. Making a Win PE header file with all the necessary EXPORT and IMPORT functions but the EXPORT functions are actually implemented in a native way ( common on the platform and CPU architecture )
No...they're ELF binaries, not PE.
3. After the creation of .wine directory the program can be loaded and executed. All the IMPORT functions are handled properly but is there any "conversion" between the different architectures. Meaning does the parameters passed to the library are handled in a ASM or in any higher programing language.
No, there is no conversion. Which is why wine on the PPC isn't very
useful, since it can't run Win32 applications, unless you wrap it with
a CPU emulator, like the old Darwine project used to do.

--
-Austin
Thunderbird
Level 5
Level 5
Posts: 336
Joined: Mon Nov 24, 2008 8:10 am

Post by Thunderbird »

The darwine project didn't really attempt this. The only thing you need to run 32-bit windows apps on powerpc linux is to install qemu. Originally qemu was developed just for this and only consisted of a linux binary loader these days it is also a VM but you can still use the good old binary loader. The darwine guys assisted porting the qemu binary loader to darwin, so that a potential darwin x86 port of wine could be run on the powerpc build of darwin / osx.
xexaxo
Newbie
Newbie
Posts: 4
Joined: Fri Jun 12, 2009 7:22 am

Post by xexaxo »

I have looked at the Darwine project but there are a few obstacles
1. Obsolete. Hasn't been touched in years
2. Make for Mac, I am looking for a linux alternative
qemu is a nice program as well but I'm having problems finding the proper Linux distribution for the PPC32 ( host ) and x86 ( the elf interpreter prefix ) in user emulation mode. Meaning I have tried using a host system Ubuntu 8.10 PPC32 and a image ( a fully working ) Ubuntu 8.10 x86 with wine installed .. with no success.
I have tried different wine build as well ( suse, fedora, RHEL, ubuntu, gentoo ) ALL failing miserably.

If possible can someone guide me, if my suggestions where right or wrong. Or a quick note to where in the code I may find the answers.
Thunderbird wrote:The darwine project didn't really attempt this. The only thing you need to run 32-bit windows apps on powerpc linux is to install qemu. Originally qemu was developed just for this and only consisted of a linux binary loader these days it is also a VM but you can still use the good old binary loader. The darwine guys assisted porting the qemu binary loader to darwin, so that a potential darwin x86 port of wine could be run on the powerpc build of darwin / osx.
xexaxo
Newbie
Newbie
Posts: 4
Joined: Fri Jun 12, 2009 7:22 am

Re: Wine-linux-ppc32 working status and future enchantments

Post by xexaxo »

I am sorry Austin but did no see your post at the first time. Do you have any idea why is the edit button missing it this forum ?
austin987 wrote:
2. During the first run of wine a ~/.wine/ folder is created with all the *.reg and *inf files. Now correct me if I'm wrong wine calls winebuild to compile/convert the existing *.dll.so files by making them a Win PE32. Making a Win PE header file with all the necessary EXPORT and IMPORT functions but the EXPORT functions are actually implemented in a native way ( common on the platform and CPU architecture )
No...they're ELF binaries, not PE.

Code: Select all

file /media/disk/home/emo/.wine/drive_c/windows/notepad.exe 
/media/disk/home/emo/.wine/drive_c/windows/notepad.exe: PE32 executable for MS Windows (GUI) Intel 80386 32-bit
Wrong detection ??
I meant that notepad.exe is infact a ELF file with a Win PE32 header. Am i wrong again?
austin987 wrote:
3. After the creation of .wine directory the program can be loaded and executed. All the IMPORT functions are handled properly but is there any "conversion" between the different architectures. Meaning does the parameters passed to the library are handled in a ASM or in any higher programing language.
No, there is no conversion. Which is why wine on the PPC isn't very
useful, since it can't run Win32 applications, unless you wrap it with
a CPU emulator, like the old Darwine project used to do.
That is "everything" else from the IMPORT EXPORT functions is sent direct to the CPU?


Any idea in which part of the wine project ( loader/server/tools ) I would dig to find out that last bit. Hopefully after looking at the source of Darwine and qemu, I might come up with a solution ?
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: Wine-linux-ppc32 working status and future enchantments

Post by vitamin »

xexaxo wrote:I am sorry Austin but did no see your post at the first time. Do you have any idea why is the edit button missing it this forum ?
It's been disabled for a reason.
xexaxo wrote:

Code: Select all

file /media/disk/home/emo/.wine/drive_c/windows/notepad.exe 
/media/disk/home/emo/.wine/drive_c/windows/notepad.exe: PE32 executable for MS Windows (GUI) Intel 80386 32-bit
Wrong detection ??
I meant that notepad.exe is infact a ELF file with a Win PE32 header. Am i wrong again?
This is correct, however that file just a placeholder (Win PE header and resources, no actual code). The "real" notepad is under /usr[/local]/lib/wine/notepad.exe.so. Same thing for all other initial *.exe and *.dll files under ~/.wine directory.
xexaxo wrote:That is "everything" else from the IMPORT EXPORT functions is sent direct to the CPU?
Unless you really understand how the windows loader works it's pointless trying to answer this question. Besides loader is not the problem.

In short, Wine does not emulate CPU. The actual windows program is written and compiled for x86 CPU and contains x86 CPU instructions. It can not work on PPC (or any other non-x86 compatible architecture), because it has totally different instruction set.
xexaxo
Newbie
Newbie
Posts: 4
Joined: Fri Jun 12, 2009 7:22 am

Re: Wine-linux-ppc32 working status and future enchantments

Post by xexaxo »

vitamin wrote: Unless you really understand how the windows loader works it's pointless trying to answer this question. Besides loader is not the problem.

In short, Wine does not emulate CPU. The actual windows program is written and compiled for x86 CPU and contains x86 CPU instructions. It can not work on PPC (or any other non-x86 compatible architecture), because it has totally different instruction set.
I have a few ideas but notting proven ( about the loader bit ).
I was hoping that it would be just a simple ASM conversion ( from x86 AM to ppc32 ASM ) like some parts in the qemu, but I was wrong.

My search for the perfect distro + a working qemu in user mode continues. Does anyone found a working solution ?

Thank you for all of your answers
Locked