HN
Today

Running Windows Games on a Hobby OS with Wine

A developer successfully ports Wine to their hobby OS, Astral, enabling it to run a variety of Windows games. This impressive feat showcases the technical challenges and triumphs involved in bringing complex Windows applications to a custom operating system. It's a deep dive into OS internals, Wine's architecture, and the intricacies of 32-bit compatibility on a 64-bit platform, resonating strongly with HN's audience interested in low-level systems programming.

16
Score
4
Comments
#5
Highest Rank
3h
on Front Page
First Seen
Jun 24, 3:00 PM
Last Seen
Jun 24, 5:00 PM
Rank Over Time
8510

The Lowdown

The author details the ambitious journey of porting Wine to Astral, a hobby operating system, with the ultimate goal of running Windows games. This endeavor follows previous successes like running Minecraft and Factorio, but addresses the challenge of closed-source Windows-specific titles by leveraging Wine's compatibility layer.

  • The primary motivation was to run "Cogmind," a 32-bit Windows roguelike, necessitating a complete Wine port capable of handling 32-bit executables.
  • Initial steps involved enabling MinGW in the Wine build to achieve basic functionality, such as a working notepad.exe.
  • A significant hurdle was achieving OpenGL support via libEGL.so, which required switching Mesa to the DRI backend and patching it to allow the X.org server to start without /dev/dri, successfully enabling games like Deltarune.
  • To run 32-bit applications like Cogmind on the 64-bit Astral, the author implemented Wine's WoW64 mode, primarily by adding LDT (Local Descriptor Table) support in the kernel and fixing Wine's signal/syscall handling.
  • A subtle bug preventing Cogmind's scoresheet upload was traced back to a missing register save in Wine's __wine_unix_call_dispatcher, a fix that resolved the issue and highlighted the complexity of Wine's PE-to-Unix transition.
  • Testing revealed varying degrees of success with other applications: FTL ran perfectly, while Steam, Factorio, and others had partial functionality or were completely broken due to various underlying issues like DRM or missing implementations.

This project proved that hobby OSes can indeed run a broader range of games than previously thought, offering valuable insights into Wine's internal workings and low-level OS development. The author plans to focus on optimizations, new drivers, and getting Steam and Chromium fully functional on Astral.