BSD on Windows: Things I wish I knew existed
virtuallyfun.com
virtuallyfun.com
I had to use it in the past and it’s genuinely awful. MobaXterm was the best before WSL (imo)
SFU was so much later to the game, while BOW ran on Windows 3.1 which would have been great had it had far bigger appeal as you could just run it on such lesser machines. The best part being no formatting, no device drivers, or changes to the OS at all. I just copied over to my PS/2, and was playing hack 1.03 in no time.
[1] Well, Microsoft published it, but IIRC, another company developed it.
I always wanted a distribution of Windows that booted character mode and ran the Interix userland.
Microsoft bought and extinguished the largest one: https://en.wikipedia.org/wiki/Interix
The 2022 Extended Security Updates for Windows 7 were maintained until 2023:
> Windows 7 Extended Security Updates 2022: January 12, 2022 - January 10, 2023
[1] https://learn.microsoft.com/en-us/troubleshoot/windows-clien...
If Microsoft could tell the future, they would have improved POSIX, instead of killing it, and then briging a Linux VM into the OS.
If not for that MSN vs Internet fiasco, they would succeed.
Also as seen nowadays by many FAANG efforts, "do no evil" marketing stunts, Playstation and Nintendo with their exclusive deals, they are not alone in the desire to achieve that goal.
Ironically, while UNIX won the server room, the Linux wars replacing the UNIX wars, is kind of what killed the desktop for most consumers, now enjoying the Linux kernel via Android, ChromeOS, and the free beer version of them, versus what OEMs make available isn't the same anyway.
Or one pays what is seen as the Apple tax in countries where wages aren't at the same level as North America.
So the non-desktop part was lost by Microsoft, and this resulted in the world we have now, Linux derivatives and all. But for a while, sometime around 1996-2006, it definitely felt like they almost had it. This is when I began my official dev career and that summer I could barely find a non-MS stack shop.
And yes, the OSS movement didn't manage to unify the desktop. And Microsoft has nothing to do with it.
I still like the landscape much better.
- This is what POSIX was meant to address; there aren't all that many Linux-specific APIs that ordinary applications actually need. Proof: browse the ports/packages on any BSD; all the apps (with extremely few notable omissions) are there and working fine.
- Vocal FOSS enthusiasts are ready, every day of the week, to preach to you about open standards; you must use Jitsi and not Zoom, Matrix and not WhatsApp, heck I've been told to play Mindustry instead of Factorio. I don't know if these are the same people who write "#ifdef linux" in their code, but I've sent out enough one-line patches to fix the build on OpenBSD to wonder.
- The Linux userland is one hell of a horror, in terms of being a viable target for others to aim at; try running literally any precompiled binary on Alpine or Void(musl) to get a feel. The glibc seems to be introducing new versioned symbols and other backward incompatible changes every release - just for the sake of it; and many open source libraries resist static linking with every inch of their autohell existence. (I've tried making a static build of Love2d for Linux, and it was an exercise in futility.)
Yeah guys, unless you're writing a container runtime, please stop targeting Linux. You don't need to strictly adhere to POSIX, just please at least try to compile your program in a VM with any BSD; it will flush out 99% of the non-portable stuff.
In order to run binaries compiled for a specific OS, you need to emulate that OS's (i.e. kernel's) ABI. There's no way around that.
The only way to achieve true binary compatibility would be to use a system-level virtual machine, ala Inferno [0] or PhantomOS [1].
- win32/wine;
- Linux emulation - the kernel itself has an incredibly stable interface, but you basically need to ship an entire RHEL/Ubuntu installation on top.
My sincere hope is that APE/Cosmopolitan takes off and eats everyone's lunch AND the table. It even recently got some funding - turns out it's the easiest way to ship LLM models (finally something good may come out of this hype cycle).
JVM is doing quite alright across desktop, servers, embedded and 80% of mobile phones.
.NET less so due to Microsoft's strategy error to bind it to Windows. Still nowadays my .NET workflow is exactly like my Java one.
Work on Windows, deploy where needed.
I don't think in POSIX since 2006.
Just grep your kernel's Kconfig for "ancient" -- the euphemism every developer uses to refer to stuff they don't care about and want to break.
Also, stuff in /proc, /sys, or the like is moving every other day, and some programs depend on it (sigh).
It's insane in 2023 that people are typing things like EPOLL_ONESHOT and it's actually the best option.
Linux is today the kernel/operating system with the largest hardware support, but my ability to actually use the operating system I want with the hardware I want has moved nilch. The next free operating system which even supports my AMD GPU? It's FreeBSD, and they do that by linking in the code from Linux (not even forking: forking would be way too much effort). There is _no_ other OS which supports it.
Also, you can forget about DRM support anywhere other than Linux. Netflix? Linux-only.
It's a very sad picture and much definitely worse than 10-20 years ago.
Am curious to see what it does to avoid a static build.
I really, really wanted to ship binary builds for the three major platforms: Windows, Mac, and Linux; so that my friends and strangers could actually play the games, without dicking around downloading some framework. Love2d uses the relatively well-known hack of opening "argv[0]" as a ZIP file (the ZIP header starts at the end of a file, so this usually[0] just works).
Creating and testing the builds for Windows was trivial - even though I didn't even have Windows on any of my computers; I borrowed a friend's laptop to verify that "cat love.exe game.love > game.exe" just works, and indeed it did. They got some scary warnings about binaries downloaded from the Internet, but the game ran well.
The Mac needed a bit more fiddling, and I didn't have a Mac back then to sign or test the build. But I followed the instructions and someone reported success (modulo scary warnings). Woohoo.
On to Linux... I already knew it was going to be the most "fun", despite being the only platform among these three that didn't do code signing or scary warnings. I didn't even realize at the time, how much of a clusterfuck glibc actually is; my primary motivation was that Love2d kept breaking their Lua APIs, and I've already found that lots of older (and even recent) Love2d games simply couldn't cope. My game had to be bound to a specific version of Love2d, and many distributions shipped different versions, so the only reasonable path forward was to bundle, just like on Windows/Mac.
I started by downloading the Love2d sources, verifying that I can make a standard/dynamic build, and then "cat love game.love > game && chmod +x game && ./game". Indeed that was easy, but "ldd game" revealed several dozen shared libraries for things like PNG, Vorbis, etc, etc. I've looked at the .so numbers, and realized Love2d breaking is gonna be the lesser of my worries - judging by how high these numbers were, I was signing up for DLL hell. I didn't even want PNG or Vorbis - all of my graphics were 100% procedural, and I was yet to try adding sound to any game. So I've disabled most options, and this is where the easy part ended.
I don't recall where exactly I gave up... I managed to find & download the sources for a whole bunch of these libraries, make the ".a" archives for static builds, and so on... I think at some point I've ran into Mesa (Love2d actually requires GPU acceleration) and decided that this is enough insanity.
I still firmly believe in static linking on Linux! I only changed my approach: just use Go (with CGO_ENABLED=0). Unfortunately, Go is not without its own share of problems[0]; while XGB allows cgo-less X11, Mesa remains elusive.
[0]: https://flak.tedunangst.com/post/the-three-line-single-binar...
Coming from PICO-8 myself, I'm wondering if I should just skip the frameworks to babystep and just jump into C+SDL, or pygame or something. I like the different ways that games can be made -- like your procedural graphics not needing a graphics library.
I'm torn between "all of this stuff belongs in the kernel goddammit" and "these guys probably know better". OpenBSD and macOS actually force all syscalls to go through a dynamically linked libc, so perhaps it's the latter.
Libraries/frameworks/engines such as PICO-8, Love2d, SDL, Allegro, Pygame, Godot, etc exist precisely to abstract away these details; you're not meant to care for libGL.so.1, you're meant to care for fixing your physics engine's timestep and using cubic splines to interpolate animation. Love2d was not a mature choice in 2016, so don't take my horror story or my hubris as any indication of what it looks like today; do your own research and pick the tool for the job ;)
TBH I would love to go back to making games, but recently got too absorbed by StarCraft 2 and shitposting.
Most of my past interactions with LD_PRELOAD caused some trouble down the line. It likes to leak into unexpected places, sowing discord and heisenbugs. I'd rather never touch it again unless out of other options.
edit. oh yeah, line endings. that sucked. that said, nt had way better multithreading support.
It's a not great / not terrible kernel, like most are (Linux included)
I prefer Linux, but performance is not my main grief about Windows.
In what universe other than maybe some banks was that the case? 1995 was the era of the commercial UNIX workstation.
Just about everything now is it's own garden with a tiny API gate to allow you access to the minor features of the whole collection.
I am aware of WSL and the likes but, it's taken many years to get that far.
So cosmopolitan? https://github.com/jart/cosmopolitan
I agree with your idealism, but I think the best we're going to get is more or less what we have now, otherwise we end up in the space where program x works with o/s y version z subsystem q, but not the other combinations you'd hope for.
I'm still annoyed that we don't design enough for the future that when a new O/S version/architecture gets released there isn't more effort to save the past. We have a perfectly serviceable relatively recent printer (4-5 years old?) that my wife now can't use because her new Mac which replaced her 12 year old mac, now doesn't have a driver for it, because there are no Sonoma versions of it.
I think we err on the wrong side of creating waste at the expense of not doing (admittedly annoying) work.
To get back on topic, this was the point of subsytems - you managed to hold onto and get access to the past you liked from within your walled garden.
https://virtuallyfun.com/2023/12/12/cross-compiling-to-bsd-o...
It's far more cooler being able to run on Windows 3.1
BOW's only weakness is its single user mode, more so a limitation of being a Win16. If it'd been pushed harder to a NT service/client/server DLL it'd have been a much bigger player.
It's all moot, Pink/taligent died, Virtual Machines is where everyone runs their stuff these days, OS/2 had the driver/disk/filesystem stuff done right.
I don't want to derail the conversation too much but when I look at what Notch has become since he became a billionaire it's frankly pathetic.
Princes & Kings
Isn't it strange how princes and kings, and clowns that caper in sawdust rings, and common people, like you and me, are builders for eternity?
Each is given a list of rules; a shapeless mass; a bag of tools. And each must fashion, ere life is flown, A stumbling block, or a Stepping-Stone. ― R. Lee Sharpe
My critique of Notch is that he doesn't do cool stuff anymore.
Stuff like that weird space game that he was talking about making, or something like BSD on windows.
I dunno why you'd be sore about it, the guy already paid his dues? Again though, bot familiar eith what he goes around promising.
https://news.ycombinator.com/item?id=38581362
@dang, candidate for merging?
https://archive.org/details/apache131_for_BOW
It's really cool how BOW can totally use winsock, and bridge that gap of Unix networking tools on Windows 3.1