You can now run WSL on Windows 95, in case you’re crazy, too

The Windows Subsystem for Linux has long been a cherished asset for developers, but those clinging to the nostalgia of Windows 9x systems found themselves at a frustrating impasse—until now. A self-proclaimed computer enthusiast, known as Hailey, recently unveiled what she describes as “one of my greatest hacks of all time” in a post on Mastodon: the Windows 9x Subsystem for Linux, or WSL9x.

How WSL9x Works

Hailey’s project, detailed on Codeberg, enables the 6.19 Linux kernel to operate seamlessly within the confines of Windows 9x, allowing users to engage with it much like they would with a WSL instance on contemporary Windows systems. However, users should be prepared to forgo the graphical user interface; those determined to run Linux on Windows 95 will need to embrace the terminal experience.

Curiosity naturally arises regarding the motivation behind such a niche endeavor. While Hailey did not respond to our inquiries before publication, she generously shared the technical intricacies of her creation on Codeberg.

The architecture of WSL9x comprises three core components: a Linux kernel modified to interact with Windows 9x APIs rather than POSIX, a virtual device (VxD) driver, and the WSL client itself. The VxD driver plays a pivotal role, initializing WSL9x and managing userspace events that must be communicated to the kernel, such as page faults and system calls. This process is particularly fascinating given the constraints of the Win9x architecture.

Hailey elaborated, stating, “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 corresponds to the i386 syscall interrupt for Linux. The GPF handler in WSL9x monitors for faulting instructions, and upon detecting int 0x80, it “advances the instruction pointer as if the interrupt succeeded and dispatches as a syscall to Linux.”

As for the client component, Hailey describes it as a simple 16-bit DOS program designed to facilitate the passing of DOS prompts to the Linux kernel as TTY, rather than employing a fully developed custom client. However, caution is advised: according to Hailey’s comments on a Hacker News thread, the Linux kernel operates with the same ring 0 CPU privileges as the Windows kernel while WSL9x is active. This arrangement raises potential security concerns and could lead to instability.

Hailey noted, “They are supposed to cooperate, but if either crashes, then both go down,” highlighting the delicate balance between the two systems.

For those who find themselves unable—or unwilling—to part with their vintage Windows 95, 98, or ME machines, yet require a Linux kernel to run alongside, Hailey has provided comprehensive instructions on her Codeberg page for those eager to embark on this retro computing adventure.

Winsage
You can now run WSL on Windows 95, in case you're crazy, too