'I think this might be one of my greatest hacks of all time,' says dev behind unholy abomination
The Windows Subsystem for Linux is an invaluable tool, but anyone wanting to run it on a Windows 9x system would find themselves out of luck until now.
A self-described computer tinkerer and hacker calling herself Hailey presented what she called "one of my greatest hacks of all time" in a Mastodon post on Wednesday: The Windows 9x Subsystem for Linux, or WSL9x.
According to Hailey's upload on Codeberg, WSL9x runs the 6.19 Linux kernel cooperatively within Windows 9x, allowing users to interact with it just like they would a WSL instance in a modern Windows system.
Minus the GUI, naturally - if you're dead-set on running Linux in Windows 95, you're going to have to use the terminal like a grown-up.
Sorry.
The question of why one would want to do this came to mind quite quickly; we contacted Hailey to learn why she undertook this rather niche project, but didn't hear back before publication.
Luckily for us, Hailey did explain the how on Codeberg.
According to the WSL9x readme, the system is made up of three components: a Linux kernel patched to call Windows 9x APIs instead of POSIX ones, a VxD (virtual device) driver, and a WSL client itself.
The VxD driver does a lot of the heavy lifting and is responsible for initializing WSL9x as well as handling userspace events that have to be relayed to the kernel (i.e., page faults and syscalls), which it does in a rather interesting way due to limitations in the Win9x architecture.
"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," which is the i386 syscall interrupt for Linux, Hailey explained.
The GPF handler in WSL9x keeps an eye on faulting instructions, and when it sees int 0x80 pop up, it "advances the instruction pointer as if the interrupt succeeded and dispatches as a syscall to Linux," Hailey continued.
As for the client itself, Hailey describes it as nothing but a small 16-bit DOS program that exists to allow WSL9x to pass DOS prompts to the Linux kernel as TTY instead of a fully-fledged custom client.
Be warned, however: Per Hailey's own comments on a Hacker News thread , the Linux kernel ends up with the same ring 0 CPU privileges that the Windows kernel gets when WSL9x is running.
Not only does that mean security issues may result, but things might get a bit unstable, too.
"They are supposed to cooperate, but if either crashes then both go down," Hailey said in the thread.
If you simply refuse to (or can't because of some ancient-but-necessary application running in a server room somewhere) get rid of that ancient Windows 95, 98, or ME machine that you're still using, and need to get a Linux kernel running on it, Hailey provides instructions on her Codeberg page for the project.
®
Related Stories
Source: This article was originally published by The Register
Read Full Original Article →
Comments (0)
No comments yet. Be the first to comment!
Leave a Comment