Emulating x86 on X64 on Aarch64
neugierig.org
neugierig.org
A little note about section "Wine's implementation": the implementation described in Ken's email was never really used in Wine, intentionally (in vanilla Wine that kind of hack is not accepted). It has been used for a few years in CrossOver, CodeWeavers' fork of Wine (more recently also used by Apple for its Gaming Toolkit). Wine is currently moving towards supporting x86-on-ARM emulation properly by better separating the guest and host code, in a manner similar to how Windows itself does the same thing.
EDIT: Another quick thought: in the project readme you mention the observation that "win32 is the stable Linux userland ABI". The origin of that remark might have been this blog post by Arek Hiler: https://blog.hiler.eu/win32-the-only-stable-abi/.
I think the general sentiment has been around for much longer, but it’s very well put. For instance old Loki Linux ports became useless after only a few years, but you could then run the Windows game in Wine no problem.
https://www.applegamingwiki.com/wiki/Game_Porting_Toolkit
and this thread (talking about installing 32 bit with wine64):
https://www.reddit.com/r/macgaming/comments/15l0onw/dark_and...
it's for a specific video game, but very similar (using wine)
But indeed, this is fairly novel. It's about running 32 bit i386 binaries in long mode (yeah, on a mac/Rosetta) via setting the compatibility/word-size bits in the code segment using an LDT.
FWIW, from the article:
> (PS: I love how the "base" address is chopped up into pieces and sprinkled into random seeming places. I believe it's because the format of this data was itself evolved over time across processor versions.)
Sort of. The descriptor table was added in the 286 which only had 16 bit registers. The segment base/limit fields there were natural and clean. The 386 needed to squeeze in the top bits somewhere without otherwise wasting memory or breaking compatibility.
This was originally true and (theoretically) some executables might actually expect <2GB addresses and break if given unexpected pointers but eventually that restriction was lifted to allow more than 2GB per process. Windows executables can opt into the full 32-bit address space using the large address aware flag [0] but for an compatibility layer like Wine it makes sense to be able to override it and use the full address space even for executables that don't have the flag set because the emulation and/or OS/driver differences can increase the virtual memory usage compared to Windows. Or some executables don't have it set but need it when working with large enough data - this is often the case with heavily modded 32-bit games. Hence Proton's PROTON_FORCE_LARGE_ADDRESS_AWARE override.
[0] https://learn.microsoft.com/en-us/cpp/build/reference/largea...
That way it can be emulation all the way down, and you get binary compatibility forever with minimal ongoing engineering cost. The performance would be atrocious if not for the fact computers today are faster than 1980's computers so it really doesn't matter.
It also means more users using more emulated binaries more frequently, which can make the hardware’s battery life and performance seem worse than they actually are, especially to less technically inclined users who don’t know the details but notice their laptop dying a lot faster than it should.
If they don't really care, they're going to put the minimum possible effort on a separate 64 bit version too and it'll be just as inefficient anyways, except with no backwards compatibility.
Meanwhile I imagine most of the software people might want to run is 64-bit x86 anyway; 32-bit x86 is these days really only a thing you care about for old games, which is pretty esoteric. If Wine can be made to support it then that keeps the support load limited to Wine.
https://learn.microsoft.com/en-us/windows-hardware/drivers/d...
There's even a guide from Intel that uses the term x64:
https://www.intel.com/content/dam/develop/external/us/en/doc...
It's probably the clearest term to use when you're talking specifically about Windows binaries (PE files).
(Source: someone who was there when it happened who then told me over beer.)
devenv.com Everything.sln /Build "Debug|Win32"
devenv.com Everything.sln /Build "Debug|x64"Digital was earlier to market the Alpha as a 64 bit ISA than either Intel's Itanium ( IA-64) or AMD's x86-64 which is also called AMD64 [1]
(you didn't know? https://wiki.debian.org/X32Port)
The original name was x86-64. Quoting myself (https://news.ycombinator.com/item?id=36075840):
> I still shake my head at how they were able to successfully rebrand it from amd64 to x86-64
It's the opposite: the original name was x86-64, and amd64 is a later rebranding. See, for instance, the original web site for this (then) new architecture: https://web.archive.org/web/20000829042251/http://www.x86-64...
Date stamp is part of the metadata passed into the generator, according to https://neugierig.org/software/blog/2022/10/blog-software.ht..., but I don't see anywhere that the Go code checks whether a post's date is in the future. Did you intend to add a post-scheduling feature but haven't gotten to it?