AOUT(4)
πΎ AOUT(4) πΎ
okay bestie, gather round, because we're talking about aout β kernel support for executing binary files in the legacy a.out format β¨ this is the manual page for it, from the Kernel Interfaces Manual, and yes it's giving vintage but we love her π
β¨ SYNOPSIS β¨
kldload a.out
π¦ DESCRIPTION π¦
so the a.out(5) executable format is old old. like, it was the whole thing before the release of FreeBSD 3.0 π and since i386 was literally the only supported architecture back then, a.out(5) executables can only be activated on platforms that support execution of i386 code β think i386 and amd64 π«Ά
to add kernel support for old syscalls and old syscall invocation methods, you gotta put these options in the kernel configuration file:
options COMPAT_43
options COMPAT_FREEBSD32
heads up: the COMPAT_FREEBSD32 option is only required on 64-bit CPU architectures π
and the aout.ko module needs to be loaded with the kldload(8) utility in order to support the a.out(5) image activator:
kldload aout
alternatively, if you want the module to load at boot time instead (main character energy, honestly), drop this line into loader.conf(5):
aout_load="YES"
okay so here's the tea β the a.out(5) format was mainstream quite a long time ago. and the reasonable default settings + security requirements of modern operating systems today contradict the default environment of that time π so you'll need to make adjustments to your system to mimic the natural environment for those old binaries. it's giving time capsule.
the following sysctl(8) tunables are useful for exactly this:
security.bsd.map_at_zeroβ set to1to allow mapping of process pages at address0. some very old ZMAGIC executable images require text mapping at address0. no cap π₯kern.pid_maxβ old versions of FreeBSD used a signed 16-bit type forpid_t. current kernels use a 32-bit type forpid_t, and allow process id's up to99999. those values cannot be represented by the oldpid_t, which mostly causes issues for processes usingwait(2)syscalls β for example, shells π set the sysctl to30000to work around the problem.kern.elf32.read_execβ set to1to force any accessible memory mapping performed by a 32-bit process to allow execution, seemmap(2). oldi386CPUs did not have a bit in PTE which disallowed execution from the page, so a lot of old programs didn't specifyPROT_EXECeven for mapping of executable code π³ the sysctl forcesPROT_EXECif the mapping has any access allowed at all. this setting is only needed if the host architecture allows non-executable mappings.
π SEE ALSO π
execve(2), a.out(5), elf(5), sysctl(8)
π HISTORY π
the a.out(5) executable format was used on ancient AT&T UNIX and served as the main executable format for FreeBSD from the very beginning up to FreeBSD 2.2.9 β and then in FreeBSD 3.0 it was superseded by elf(5). era ended, we move π
π«Ά AUTHORS π«Ά
the aout manual page was written by Konstantin Belousov <kib@FreeBSD.org> π
π BUGS π
on 64bit architectures, not all wrappers for older syscalls are implemented. so like, not everything's gonna work, bestie, fair warning π
and that's the whole page, mwah π this one came to us by way of Debian, dated August 14, 2012, and it lives under AOUT(4) β okay love you, bye πβ¨
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2012 Konstantin Belousov <kib@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms