
Show HN: Windows 98 in browser - g3
http://copy.sh/v86/?profile=windows98
======
normac
This is such a great demonstration of both how fast JS engines have become in
the browser, and how much less efficient native software has become overall.
Running on top of an x86 emulator _in JavaScript_ , it's still faster to pop
open a file browser and click around than it is on some modern smartphones.

~~~
toyg
Most modern smartphones run Android, which means they have a bastardized Java
VM between your "native code" and actual metal... not unlike having a JS VM.

It's not that "native software" has become less efficient, but rather that it
is slowly disappearing.

~~~
mwcampbell
As of Android 5.0, the Android Runtime (ART) compiles Dex bytecode ahead of
time to native code. That probably still isn't as efficient as C++ or the
like, because there's still a garbage collector, and Java methods are virtual
by default.

------
agentultra
This is actually really useful to me. I've been working on-and-off re-
implementing Comic Chat using HTML5. It's nice having a working copy again to
reference. The paper is great but it omits some details.

~~~
yolesaber
Comic Chat, like the program used to make jerkcity comics? Would be amazing to
have a web version, best of luck!

------
zero-g
Where does one start with such thing? I mean, where do I read how to emulate
CPU (or at least how CPU works, so I would be able to come up with how to
emulate it by myself), how does PS/2 work, how to boot an image from BIOS?

~~~
toyg
University courses? I'm pretty sure CPUs were a huge part of my first year of
CS.

~~~
0xffff2
Learning about CPU internals was a huge part of your _first year_ in CS? Where
did you go to school?

At my school and every other school I'm remotely familiar with, the knowledge
needed to emulate a CPU would be covered in upper division computer
engineering courses, and not covered by CS undergrads at all, certainly not in
their first year.

~~~
Elv13
Back in 2007, my first semester in a technical CS school had plenty of
assembly, binary, MMU emulation, OSI / TCP/IP, boolean math and so on.

I know this is mostly gone at this point, but it should not. The fundamentals
are essentials. I often meet people who are totally clueless how a computer
work and have CS degrees.

"How can you do C, it is so old? By now, we must have invented faster
languages. Computers changed so much recently". Sure... Binary is now
expressed with emoji.

~~~
taneq
Wow. My first semester of computer science had me studying fuckin' Gofer.

