Slashdot Mirror


WINE for Mac OS X in Development

TylerL82 writes "The Darwine Project aims to get WINE up and running through X11 on Mac OS X/Darwin. According to the site, WINE itself compiles rather well, and they'll be using Bochs for the actual x86 emulation. Quite an interesting idea. It's crazy, but it just might work!"

23 of 150 comments (clear)

  1. wwwwoooorrrrrkkkkk by soboroff · · Score: 3, Insightful


    It just might work... but veeeeeeery slowly, if Bochs is underneath it.

    1. Re:wwwwoooorrrrrkkkkk by forsetti · · Score: 4, Insightful

      Actually, this might work out OK -- from their site, Bochs is going to be stripped down (no interface, no SDL, etc) and /just/ provide x86 emulation -- sort of like a software processor. Yes, it will not provide native speed, but it might just be "good enough"....

      --
      10b||~10b -- aah, what a question!
    2. Re:wwwwoooorrrrrkkkkk by addaon · · Score: 3, Informative

      Unfortunately, the slow part of Bochs is not the front end, it's the emulator. Admittedly, calls to the WINE api will run at native speed, but I imagine that very few windows programs spend most of their time there. Otherwise, expect slowdown of 99% - 99.9%... my G3/600MHz runs console apps in Bochs at around 900kHz equivalent.

      --

      I've had this sig for three days.
    3. Re:wwwwoooorrrrrkkkkk by squiggleslash · · Score: 4, Informative
      It just might work... but veeeeeeery slowly, if Bochs is underneath it.
      While the write-up says:
      According to the site, WINE itself compiles rather well, and they'll be using Bochs for the actual x86 emulation.
      The FAQ says:
      The second phase is to then integrate in WINE the QEMU binary translator.

      Additional supporting tools for launching Windows applications from the desktop and an integrated installer are desireable items for the package (like OpenOffice is doing).

      This is distinguished from simply using QEMU to run Windows because there is no Windows here. Just WINE and QEMU to run Windows applications directly under X. That will enable vastly better performance, better integration, and easier administration.

      For Mac OS X, the ideal would be to eventually use the native GUI.

      Further enhancements could include integrated support for things like FAT32/NTFS volumes with Windows under via QEMU (or other PC emulator) so that the same Windows applications could be run in either mode (Windows or WINE).

      My understanding is QEMU has a fairly good reputation, though that might simply be because it doesn't have the overhead of emulating VGA/etc.
      --
      You are not alone. This is not normal. None of this is normal.
    4. Re:wwwwoooorrrrrkkkkk by Cecil · · Score: 3, Insightful

      On the contrary. I'd suggest that *most* windows programs spend most of there time there. In particular, GDI drawing is one of the slowest things you can possibly do in the windows API -- and almost every application does it, to some extent. Which is not to say that Microsoft's GDI sucks (it does) but graphics are a notoriously slow operation when you're busy calculating margins and colors and transparencies and fonts.

      By the way, I hope your numbers are exagguration. If Bochs on a 600MHz processor is incapable of running a program faster than an 8088, then I will be somewhat disappointed.

  2. This will be really slow by NanoWit · · Score: 5, Insightful

    The reason we haven't seen WINE off of x86 yet is because like the name says "Wine Is Not an Emulator". So there's no code in wine that simulates the processor/real hardware. Bochs was just pitifully slow the few times that I used it. This won't have any kind of speed

    1. Re:This will be really slow by Joey+Patterson · · Score: 5, Funny

      there's no code in wine that simulates the processor/real hardware

      True that, but what about other solutions for running PC software on your Power Mac G5?

    2. Re:This will be really slow by addaon · · Score: 3, Interesting

      There's a LOT of reasons that 'all the java tricks' can't be applied; the main one is the different structure of memory. A few of the java tricks (dynamic recompilation, for example) can be; others (instruction reordering) can't be.

      --

      I've had this sig for three days.
    3. Re:This will be really slow by Llywelyn · · Score: 4, Funny

      From the article:

      >I have to say that I'm happy - I can keep on using XP. ....and thus getting what he richly deserves for that crime against nature.

      --
      Integrate Keynote and LaTeX
  3. Not much different from 68K-PPC conversion by wowbagger · · Score: 4, Interesting

    If you think about it, this COULD be done in a manner simillar to the way Apple handled the 68K to PPC conversion:

    You have BOCHS run the actual application code. When the code makes a call to one of Wine's libraries, you hit an escape sequence and drop to native PPC code for the actual implementation. At the end of the call, you resume emulation. It would probably require some changes in the shim layers between the DLL exports and the core Wine code, but it could be done.

    That worked well for MacOS because applications spent most of their time in OS code (which was native PPC). How well it would work for Windows programs remains to be seen.

    This has been kicked around a bin on Winedev.

    Disclaimer: IAAWD (I AM a Wine developer, in my own small way - I did some cleanup on the Joystick and ADPCM audio code).

  4. Unlikely to provide any speed by Anonymous Coward · · Score: 3, Informative

    Virtual PC may run reasonably quickly (still not what I'd call 'fast'), but that's because it used a horrible hack. All PPC processors up to and NOT including the G5 were bi-endian. VPC switched their endianness while it was running so it could do everything without swapping bytes. This is both the delay to further VPC releases and the reason x86 emulators will remain quite slow.

    1. Re:Unlikely to provide any speed by FredFnord · · Score: 3, Informative

      > All PPC processors up to and NOT including the G5 were bi-endian. VPC switched their endianness while it was
      > running so it could do everything without swapping bytes.

      Incorrect. It used specific little-endian processor instructions, but it did not put the chip into little-endian mode.

      And, oddly, Virtual PC's performance was never more than 25% or so greater than SoftWindows's performance, and SoftWindows never used them at all, and was a badly-ported 680x0 program by then to boot. So frankly, I have my doubts that this is really going to make that much of a difference.

      -fred

      --
      Sign #11 of Slashdot overdose: You see the phrase 'moderate Republican' and you wonder if that would be a +1 or a -1.
  5. Two things by Llywelyn · · Score: 3, Insightful

    ...that might throw a wrench in that, even assuming the apps do spend their time in system calls.

    0) The PowerPC was an order of magnitude faster than 68k series. IIRC the 601 had twice the clock and was faster per clock than the 68040. There is no such advantage here.

    1) In order to handle everything correctly here the bit-order is going to have to be switched (different endians). This is not fast on a good day.

    --
    Integrate Keynote and LaTeX
    1. Re:Two things by g_lightyear · · Score: 5, Informative

      Not necessarily. The technology being chosen is a combination of native code - which can do any necessary 'transitions' to a 'normal' endian mechanism at the API boundary between WINE and the application - and the emulator in question.

      The emulator in question is based on something similar to the FX! Alpha code recompiler; it provides an execution environment, yes, but also dynamically recompiles code into native.

      Between the core Windows libraries being "native" (in that they're wine lib, and therefore PPC-compiled native on OSX, not native x86) and the remainder in this 'recompiled' code execution environment, it's possible to strip out much of the endian issues.

      Not saying they will - only that there's a lot of room to manoeuvre here.

      Free.fr, where the project is hosted, is (of course) being slashdotted.

      One of the performance metrics lists the QEMU version of gzip (x86 on PPC) being 5 times slower than native (for example) - and comparison to bochs put bochs well behind (however, qemu had no MMU emulation).

      --
      -- A mind is a terrible thing.
    2. Re:Two things by clem.dickey · · Score: 4, Informative

      > the bit-order is going to have to be switched (different endians). This is not fast on a good day

      That's byte order, not bit order.

      Even on a bad day dealing with byte-reversed integers on a PPC requires just two instructions: Load Byte Reversed and Store Byte Reversed. These replace the Load and Store which PPC uses for native data.

      Floating point load/store would suffer, though. You would have to use the integer unit to reverse the bytes, as there is no Load/Store Float Byte Reversed.

      Note that data in a PPC register has no endianness, because PPC registers, unlike PPC memory, do not provide byte or bit addressability. (The original POWER processor have an "extract bit" instruction which extracted a bit at (big-endian) position n in a register. This instruction was not carried forward to the PPC.)

  6. Just Goes To Show... by Flwyd · · Score: 4, Funny

    All problems in Computer Science can be solved by adding another layer of indirection.

    --
    Ceci n'est pas une signature.
  7. Not using Bochs... by BlueSteel · · Score: 5, Interesting

    According to their FAQ, they aren't using Bochs for x86 emulation, but QEMU. I have no experience with QEMU, but according to some of the posts on Darwine's sourceforge message board, it's much much faster than Bochs. I wish these guys luck. I'd love to have wine running on OS X.

    1. Re:Not using Bochs... by nathanh · · Score: 4, Informative
      According to their FAQ, they aren't using Bochs for x86 emulation, but QEMU. I have no experience with QEMU, but according to some of the posts on Darwine's sourceforge message board, it's much much faster than Bochs. I wish these guys luck. I'd love to have wine running on OS X.

      The reason QEMU is faster is because of dynamic translation.

      Bochs decodes each and every instruction just before it is executed. So if you have a loop that executes 100 times, you have to decode the same instructions 100 times. That's incredibly slow. I have seen estimates that Bochs needs 160,000 native CPU instructions to emulate a single x86 instruction.

      QEMU takes a block of code (typically a whole page) and translates the block into the native instruction set. Then it executes the translated block of code. QEMU tries to keep translated blocks around as long as possible, using dirty bits to determine when retranslation is needed. This is the same technique used by VirtualPC on the Macintosh. It is much faster than Bochs!

      There is experimental code in Plex86 to do dynamic translation and Bochs can use Plex86 as the backend (it offloads entire pages of code to Plex86). So it's possible that Bochs will one day achieve the performance of QEMU.

      Take note that QEMU is usable today, just so long as you're running purely Linux binaries. It is possible to use QEMU to run Linux/x86 binaries on Linux/PPC for example. QEMU's dynamic translation engine is pretty decent. QEMU doesn't emulate the PC hardware. Bochs does emulate the PC hardware. If you could cherry pick the dynamic translation from QEMU and the PC hardware emulation from Bochs then you'd have something to compete with VirtualPC right now.

  8. Bochs? by CODiNE · · Score: 5, Informative

    I don't know where all this Bochs talk is coming from. I checked the FAQ and looked around some links and never saw it mentioned. QEMU on the other hand seems to be what they're putting in the official release. Maybe Bochs is in there for now for compatibility reasons. QEMU is waaaay faster than bochs, I can't wait til this is packaged up in a DMG that I can recommend to my OS X buddies.

    --
    Cwm, fjord-bank glyphs vext quiz
  9. "Slow" is relative by fm6 · · Score: 4, Interesting
    It's true that emulating a serious CPU takes a lot of crunching. Which is why we've traditionally relied on campatibility layers (like Wine) and hardware support. But like many other problems, this one is being nibbled at by increasing CPU specs.

    When I want to play an old DOS game on my XP system, I don't mess with a compatibility layer (complicated and unreliable) or reboot to DOS (damned inconvenient). I run DOSBox, which emulates not just the CPU, but the sound card and video adapter as well! The overhead is horrendous (Sword of the Samurai takes more than half the cycles on my 1 Ghz Pentium III), but well within the capacity of my system. And that's a real-time application! I imagine the DOSBox would barely notice the overhead for something less CPU-intensive, like a word processor. One of these days, I'm going to have to try Windows 3.0...

    I think most Windows desktop applications (database clients, productivity software) would have even less overhead than my old DOS games. But even if they had a lot more, consider the specs of a low-end Macintosh. Its CPU cycles as fast as my Dell's, and the raw crunching power of a G4 is possibly twice that of my PIII. Never mind a dual-processor G5!

    Which isn't all that expensive. If performance and usability were the only criteria for buying a computer, I'd be a Mac fanatic. As it is, I hardly ever touch one. Oh well.

  10. some people by Enrico+Pulatzo · · Score: 4, Funny

    will do anything to play minesweeper.

  11. They really screwed up this article - QEMU by Corpus_Callosum · · Score: 3, Insightful

    Unfortunately, this write-up is totally screwed up. The intended emulator is QEMU, which can already be used on PPC/Linux to run Wine at speeds aproaching native speeds. I posted a link to the forum where this is discussed elsewhere, but here it is again.

    QEMU is a dynamic translator that decompiles x86 executables and recompiles them into PPC, caching the results. You can find the qemu project here.

    Not only will this work, but it will work FAST. In fact, it will probably even be possible to drop windows DLLs onto your mac in the same way that you drop them onto Linux in order to get Wine to work better (using native windows DLLs instead of Wine clean-room versions). Remember, QEMU is a dynamic translator.

    --
    The reason that it can be true that 1+1 > 2 is that very peculiar nonzero value of the + operator
  12. Re:I somehow doubt this will be any good by forkazoo · · Score: 3, Informative


    As it's been said here, Wine is not an emulator. The reason it works as well as it does is BECAUSE it's running on x86 hardware. Having it emulate x86 is going to really bog it down. I seriously doubt it will work better than VirtualPC. However, if they can get hardware vidoe acceleration working, then it might just be worth it.


    Video acceleration comes free, through a few layers of abstraction. Basically, the windows program will call some Win32 API function
    FooDrawTextlpsz(string);

    The CPU emulator runs along fine and dandy until it hits this point, and needs to jump to the Win32 native API code. It calls WINE for this.

    WINE is a natively compiled PPC application / library, so FooDrawText is just native compiled PPC code.

    WINE takes the Win32 function, and uses an Xlib equivalent. XFooMakeStringGetDrawn(string, MONACO) or whatever.

    The X server takes this Xlib call, and passes it to the Aqua drawing system, because on Mac OS X, the X Server is just an Application running alongside other native Apps.

    So, Aqua draws the text into the window at the correct position, just as windows would on a native system.

    This window is treated as a texture object.

    The texture is used by the Quartz Compositing engine to draw the window to the screen by using OpenGL.

    OpenGL takes the instructions to draw the windows, and hands them off to the video driver.

    The video driver then instructs the card to finally draw the window onto the screen, using native commands for the specific card.

    Lo and behold, the X86 Win32 request to draw text has resulted in a picture of some letters in our frame buffer.

    Egad, I should probably take up baking.

    So, anyhow, my point is that the Wine/ppc guys don't need to write an emulator for the video hardware. Though it's heavily abstracted, they get video acceleration for free thanks to the existing Xlib code. The Win32 application never touches the actual video device - it just makes API calls which make things happen to the hardware. Now, if this were a DOS emulator, it'd be completely different. You would need to actually emulate a VGA card that the program can have to itself.