pleroma.debian.social

pleroma.debian.social

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

https://codeberg.org/hails/wsl9x

a screenshot of WSL9x running on Windows 95. Three MS-DOS prompts are open running WSL9x ptys. The focused one is running fastfetch, showing basic machine information and a nice ansi coloured penguin. Other windows show the output of ps, ls /dev, mount, uname -a, and tty.

really got this one in right under the wire before they start removing 486 support from linux

@hailey @catsalad Looks like macOS 27. Less transparency, solid UI elements.💁🏻‍♂️

@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...

@dermoth @hailey you can still use WSL1, it just requires a supported settings change. supposedly still maintained in parallel too. it's still the easiest way to get virtualbox to coexist, since it's grumpy if hyperv is around.

@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 this is too cool

@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

@uep @hailey I am going to run this in Windows 95 on a Sun PC card under Solaris 7.

@ben @uep @hailey I don't bluff.

Both the 486 and 586 variants of the SunPCI card with a whole x86 PC on an expansion card for Sun workstations

@hailey

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 wayland support when?
replies
0
announces
0
likes
2

@hailey Awesome work! Guessing my 486 is below spec but super cool!

@hailey Wow, that's a nice piece of software engineering there! Doing anything on Windows 95 is generally such a pain, I'll try it out over the long weekend on my Pentium!

@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

@fraggle @hailey there’s actually an x server for win9x that was sold as a product back then, it was called Xoftware!

@gemini0 @hailey yep there were several, exceed is the one that I used back then

I think Cygwin's Xorg port ran on 9x too but that was pretty late in its dev cycle

@hailey Hah! Reminds me of coLinux, but that was actually later on NT. https://en.wikipedia.org/wiki/Colinux

@dermoth @hailey yes, WSL2 is just a crappy VM, WSL1 is the true invention

@hailey

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

@hailey @fraggle or hand a NIC to the Linux (then you can route with SLIP or somethign to Windows)

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?

@grishka @hailey it runs the user-mode linux kernel as a Win95 thread

@hailey Amazing work, @hailey

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

@mike @ben @uep @hailey Is it me or are some of the capacitors on the top card a bit spicy? ^^;;

@hailey To be perfect, someone would have to invent DSL - DOS Subsystem for Linux.

Legacy ninja techniques are reaching high levels.

@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!!!

@lina @mike @ben @hailey Definitely not just you – the caps under the cooler look ready to pop.

@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.

@dermoth @hailey sure, but it works well enough, and for those corner cases you can still use VMs

in contrast, networking just works on WSL1 (even better than under native WS2!) and is utterly broken on WSL2, for example

@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 @hp I was just thinking that maybe having a serial port connecting both ends would seem useful. Windows also includes Hyper Terminal which could be used as a terminal emulator in that case.

In any case it'll be interesting to see further steps!!

@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

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.

https://davidgow.net/linux/i486.html

@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!

@hailey

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.

@hailey brace yourself, it just popped up on back in the day that was better than a DDoS