~~~
unwind
As in
[https://en.wikipedia.org/wiki/Gopher_%28protocol%29](https://en.wikipedia.org/wiki/Gopher_%28protocol%29),
right, the precursor to HTTP?

~~~
taneq
Nope, as in
[https://en.wikipedia.org/wiki/Gofer_%28programming_language%...](https://en.wikipedia.org/wiki/Gofer_%28programming_language%29),
the neutered Haskell clone.

Don't get me wrong, I certainly think that functional programming has its
place in the world, but as a first year uni student all fired up about finally
learning "real" programming after years of teaching myself (back before the
internet laid everything out on a platter), I was _not_ impressed.

~~~
toyg
Eh, same with me and Scheme.

I don't think functional paradigms can really be appreciated by 1st/2nd year
undergrads. At that age you are fundamentally impatient to make your mark in a
practical sense, your approach will be instinctively imperative. You have to
hit the wall (scaling / parallelism / thread management / complexity etc)
before you start to really appreciate the upsides of functional paradigms.

Unfortunately, a lot of professors are actually terrible educators (after all,
they did not get there by teaching but by researching) and think the learning
process is as linear as house-building: "place bricks here and there so that
your next row will be this way and that way". They also think people should
enjoy programming for programming's sake, whereas a lot of people are
motivated by a creative process driven by outcomes.

~~~
Symbiote
> your approach will be instinctively imperative

Not necessarily (based on being an assistant in lab sessions for first year
students learning Haskell).

But what it did do was put everyone on the same level, including the arrogant
students who "already knew how to code" and hadn't listened (or attended) the
lectures.

I think they chose a functional language to start with good habits for
thinking about _what_ to implement, not how to implement it. If you don't know
what the problem is, you should work on that, rather than bashing out some
Java...

------
te_platt
Very nice. Although opening IE and trying to go to
[http://copy.sh/v86/?profile=windows98](http://copy.sh/v86/?profile=windows98)
gave an error. Go figure...

~~~
lugg
It doesn't have internet.

You might be able to compile the js down to a single copy paste into a file
then load that in ie.

I'm going to guess it won't work in IE from 1998 though.

------
ank_the_elder
That's amazing - do you have any info on the underlying implementation?

~~~
g3
It's a fully emulated PC: CPU, memory, hard drive, … The CPU especially took
me very long to get right with all the details to run Windows 98.

The code is here: [https://github.com/copy/v86](https://github.com/copy/v86)

~~~
zx2c4
NSA backdoor!

[https://github.com/copy/v86/commit/159f565de4dd99bff9b46c45a...](https://github.com/copy/v86/commit/159f565de4dd99bff9b46c45aa7998ef35aa7168)

Nope, Windows 98 undefined instruction.

~~~
monocasa
Yep!

[https://blogs.msdn.microsoft.com/oldnewthing/20041215-00/?p=...](https://blogs.msdn.microsoft.com/oldnewthing/20041215-00/?p=37003)

------
fsiefken
How would v86 compare to jslinux speedwise?
[http://bellard.org/jslinux/](http://bellard.org/jslinux/)

ELKS in javascript would be nice as well, you would get the ultimate speedy
portable unix ecosystem in the browser.
[https://github.com/jbruchon/elks](https://github.com/jbruchon/elks)

~~~
copy
Poorly, see [https://github.com/s-macke/jor1k/wiki/Benchmark-with-
other-e...](https://github.com/s-macke/jor1k/wiki/Benchmark-with-other-
emulators)

Primarily due to the use of asm.js. I intend to implement a JIT similar to
QEMU's tcg as soon as Web Assembly supports it:
[https://github.com/WebAssembly/design/blob/master/FutureFeat...](https://github.com/WebAssembly/design/blob/master/FutureFeatures.md#platform-
independent-just-in-time-jit-compilation)

~~~
s-macke
Great work on your emulator. I am also looking forward to use webassembly for
my emulator when available. However, I don't expect much speed improvement. I
guess you can speed up your emulator significantly by putting in some '|0'
noops to prevent deoptimizations into double precision.

------
xhrpost
It's stuff like this that makes me wish I had unlimited side project time. I
think this could be fun to work on but my assembly/C level programming skills
would need some serious ramp-up. Great work though!

------
hanief
Minesweeper! Ah, the nostalgia.

A note: the mouse position and acceleration seems to not be mapped correctly.
It is often separated away from my local desktop mouse position. Maybe because
the screen resolution is different?

~~~
tempestn
I'm having the same issue. It makes it difficult to do anything, because I
would need to move my actual mouse pointer past the edge of my monitor to get
to any of the icons or start menu with the virtual mouse.

~~~
gwbas1c
You gotta lock the mouse. Most likely, something's emulating a physical mouse
input, which is inexact.

------
vanattab
Are there license issues around this project? I doubt Microsoft would care to
put the resources into enforcement of windows 98 licenses but I am just
curious about the legality.

~~~
mollmerx
Essentially you are being given a copy of a VM that has a copy of Windows pre-
installed. It's unlikely (but possible) that Microsoft has granted a license
for this. I imagine this is technically not legal, but as you say, unlikely to
matter much.

~~~
orionblastar
Microsoft does not seem to bother with older software. It is because they
don't support and upgeade it anymore.

Microsoft only goes against piracy of software they still support and upgrade.

They don't bother with the old software because it isn't worth it to sue or
send a c&d letter because they don't earn an income with it anymore. So they
don't lose income if someone pirates software they no longer sell.

In fact they gave away the source code to an early MS-DOS and MS-Word as part
of their own open source license.

It is good PR for them if someone emulates their old software in the web
browser and gives them free publicity.

------
Theodores
That is brilliant. Little things like being able to change the screen
resolution and waste time on Solitaire - what more could one want!!! Works
amazingly.

Also it is quite a historical artefact, things like Active Desktop were truly
cool back in the day. Plus the simplicity of the Win98 UI is a joy to return
to.

Congratulations!

~~~
mbrock
The start menu is pretty nice, compared to the awful "launch pad" style full-
screen app menus that are now in OS X, GNOME, and Windows...

------
clock_tower
This is awe-inspiring. I don't know what to say -- except that, if it was
faster, I'd try to run Windows 98 in the browser of Windows 98 in the browser.

------
apetresc
The network interface doesn't seem to be configured – when I try to open the
browser it wants me to install a modem. Is the VM just not configured for
that, or do I need to do something? Would love to see what today's web looks
like on '98 IE :)

~~~
copy
It's possible, Windows 98 has drivers for the NE2000 network card we're
emulating
([https://github.com/copy/v86/blob/master/src/ne2k.js](https://github.com/copy/v86/blob/master/src/ne2k.js)).
However, currently the emulation isn't accurate enough, Windows 98 refuses to
use it.

~~~
duskwuff
The bigger problem would be what to connect it to, and how. You can't make
arbitrary outbound connections from Javascript.

~~~
iso-8859-1
I have a barely working HTTP proxy in client-side-JavaScript here:
[https://github.com/ysangkok/browser-http-
proxy](https://github.com/ysangkok/browser-http-proxy)

This allows you to connect to CORS enabled sites without using the WebSocket
proxy. It talks HTTP on the serial port.

I want to add SNI support to tlstunnel so that I can tunnel to google.com by
navigating to [https://google.com.mydomain/](https://google.com.mydomain/) and
having the snitunnel tunnel to [http://google.com](http://google.com) by
reading the bottom-level domain names using SNI.

Using this with browser-http-proxy, it would be possible to tunnel to HTTP
sites on a request-based level (making it easier to scale) and without relying
on tun/tap on the server. Also it could serve as a fallback for non-CORS
enabled hosts.

------
dmitrygr
It breaks horribly if you click start->run, type "command" and press enter

~~~
copy
Yep, unfortunately it seems to be a driver issue, because I'm having the same
problem in QEMU. These are the drivers:
[http://www.navozhdeniye.narod.ru/vbe9x.htm](http://www.navozhdeniye.narod.ru/vbe9x.htm)

------
Mizza
The inclusion of eSheep is an absolute stroke of genius.

------
kaitnieks
Running con\con works, too. Just like I remember it :)

~~~
olavgg
Haha! That was the first thing I tried, had a good laugh again :-)

I still remember you could crash remote computers by going into a public forum
and post an image that linked to c:\con\con

------
latenightcoding
sheep.exe, hello old friend

~~~
collinmanderson
I _totally_ remember it.

------
fsiefken
What a coincidence, I was just thinking about how nice it would be if I could
start a minimal javascript linux with toybox and start spacemacs with it (<
64M) and a small mounted filesystem somewhere.

Win 3.11 in the browser would be nice too, there is a whole ecosystem of apps.
Windows95b would be slower, but still faster and smaller then Windows98.

I wonder how fast civ1 would run on freedos here.

~~~
TazeTSchnitzel
95 in the browser has already been done (by me):
[https://win95.ajf.me/](https://win95.ajf.me/)

That uses Em-DOSBox, which is more limited than v86 (which the OP uses) in
some respects. I think v86 is loading hard disk sectors on-demand, which is
pretty amazing compared to Em-DOSBox which has to download a massive disk
image. On the other hand, Em-DOSBox has sound support!

The Internet Archive has 3.11 in the browser:
[https://archive.org/details/win3_stock](https://archive.org/details/win3_stock)
(there's also various 3.x games as well)

This also uses Em-DOSBox.

------
tomkin
Dude, I'm just trying to align text in CSS, and you're all like "here's an OS
in js."

------
nickysielicki
Is this legal?

I'm surprised MS hasn't open-sourced NT 3.x already.

------
danjayh
Windows before 30 years of updates that were created with a need to maintain
backwards compatibility feels so cohesive. I mean, that control panel is just
_so clean_.

Also, would be interested in seeing the orginal Win 95 (before OSR2). It was
way way faster than win 98.

~~~
TazeTSchnitzel
The control panel in newer versions could still be that clean if Microsoft
hadn't tried to reinvent it three times (XP, Vista, 8).

Of course, the 9x control panel is, in a way, a reinvention of the 3.x control
panel. It's just a very clean one, because the 3.x control panel was a window
full of icons, and the 9x control panel is an _Explorer_ window full of icons.

------
toyg
"My Briefcase" could have been Dropbox, 10 years earlier, if only 1) it could
work decently, which it never did, and 2) had an option to sync to MS servers.
Bandwidth was an issue at home, back then, but for offices it would have been
fine.

~~~
Spooky23
In the age of 4.3 GB drives that cost $750, unlikely.

~~~
toyg
It was also the age of the average file being 20kb though. You could have
provided 50mb per user and the world would have gone "woah".

~~~
ManlyBread
I remember how amazing it was when the email accounts went from 20mb max size
to something like 500mb, it blew my mind and gave rise to many services that
capitalized on this huge amount of space (mostly peer-to-mail and an
application that turned gmail accounts into a dropbox kind of thing).

------
72deluxe
This is really impressive, and also brings back waves of nostalgia as I used
to use Windows 98 (and 95 and 3.11 before that) as my daily driver.

I like how the cloud icons at the side of Explorer when not in classic mode
still are drawn with a white background even if you change the colour scheme.

On a real machine, when I look at this old system I realise how little we have
moved on in UI terms or the basic needs and requirements of a computer. You
could do 99% of what you need to do on an old computer, other than duff
website rendering and horrible security and power usage.

------
somecoder
Best part, it comes with scmpoo.

------
tomc1985
How bad is it that Windows 98, running in a ^%%^@#!ing emulator, in my browser
no less, runs better than the latest versions of Android OR iOS?

~~~
vkou
I'm on a beefy 12-core 'nix box with 64 GB of RAM, and this emulator is
_extremely_ sluggish for me.

Perhaps because it doesn't run well for everyone?

~~~
tomc1985
Oh, I wouldn't call this emu fast... but its still faster than a lot of
smartphones I encounter

------
livatlantis
Doesn't seem to work too well on Windows 10. It might be missing some DLLs. /s

Super cool! (I really can't get it to click on anything though)

~~~
triplem
You can use the Lock mouse button. You will be able to click on what you want.

~~~
michaelmior
The Lock mouse button helped with my first problem which was that the emulated
cursor seemed to be scaling its position based on the side of my browser
window instead of the size of the emulated window. Locking the mouse fixed the
position issue but I'm still unable to click on anything though.

~~~
pan69
Once you go into fullscreen mode it seems it work fine, but it took me a while
to figure this out...

~~~
livatlantis
Ah right, thanks! _Ctrl+R, regedit_

Now only if we had a version that could connect to the internet. Right now it
tells me that it can't find a modem and that I should call MSN Technical
Support! Cute.

------
kelvin0
Respect! This and Fabrice Bellard's emulator have me in awe.
[http://www.bellard.org/jslinux/](http://www.bellard.org/jslinux/) It's even
more painful when I know that technically I should be able to do the same, but
have not yet done it ...

------
jhallenworld
But is the A20 gate being properly emulated? :) I know a verification engineer
who left AMD because he was tired of dealing with the ancient testbench which
checked the ancient hardware.

The browser should run in the hypervisor and provide a real hardware virtual
machine. Provide both ARM and x86, one is emulated and one is real.

~~~
copy
It's not. I haven't come across any software that relied on it.

~~~
striking
Somewhat infamously, GRUB failed on Intel Macs (in 2006?) because it tried to
use the A20 gate, and Apple refused to emulate it. It's fixed now, though.

------
andrewchambers
Anyone tried to make a plan9 in browser?

------
bchjam
oh the irony, Win98 was the MS "internet as desktop" release. Least favorite
OS ever

Awesome project though!

~~~
Someone1234
Windows ME was my most disliked OS (too buggy, even after service packs). I
think the level of complexity finally hit the wall given the 9x series lack of
good memory/file protections.

My favorite 9x OS is 98 SE (which was a stand-alone release, not a service
pack). But 98 "first edition" did add substantial features to 95: IE 4, multi-
monitor support, sfc was added (which was useful because 9x got corrupted a
LOT), ACPI support, better plug and play, and better hardware support overall.

98 SE just added USB support out of the box (which was a big deal for those of
us trying to use USB mice), IE 5, WebDAV, Windows Explorer improvements, ICS,
improved WMP, and all of 98 "first editions" hotfixes and updates. You could
make 98 "first edition" into 98 SE more or less, but 98 SE was a nice thing to
"just install" and have everything work.

My 1990s/early 2000s OSs looked like this: 3.1, 95, 98, 98 SE, ME, back to 98
SE, and then 2000, XP SP1, and beyond. Skipped XP pre-SP1 as it was a pretty
shoddy release compared to 2000 at the time, and ran away from ME screaming.

~~~
Joeri
I ran all of those windows versions as well, but my favorite remains NT4. I
stuck with that for a long time, until the lack of drivers forced an upgrade.
It was incredibly fast (smooth on a 66 mhz 486), rock-solid (uptimes of weeks
with daily use), light-weight (32 MB RAM was doable, 128 MB was multi-tasking
heaven). It's nice that MS is trimming down windows lately, but I keep
thinking that it's a bit like seeing someone who has let themselves go get
back on a diet. If they hadn't put on the weight in the first place, they
would have never needed to lose it.

------
EwanG
So pulled this up from my Chromebook - rather interesting to have Chrome
running Windows rather than the other way around. Of course the big leap will
come when it gets Win XP up and running and then folks will have an answer for
their legacy systems...

------
chdir
Let's see, now I can browse :

IE in Win98 in Chrome in Ubuntu in VMWare in Win7

------
TazeTSchnitzel
How does this compare to Em-DOSBox (e.g.
[https://win95.ajf.me/](https://win95.ajf.me/)) in terms of speed?

------
laretluval
How does it compare to Windows RG?

[http://www.deanliou.com/WinRG/](http://www.deanliou.com/WinRG/)

------
runn1ng
Doesn't work on my Android phone, in Chrome.

But I didn't expect it to :)

Edit: for what it's worth, FreeDOS boots there. No way to put in keyboard
input though.

~~~
zxexz
Install Hacker Keyboard from fdroid (or the Play Store...). There's an option
for a persistent notification that you can click, which will enable the
keyboard wherever.

------
nandhp
Someone needs to port SLiRP to JavaScript+CORS.

------
dheera
And here's me fighting with running Android ARM code on x86 ... I wish I had
more time.

------
fibo
Awesome, it works also on my Windows phone browser ( that is Internet Explorer
:)

------
Smushman
Any suggestions on how to upload software?

Could I use kermit, xmodem, ymodem, zmodem through com 1?

------
sangnoir
Any tips on how I can reliably trigger a BSOD? For old time's sake.

~~~
Analemma_
Open the Run panel and try to go to "C:\con\con". Instant BSOD. (This was an
old trick I used to do as a bratty kid when people left their computers
unlocked. Nice to see that it still works!)

------
Smushman
I am really impressed by this.

I am sure you put a lot of labor into this project.

You also seeded lots of ideas...

Thank you.

------
w84t1me
It would be fun to see the BSOD in my browser just for nostalgia.

------
fokinsean
This blows my mind.

------
executesorder66
This reminded me of www.windows93.net

------
icoder
start->command->fail

(command as in command.com)

------
jhauris
Amazing work.

------
tomc1985
The mouse cursor doesnt work.... my system's real cursor is still onscreen and
the emulator is doing a very poor job of tracking my movements, and its not
intercepting clicks or anything like that either.

None of the toy 'show HN' emulators that have popped up have a properly
working mouse cursor....

~~~
darryl42
It worked after clicking on lock mouse. Using the latest firefox.

~~~
tomc1985
That works. Chromium 47 here

