COMPAT_BSDOS(8)
π
okay so first things first β compat_bsdos is the manual page for binary compatibility for BSDi releases π¦
Like, it lives in the System Manager's Manual section 8, bestie. Sit down, grab a strawberry drink π, and let's get into it.
β¨ NAME β¨
compat_bsdos β binary compatibility for BSDi releases π
(it's literally just that. the whole vibe. old BSDi programs, running on your NetBSD. iconic.)
πΈ DESCRIPTION πΈ
Okay so here's the tea β: the COMPAT_NOMID kernel option includes compatibility with BSDi 1.xβ3.x a.out(5) binaries on NetBSD/i386 and NetBSD/amd64. Periodt.
On i386 this option is enabled by default in the GENERIC kernel β slay, no work needed π. But on amd64 you gotta set it yourself, along with EXEC_AOUT. Both. Not one. Both. π
Null memory protection must be disabled with the sysctl(7) option vm.user_va0_disable set to 0 for the binaries to run successfully. Yes, actually set it to 0. Otherwise, no vibes, no execution, just sadness π.
BSD/OS binaries may be placed under /emul directory to match the location of other non-native executables on NetBSD β cute, organized, we love a tidy filesystem π. But the compatibility environment does not automatically lookup libraries under /emul/bsdos as happens with the shared libraries for NetBSD 1.0β1.5 a.out(5) binaries under /emul/aout. So likeβ¦ don't assume the magic lookup works here, because it does not, and that's the whole point of the sentence. π«Ά
BSD/386 1.0β1.1 uses static binaries that do not dynamically load libraries at runtime. Simple. Low maintenance. Respect honestly π.
BSD/OS 2.0 introduced "static shared libraries" as the default for standard binaries. (Yeah, the name is a whole contradiction, don't @ me, that's just what it's called.) The shared libraries are compiled from /lib and /usr/lib to a custom format bound to memory loading addresses for each library under /shlib. It's giving hardcoded main character energy π₯.
BiG caveat bestie: BSDi libraries under /shlib are not in the standard ar(5) or position-independent shared object formats and cannot be loaded by ldconfig(8) on NetBSD. Not a skill issue, it literally can't. π
So in order for BSDi executables to access the objects at the hardcoded /shlib path, the user may setup a symbolic link from /shlib to /emul/bsdos/shlib. That's the trick. That's the whole trick. Write it down π.
And BSD/OS 4.0 switched to an ELF binary executable format that does not run under the compatibility layers currently available on NetBSD. So likeβ¦ if you were hoping, no. π ββοΈ
π SEE ALSO π
Go read these, they're all linked in the group chat:
ld.aout_so(1)options(4)a.out(5)elf(5)sysctl(7)compat_netbsd32(8)ldconfig(8)
π§ HISTORY π§
A little lore drop, because the backstory ate π:
- BSD/386 1.0β1.1 was derived from 4.3BSD Reno code in the Net/2 release.
- BSD/OS 2.0 was based on 4.4BSD Lite, but added the new static shared library format as the runtime default for executables. The build system included the
shlicccommand with the-Bstaticflag that allowed reverting to the standard library archive format that remained available under/liband/usr/lib. So there was an escape hatch, bestie πͺβ¨. - NetBSD 1.0 added shared libraries using a standard position-independent shared object format. The previous default relocatable libraries in the traditional
ar(5)format remained available. Nothing was taken from us, we just got more π . - OpenBSD 2.2β4.7 included a different compatibility implementation under the
COMPAT_BSDOSkernel option. Different. Not the same one. Don't mix them up or it's gonna be awkward π¬.
π BUGS π
Okay the messy part, gather round π:
- BSD/OS compatibility was broken on NetBSD 5β6. Justβ¦ broken. That's it. That's the bug. π
- BSD/OS 3.0 added SPARC support, but the binaries are incorrectly recognized as SunOS executables and fail on
NetBSD/sparcandNetBSD/sparc64. Identity crisis fr fr π β they think they're SunOS and then everything falls apart.
ngl the whole thing is a vibe check on ancient binary formats and some of them are absolutely not passing π but now you know every last detail, bestie, so go forth and slay π«Άπ
β¨ and that's the page! β¨ this Debian-flavored edition was dated August 27, 2020 β mwah, go read the real thing if you need to cite it ππ
π¦ where this page comes from
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c) 2020 The NetBSD Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms