i386 transition to usermode-only architecture

The page gathers information regarding transition of i386 architecture, AKA 32bit x86, to user-mode only component of the FreeBSD OS. The architecture would keep allowing to execute existing 32bit x86 binaries, coming back to FreeBSD 1.1, on the modern x86_64 host. On the other hand, and this is the main subject of the page, no native 32bit kernel is provided.

The motivation for the transition is the existence of the significant amount of the old applications (binaries) which are either still useful as is, or provide enough historical interest, to justify the efforts to allow the functionality.

The following components are identified as needed to keep the i386 architecture usermode.

Base system

Kernel support for executing i386 binaries on amd64

machine/ headers

mostly unified to x86/ already

srcmgr@

a.out support

module exists for amd64

srcmgr@

IDT/LDT hacks

allow the syscalls entry points, enabled by option

srcmgr@

32bit vdso

signal trampoline

srcmgr@

compat32 layer for syscalls

useful for other host arches too

srcmgr@

This highly depends on the corresponding hardware features allowing long mode to create 32bit segments and execute in protected mode. Some possible hardware development, like (cancelled in its present form) X86S, drop that.

userspace C runtime support

rtld-elf/i386

requires libsys and libc, is needed for ld-elf32.so.1 on host

srcmgr@

libsys/i386, libc/i386

srcmgr@

libthr/arch/i386

srcmgr@

msun

srcmgr@

Build infrastructure and toolchains

lib32 build infra

useful for other host arches and ABIs too

srcmgr@

compiler and linker support for i386 target

depends on upstream, which is fine with i386 so far (both llvm and gcc/binutils/gdb)

srcmgr@

buildworld

srcmgr@

pkgbase

set of packages for i386 world

pkgbase@

Ports

ports/Mk/ recognition of the architecture

portmgr@

individual support for i386 in each port

per-port decision

port maintainer

(semi-) official package sets provided for i386

most likely not

pkgbuilder@

Ports build requires either the current way (i386 jail) or adding support for cross-compilers (cc -m32). The later is somewhat simpler than the full cross build, since target can be executed on the host directly, but still is non-trivial and is probably too much efforts for i386.

Another useful ports feature would be an ability to co-locate several localbases on one host. This requires either putting pkgdb into localbase, or, for global pkgdb, record the localbase of installed packages.

I386UserModeOnly (last edited 2025-02-07T01:38:47+0000 by MarkLinimon)