With Windows 9x Subsystem for Linux you can run all your favourite Windows and Linux apps side-by-side with a modern Linux kernel running cooperatively with the Windows kernel in ring 0. And unlike modern WSL, no hardware virtualisation is used so even your 486 can run it!
Please enjoy, I think this might be one of my greatest hacks of all time
@hailey holy shit.
@hailey Is this like CoLinux? It was running User Mode Linux as a Windows process on XP, no virtualisation needed. Basically WSL2 way ahead of it's time!
The only caveat is that it relied on both arches having compatible pointer sizes which excluded 64bit, so it was never ported to win7.
On a technical aspect though WSL1 is IMHO even better than it's successor, it's literally implementing POSIX and Linux on the NT microkernel. After all NT was supposed to also run OS/2 and Xenix...
@hailey have you made any attempt to get networking working? Presumably that's all you'd need to get X up and running since you could run Hummingbird eXceed or one of the other preexisting win9x X servers
@fraggle no attempt yet but I think it would just be a matter of writing a network driver for it on each side!
@hailey jesus fucking christ this is an abomination of epic proportions that has no right to exist in a just universe and I love it so much
Syscalls are handled via the general protection fault handler, as Win9x does not have an interrupt descriptor table long enough to install a proper handler for
int 0x80- the Linux i386 syscall interrupt.
🤯
@hailey Awesome work! Guessing my 486 is below spec but super cool!
@hailey this is so awesome! And yeah, this seems like a less intrusive way to extend the practical life of old computers.
@hailey finally, colinux has a new competitor
@hailey Hah! Reminds me of coLinux, but that was actually later on NT. https://en.wikipedia.org/wiki/Colinux
Um actually, v86 mode is a form of hardware virtualisation. This is misleading!
But for real (mode), this is very cool! How much torturing of the Windows 95 VMM did this need?
@w8l surprisingly not that much! Calling a few VMM services like VMMCreateThread and the memory context related ones they say are internal only and should not be called but that's about it as far as internals poking goes
@hailey
Oh, you're the same person behind doslinux! Presumably a lot of your work on that also carried over to wsl9x, yes?
@w8l I've wanted to do wsl9x ever since I did doslinux! It just took me 6 years of turning it over in my head to figure out how to do it :) there's no direct lineage between the two projects, they take very different approaches, but I definitely took the learnings from doslinux with me
First of all, nice job.
Second of all, it's not quite clear from the docs — does this run Windows 95 on modern hardware thanks to modern Linux, or is it the other way around, i.e. modern Linux on old hardware?
By the way, I have some cursed Windows 9x ideas of my own as well, but they focus on running it on modern hardware:
- An HD audio driver. Someone already beat me to it
- A memory paging driver that would use the extra RAM that Windows 9x can't normally access as a "page file" of sorts. I have a very vague idea of how an MMU works from the perspective of an OS kernel, so no idea if it's possible, but it would be extra cool if the "swapping" could be done by simply modifying the page tables without having to copy anything anywhere
- And finally, since Windows 9x is completely unaware of multi-core CPUs, how about a universal driver that would run modified Linux on the remaining cores and work as a hardware abstraction layer of sorts for at least GPUs and network cards
@hailey The best kind of cursed. Amazing.
@hailey @ActionRetro Look, a new lovely weird way to run modern software on old computer!
@hailey Perish the thought of running an LTS kernel on Windows 98, like some kind of peasant! 😁
@hailey I'm actually looking forward to inevitable Dave Cutler video about this
@hailey To be perfect, someone would have to invent DSL - DOS Subsystem for Linux.
Legacy ninja techniques are reaching high levels.
@maotongzhi I did that! https://github.com/haileys/doslinux
@hailey i had to read that twice until i realized that its a linux on an old windows kinda thing like wsl. This is crazy and amazing i love opensource a lot!!!
@hailey OMG. This means Rust and Golang apps in that context.
@hailey Are there any binaries available? I really don't want to install musl cross-toolchain and Open Watcom :/
Will I be able to install Alpine or Void musl on it?
Just a few weeks ago I set up an Celeron 440 + GF7300 PC just for Win9x
@mirabilos @hailey Well, that said WSL1 didn't come without any drawback:
- Slower local file access (files were stored natively on NTFS, even trough a VM Linus on ext4 is faster)
- Cross-os file changes caused weird permission/ACL issues
- Not all Linux ABI / interfaces were implemented (and this is a moving target!)
That last point is important, for ex. Debian Trixie fails on WSL1 because new passwd locking isn't implemented in the NT kernel. New interfaces would require support too.
@hailey brilliant
@mirabilos @hailey They actually fixed it, you can use host networking in recent versions. That matter a lot for me as I prefer using Vcxsrv for the X server. Theirs is broken on non-US keyboards and I don't need 3D. And besides, I've been using X apps long before WSL "supported" them.
IIRC initially we could use the resolver's IP but they locked out down, and then whatever solution caused X apps to randomly disconnect. But I have it 100% stable again. Happy to share my setup when I'm home...
@hailey @dermoth I did intricate things with getting and setting the ECN bits on v4 and v6 UDP with v4/v6 sockets, and the networking was… very broken.
But that was for a previous job, and also only to see what works on AIX, BSD, Windows, etc.
Thankfully, no Windows at the new job, and only win2k (for which I have Cygwin and Interix) at home, so no need to share.
@hailey this is gloriously cursed! Amazing!
NGL, the thing I'm MOST surprised by is how the command.com box seems to be able to render the terminal emulator even a little bit correct!
I had to write my own for my 16bit windows SSH client. 😅
@hp thanks to the NNANSI TSR :)
@hailey Ohhh, that makes some sense! So the terminal really is running in an actual DOS box then?
Is that why wsl.com is a com file?
@hp yep! wsl.com is just a client program, it exists to hold a DOS window open for the console driver in the kernel to push chars into. + it also handles shuttling keystrokes from DOS to the console driver on IRQ. I've written up a quick tech overview in the readme if you want to read more!
@hailey shitting heck hailey that is an absolutely bananas contraption! and built on Quite A Bit of reversing, hey? I am blown away and also delighted
stellar job. gold star ⭐
@hailey you made it into El Reg, congrats :)
Would it be possible to use this hackery to run a Linux kernel as a guest under a different co-operative multitasking OS for the x86 family ... namely TempleOS?
Enquiring lunatics want to know!
@hailey Is this one of those Jurassic Park moments where you didn't consider if the world truly needed this?
(PS We did.)
@hailey I'm trying to build that, but it seems like when building the kernel you depend on busybox and fastfetch to be somewhere and already build?
Any chance you can update the build instructions to reflect that?
@hailey You are a deeply warped individual, and I mean that in the most complimentary possible sense.
@hailey Well, you have to use the 486 support fork of Linux since Torvalds keeps getting convinced to remove support for hardware when the patents on the old stuff expire and it becomes available to implement as cheap open hardware clones.
@dec_hl good catch, you can just comment out fastfetch for now! (though you will need busybox)
@abrasive thank you!!! I am very proud of it :) the end result only uses documented APIs but all that reversing was necessary to build up the confidence that the idea I had in mind would work
@hailey you are totally awesome. I can't try, I don't have a running win95...
@hailey
Ohhhh is it possible to install windows driver too? Then my old scanner can still be used 🥰
@joergi yes it's just windows!
This is great! Kudos to your technical achievement (I used System Commander back in the day). Seeing this image on my TL gives me the feels.