Re: Wine in Emscripten

636 views
Skip to first unread message

Alon Zakai

unread,
Oct 28, 2016, 1:15:28 PM10/28/16
to emscripten-discuss
Wow, impressive!

What does this use to render, btw?

On Tue, Oct 25, 2016 at 8:02 PM, Danoon <ja...@danoon.net> wrote:
I've been experimenting with getting Wine to run in Emscripten with the goal to play Win95/Win98 era games.  It has a long way to go, but I thought I would share a demo of notepad running.  So far I've been pretty impressed with the performance that Emscripten gives.

http://boxedwine.sf.net/b2/boxedwine.html

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aidan Hobson Sayers

unread,
Nov 1, 2016, 8:46:42 PM11/1/16
to emscripte...@googlegroups.com
A while ago I was pondering getting emscripten working under Wine, but realised that it's not quite as simple as a typical program (because Wine relies on being able to just provide a compatibility layer for syscalls, so the compatibility layer for x86 would have to be provided by the port to emscripten).

Seeing this post, I wondered if you'd found some cunning way around this so downloaded the project. No, you've just gone straight ahead and implemented an x86 emulator! Ok, but how is wine able to run on bare metal? Oh right, you've actually implemented parts of linux, including most of the syscall interface, your own executable loader, parts of procfs and assorted special devices! Alright, but (as Alon asks) how does this actually render things? Ah I see, you've implemented your own display driver in Wine which, when methods are invoked, dispatches interrupts to the emulated CPU which then forwards and translates the interrupt to an equivalent sdl call (with opengl working a similar way, but with a dll)!

Wow!

I only had a quick look so I may have missed some of the detail, but that's pretty impressive. Were there any projects you found particularly useful as a reference when building this (particularly the kernel and x86 emulation)? It mostly looks like original work, which seems like quite an undertaking.

On 28 October 2016 at 18:15, Alon Zakai <alon...@gmail.com> wrote:
Wow, impressive!

What does this use to render, btw?
On Tue, Oct 25, 2016 at 8:02 PM, Danoon <ja...@danoon.net> wrote:
I've been experimenting with getting Wine to run in Emscripten with the goal to play Win95/Win98 era games.  It has a long way to go, but I thought I would share a demo of notepad running.  So far I've been pretty impressed with the performance that Emscripten gives.

http://boxedwine.sf.net/b2/boxedwine.html

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Danoon

unread,
Nov 9, 2016, 9:39:40 PM11/9/16
to emscripten-discuss
I ported Dosbox to Java, so most of my knowledge of the emulation comes from the Dosbox project.

After I got Dos games to work in Java, my goal became to get Win95/98 era games to run in a browser using Java.  Originally I started messing around with writing my own windows libraries in Java, I even got Age of Empire to run.  I thought there wouldn't be that much to do just to get games working, but I was wrong.  After Oracles messed up Java in the browser I switch to c/emscripten and so far I've been pretty happy with that decision.

I tried to retarget Wine to compile for Windows/Emscripten directly.  I implemented a port for all the libc calls, it started to work, but it was really just too much work for one person.   Implementing about 100 Linux system calls and few devices got me pretty far and was for more manageable.  Basically BoxedWine is a Linux kernel emulator that can run a lot of Linux stuff, including XOrg, dpkg, etc.  But Wine with XOrg had a lot processes and all those moving pieces were a pain to debug.  Last time I was messing with it, I had a hang between XOrg and the window manager.  Plus the file system size was larger than I wanted.  I removed XOrg by writing a replacement for winex11.drv.  So now I don't need XOrg and all of its dependencies.

The Linux syscall emulation is original and based on documentation and trial and error.  I'm sure there are still quite a few bugs in it.  mmap still isn't quite right.

Currently I'm trying to get Win16 games to work because they have a low CPU requirement.  A lot of simple games are already working well.

The demo link I originally posted now shows a Win16 Pacman clone.

On a recent Core i5 I get about 33MHz (Pentium) in Emscripten, so not bad.  With some tweaking it should be in the realm of possibility to play some Win95/98 games that targeted a Pentium 66

Александр Гурьянов

unread,
Nov 10, 2016, 4:46:17 AM11/10/16
to emscripte...@googlegroups.com
Man, you're my hero!

To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
С уважением, Гурьянов Александр

Milan Raj

unread,
Nov 14, 2016, 7:50:39 PM11/14/16
to emscripten-discuss
This is a very cool project, thank you for sharing!
I have some old Windows Console User Interface games that would be fun to see back alive :)

Stuart Axon

unread,
Nov 27, 2018, 9:34:41 AM11/27/18
to emscripten-discuss
Doing an equivalent to the old crossover browser plugin could be interesting - we could run legacy plugins in the browser even though the netscape interface is going away.
Reply all
Reply to author
Forward
0 new messages