I'm really surprised VKD3D works out of the box. So many abstraction layers stacked on top of each other feel like a jenga tower on the brink of falling.
> I doubt much will be merged upstream. Many updates we have can technically
run on other OSes (%gs stubs won't be built on Linux because %gs is correctly set, SIGUSR1 will work but less optimally, etc). However I picked an approach where everything that is done for OpenBSD is just marked as OpenBSD only. I did that purely to simplify my life while I was working on it and clearly mark the changes.
> When I was talking to Wine maintainers a month ago, they were hesitant to accept even patching Wine so it compiles for OpenBSD, mostly because it's another OS they will have to support and keep operational, while the %gs stub fix is something they definitely cannot take upstream. They are very hesitant to take anything that is changing the "emulated" application code.
Yes, unfortunately OpenBSD maintainers will have to keep this running for now. NetBSD is apparently in a similar situation. Perhaps their efforts can be pooled at some point if the patches don’t diverge too much.
Well, they were always slow. But they made a stand
against AI slop, which is great. Look at how AI slop
infiltrated the ruby core team. You even get slop-spammed
down when you try to interact with e. g. Hiroshi Shibata,
who suddenly has ... perfect english language skills. A
few years ago his command over the english language was rather
weak (which is fine by the way, I much prefer broken
english from a real human than AI slop spam text as filter acting in between humans).
If you don't break the law you do indeed fall further behind people who do.
Nothing in that post is against using an LLM. It's all about copyright:
>Since every file in OpenBSD has been continually verified to ensure
correct Copyright, and we've even deleted code which has incorrect
Copyright, the chances of us accepting such new code with such a suspicious
Copyright situation is zero.
Once the current bubble pops we're going to see a lot of litigation over copyright enfringement by LLMs. Currently no one wants to rock the boat because everyone hopes to make a trillion dollars from AI, Oracle included, once they see they can't the knives are going to come out and I wouldn't want to be Linux at that point: https://en.wikipedia.org/wiki/Google_LLC_v._Oracle_America
I think it's the complete saturation of the platform with members who make it feel like HN is a platform for people to boast about how many tokens they burnt to rewrite something that already worked fine.
It polarizes people to either join the "the LLM is my god" crowd or the "if AI touches the repo, it's all slop" crowd.
The careful balance is rarely discussed, probably because that's the part that still takes work.
That has a static import from 13 hours ago. Anyone know if this wine port has its own repository somewhere else tracking the history of the development effort?
"Still uses CVS", I mean, CVS worked twenty years ago and it still works today for all the platforms OpenBSD supports. If you prefer something else, that is all right, but here is emulators/wine on CVSWeb:
They mirror to GitHub regularly, but development still happens in CVS. They are building “got” as a potential replacement that allows git-driven development while following OpenBSD’s idiosyncratic approach: https://gameoftrees.org/goals.html
My guess is they based this on the similar NetBSD port but I don’t know where the repo is.
You can download the attachment and take a look at the patches. Wine already supports FreeBSD and macOS, so it's not tooooo crazy hard to add another BSD/Unix to the pile. Looks like there's a few Unix APIs that have drifted, so the patches add some #if OpenBSD style stuff to avoid using some symbols that don't exist on OpenBSD. The gs register stuff is by far the most complex bit. IIRC that register is used for thread-local storage on Windows, but for other purposes on other OS's, so handling access from win32 binaries to the gs register is a big problem when porting to a new OS.
On the whole it looks well written to me, especially with how complex & low-level these areas of Wine are. Good work to the author. I'd encourage them to try upstreaming it if they're interested. Some of it looks a little hacky, which upstream will object to, but maybe they could get some help cleaning it up, which will avoid having to maintain a diff and result in an even better port.
There are some basic OpenBSD-isms like ucontext, stack mapping, mmap, fix trap context so rest of the %gs patching logic even knows where to work.
Rest is basically ~~two~~ three main issues
1. %gs/gsbase - we trap on %gs instructions because %gs=0 gsbase=0 so all of them illegally point at page zero. So we take the instruction, decode, turn it into %gs-less instruction, and stow it somewhere else. To do conversion we need a scratch register (now two, thanks MINGW32-GCC, you c*nt), we replace whatever gsbase should've been with our TEB pointer, and gogogo (with restore of the scratch register state {or two}). Old instruction (if wide enough) becomes jmp rel32 (I picked it because it is 5 bytes, and short jump branches are too... short). If it isn't, we are just constantly trap on that so we just create a hash between trap location and stub location. Those cases are thankfully rare.
Just this one patch gives us Notepad, Notepad++, Factorio, and many many other games
2. SIGUSR1. Basically Windows lets threads chat thru their thread API, and Electron apps (I really wanted Eve Online to work) and Chromium apps constantly chat and interrogate each other with that thread API. Wine decided to emulate some of the APIs with unix signals. Now the main issue here is that OpenBSD, does not allow one process to signal a thread in another process. So we catch it with the currently active thread, and reemit it now inside of the process as SIGUSR2. Read on SuspendThread, GetThreadContext, ReadProcessMemory, and why Mojo/Crashpad works how they work, very fun! Makes you really enjoy the security OpenBSD gives you. Another dev is making this code better and handle other SIGnals.
3. ReadProcessMemory / WriteProcessMemory (NtReadVirtualMemory / NtWriteVirtualMemory) - this is also for Electron/Chromium but mostly Steam. We only needed it majorly when we started pushing towards steam working. Steamwebhelper, steam overlay, and steam watching you play and tracking your game time, are completely against OpenBSD's security model. Wine processes are not descendants of wineserver, so wineserver cannot ptrace them unless you enable kern.global_ptrace=1. We were trying to keep kernel as stock as possible so...
2 and 3 are very much together and if you ever seen on windows how chrome looks in the Task Manager and how many chrome processes there are, well now you know my pain, haha
Now the BSDs are not so popular compared to Linux, but
I think this is great news as more eyes help here. Let's
have EVERYTHING from windows portable towards linux.
(I struggled with the 32-bit versus 64-bit stuff; this
should also be a prime goal for wine to make this a
trivial super-easy to solve thing for linux in general.
Back then when I ran into this issue, it was not trivial
to solve.)
I remember reading once how far away something like this way to work - for all the time that BSD has kept servers and networks safer than other options, it's nice to see things like WINE making it there as well.
Its hard to not think of the possibility that BSD might offer new or different advantages to keeping legacy windows applications safe until there is a willingness to adopt or develop alternatives.
Semi-related, but I was just thinking today I wonder what sort of performance improvements, if any, one could see by having one of the frontier models build a operating system from scratch that targets the subset of imports WINE uses as the standard library? Basically, build whatever syscalls (or shims) WINE and the open source vulkan drivers need and nothing more.
Probably outside the scope of what an individual could pull off on thier own in a reasonable time, but I could totally see for example Valve considering that approach for a later iteration of SteamOS.
Gameplay videos
Disco Elysium https://video.gamerstavern.online/w/qYjXr8dBauynzvEquJ7cP4
Hollow Knight https://video.gamerstavern.online/w/8tjjFRDtGJQZwxfE4ojVoC
Prey 2017 https://video.gamerstavern.online/w/vNxVThRcpijbT9FAQPcKdz
Death Stranding https://video.gamerstavern.online/w/rzz2TLCxcmneHsydukAFLU
Witcher 3 Remastered https://video.gamerstavern.online/w/oZcTRKL5JMiU4M4FqGKcNH
According to the reddit post:
AMD Ryzen 9 9900X, 16GB RAM, AMD Radeon RX 9070
I'm really surprised VKD3D works out of the box. So many abstraction layers stacked on top of each other feel like a jenga tower on the brink of falling.
Vkd3d is a PE executable, if wine works and Vulkan works then it works too, as long as the required extensions are present
It targets vulkan, so if BSD has vulkan drivers it is agnostic
Whoa, openbsd has 3d hardware drivers? Only open source i guess, no official drivers?
Yes, the upcoming OpenBSD 8.0 release will have inteldrm/radeondrm/amdgpu drivers from Linux 6.18.y/6.18.53.
https://bsd.network/@brynet/117407035545900963
5 replies →
The open source drivers are the official ones for Intel and AMD.
They port the open source Linux drivers. FreeBSD does this too. Maybe others.
Over time there can be periodic drift and out of date drivers until they re-sync, but it usually works pretty well.
OpenBSD has had hardware-accelerated 2D and OpenGL since, well, forever-ish. Just not for modern Nvidia GPUs.
[flagged]
What about the most difficult game of all, Microsoft Office?
You could try Age of Empires, its menus have the same charm.
(Its presentation is so stiff that I refused to play it - it's supposedly a very good game, but I just couldn't bear playing what felt like MS Office)
2 replies →
I would've checked it, if their Office 365... sorry... COPILOT OFFICE... wasn't such a problem to install and test. Notepad++ is enough.
2 replies →
Yeah I tried that game once it's not for me, I heard the old boss tried to EOL civilization as we know it!
Luckily(?) Office is browser based now.
2 replies →
Whoa, whoa, whoa, stop right there, Evel Knievel.
https://marc.info/?l=openbsd-ports&m=179241414029592
> I doubt much will be merged upstream. Many updates we have can technically run on other OSes (%gs stubs won't be built on Linux because %gs is correctly set, SIGUSR1 will work but less optimally, etc). However I picked an approach where everything that is done for OpenBSD is just marked as OpenBSD only. I did that purely to simplify my life while I was working on it and clearly mark the changes.
> When I was talking to Wine maintainers a month ago, they were hesitant to accept even patching Wine so it compiles for OpenBSD, mostly because it's another OS they will have to support and keep operational, while the %gs stub fix is something they definitely cannot take upstream. They are very hesitant to take anything that is changing the "emulated" application code.
Yes, unfortunately OpenBSD maintainers will have to keep this running for now. NetBSD is apparently in a similar situation. Perhaps their efforts can be pooled at some point if the patches don’t diverge too much.
Especially welcome news now that OpenBSD is shaping up to be a refuge from slopcode.
https://marc.info/?l=openbsd-tech&m=177411620801633&w=2
OpenBSD will probably fall even further behind
Yeah, they won't have a chance to rewrite cp and mv in Rust.
23 replies →
There are already OSes that include LLM code (such as Linux). It's fine to have a few that don't.
5 replies →
Yep, drivers are one of if not the biggest blocker in my experience, and that's an area AI can help immensely
8 replies →
Excellent, it will remain stable
Good.
Well, they were always slow. But they made a stand against AI slop, which is great. Look at how AI slop infiltrated the ruby core team. You even get slop-spammed down when you try to interact with e. g. Hiroshi Shibata, who suddenly has ... perfect english language skills. A few years ago his command over the english language was rather weak (which is fine by the way, I much prefer broken english from a real human than AI slop spam text as filter acting in between humans).
1 reply →
If you don't break the law you do indeed fall further behind people who do.
Nothing in that post is against using an LLM. It's all about copyright:
>Since every file in OpenBSD has been continually verified to ensure correct Copyright, and we've even deleted code which has incorrect Copyright, the chances of us accepting such new code with such a suspicious Copyright situation is zero.
Once the current bubble pops we're going to see a lot of litigation over copyright enfringement by LLMs. Currently no one wants to rock the boat because everyone hopes to make a trillion dollars from AI, Oracle included, once they see they can't the knives are going to come out and I wouldn't want to be Linux at that point: https://en.wikipedia.org/wiki/Google_LLC_v._Oracle_America
9 replies →
Wow, I honestly didn't think HN would succumb to the AI := Slop perspective.
First time I've seen := used for equality and not assignment.
1 reply →
I think it's the complete saturation of the platform with members who make it feel like HN is a platform for people to boast about how many tokens they burnt to rewrite something that already worked fine.
It polarizes people to either join the "the LLM is my god" crowd or the "if AI touches the repo, it's all slop" crowd.
The careful balance is rarely discussed, probably because that's the part that still takes work.
4 replies →
Although Theo seems to imply AI code is not welcome, this commit says Claude was used: https://github.com/openbsd/src/commit/9c2b8e445a0bdfafdd6148...
3 replies →
how do you think they made this wine port lol?
Looks to me like it was made without AI assistance. https://github.com/NethIafin/wine/tree/openbsd-master
7 replies →
Some people are actually competent and know what they're doing.
Soon like with Speedrun submissions, we will have to show ourselves livestream coding to avoid any AI usage suspicions
Do you have any evidence to support this claim?
2 replies →
I find it amusing and appropriate that the surname of the author of that message is Frohwein. "Happy wine" in German.
It's ironic that it looks like "frown"
I came here looking for your comment!
Missed opportunity to call it Port.
Probably being reserved for the OpenBrandSherryDaquiri rebranding.
I was (and partially probably still am) hoping that it will go upstream in some shape or form so I kept the original name.
I feel like there was some WINE-related thing called Port.
I OK'd this port. I apologize in advance.
2026 is finally the year of the BSD gaming desktop!
I wish every post like this had an intro section that said:
“what is {insert obscure tech thing}”
“why do people typically use {insert obscure tech thing}”
You don't know what OpenBSD or WINE is? I'm afraid that is on you.
Finally I can run Zonealarm on OBSD
Still waiting on 64-bit BonziBuddy...
Kaspersky though
OpenBSD apparently still uses CVS. I found this GitHub mirror of their ports repo which has the new wine port: https://github.com/openbsd/ports/tree/master/emulators/wine
That has a static import from 13 hours ago. Anyone know if this wine port has its own repository somewhere else tracking the history of the development effort?
"Still uses CVS", I mean, CVS worked twenty years ago and it still works today for all the platforms OpenBSD supports. If you prefer something else, that is all right, but here is emulators/wine on CVSWeb:
https://cvsweb.openbsd.org/ports/emulators/wine
In their official CVS they link to this repo: https://github.com/NethIafin/wine/tree/openbsd-master
Against my better judgement and my personal sanity, I decided to keep issues there, at least for now
They mirror to GitHub regularly, but development still happens in CVS. They are building “got” as a potential replacement that allows git-driven development while following OpenBSD’s idiosyncratic approach: https://gameoftrees.org/goals.html
My guess is they based this on the similar NetBSD port but I don’t know where the repo is.
Edit: sibling commenter found it
The GitHub mirror of the equivalent NetBSD package is here [1].
[1] https://github.com/NetBSD/pkgsrc/tree/trunk/emulators/wine
The port itself doesn't mirror the wine code. It is just the recipe on how to build in on OpenBSD + necessary patches.
I am sure this has something to do with all the PS5 jailbreak work that is massively happening recently.
Good lord this is awesome
That is awesome. I take it I can't run this with nVidia.
Nvidia support for OpenBSD is not really a thing [1]. With AMD and Intel, you have support for modern hardware in the tree [2,3].
[1]: https://man.openbsd.org/nv
[2]: https://man.openbsd.org/amdgpu
[3]: https://man.openbsd.org/intel
The irony is that this seems like the perfect kind of problem to say point an Opus 5.5 instance at.
It is verifiable and has a clear exit criteria. Functional and performance parity.
2 replies →
Out of curiosity, how much work/what sorts of openbsd-specific details must be addressed to get such a port working?
You can download the attachment and take a look at the patches. Wine already supports FreeBSD and macOS, so it's not tooooo crazy hard to add another BSD/Unix to the pile. Looks like there's a few Unix APIs that have drifted, so the patches add some #if OpenBSD style stuff to avoid using some symbols that don't exist on OpenBSD. The gs register stuff is by far the most complex bit. IIRC that register is used for thread-local storage on Windows, but for other purposes on other OS's, so handling access from win32 binaries to the gs register is a big problem when porting to a new OS.
On the whole it looks well written to me, especially with how complex & low-level these areas of Wine are. Good work to the author. I'd encourage them to try upstreaming it if they're interested. Some of it looks a little hacky, which upstream will object to, but maybe they could get some help cleaning it up, which will avoid having to maintain a diff and result in an even better port.
Edit: Oh, looks like they already talked with upstream https://marc.info/?l=openbsd-ports&m=179241414029592 It's not a huge diff to maintain, so maybe that is the better route. Great work either way.
There are some basic OpenBSD-isms like ucontext, stack mapping, mmap, fix trap context so rest of the %gs patching logic even knows where to work.
Rest is basically ~~two~~ three main issues 1. %gs/gsbase - we trap on %gs instructions because %gs=0 gsbase=0 so all of them illegally point at page zero. So we take the instruction, decode, turn it into %gs-less instruction, and stow it somewhere else. To do conversion we need a scratch register (now two, thanks MINGW32-GCC, you c*nt), we replace whatever gsbase should've been with our TEB pointer, and gogogo (with restore of the scratch register state {or two}). Old instruction (if wide enough) becomes jmp rel32 (I picked it because it is 5 bytes, and short jump branches are too... short). If it isn't, we are just constantly trap on that so we just create a hash between trap location and stub location. Those cases are thankfully rare.
Just this one patch gives us Notepad, Notepad++, Factorio, and many many other games
2. SIGUSR1. Basically Windows lets threads chat thru their thread API, and Electron apps (I really wanted Eve Online to work) and Chromium apps constantly chat and interrogate each other with that thread API. Wine decided to emulate some of the APIs with unix signals. Now the main issue here is that OpenBSD, does not allow one process to signal a thread in another process. So we catch it with the currently active thread, and reemit it now inside of the process as SIGUSR2. Read on SuspendThread, GetThreadContext, ReadProcessMemory, and why Mojo/Crashpad works how they work, very fun! Makes you really enjoy the security OpenBSD gives you. Another dev is making this code better and handle other SIGnals.
3. ReadProcessMemory / WriteProcessMemory (NtReadVirtualMemory / NtWriteVirtualMemory) - this is also for Electron/Chromium but mostly Steam. We only needed it majorly when we started pushing towards steam working. Steamwebhelper, steam overlay, and steam watching you play and tracking your game time, are completely against OpenBSD's security model. Wine processes are not descendants of wineserver, so wineserver cannot ptrace them unless you enable kern.global_ptrace=1. We were trying to keep kernel as stock as possible so...
2 and 3 are very much together and if you ever seen on windows how chrome looks in the Task Manager and how many chrome processes there are, well now you know my pain, haha
Impressive! Wonderful to see that the BSDs are getting love these days.
My first thought was this must have something to do with the development momentum around the PS5 but that apparently runs FreeBSD not OpenBSD.
Yes. More of this.
Now the BSDs are not so popular compared to Linux, but I think this is great news as more eyes help here. Let's have EVERYTHING from windows portable towards linux. (I struggled with the 32-bit versus 64-bit stuff; this should also be a prime goal for wine to make this a trivial super-easy to solve thing for linux in general. Back then when I ran into this issue, it was not trivial to solve.)
I wonder what's the state of 3D/OpenGL support on OpenBSD or if the games run into too many problems here
> And one of the great things of having a Wine port is that It just works.|
Todd Howard probably
There's been hardware-accelerated OpenGL in OpenBSD for ages.
I remember reading once how far away something like this way to work - for all the time that BSD has kept servers and networks safer than other options, it's nice to see things like WINE making it there as well.
Its hard to not think of the possibility that BSD might offer new or different advantages to keeping legacy windows applications safe until there is a willingness to adopt or develop alternatives.
This is awessome!
[dead]
Insane work!
There's even the remaster of The Witcher running! If I had money I would simply gift to those guys.
[flagged]
[flagged]
[dead]
[dead]
Semi-related, but I was just thinking today I wonder what sort of performance improvements, if any, one could see by having one of the frontier models build a operating system from scratch that targets the subset of imports WINE uses as the standard library? Basically, build whatever syscalls (or shims) WINE and the open source vulkan drivers need and nothing more.
Probably outside the scope of what an individual could pull off on thier own in a reasonable time, but I could totally see for example Valve considering that approach for a later iteration of SteamOS.