Skip to content

Glossary

BSD (in XNU)

The FreeBSD-derived upper half of XNU that implements processes, file descriptors, VFS, sockets, and POSIX system calls.

The BSD layer is XNU's POSIX personality. Forked from FreeBSD in the late 1990s and carried forward selectively since, it provides everything a Unix application would expect:

  • struct proc — the BSD process.
  • File descriptors and VFS — open, read, write, stat, kqueue.
  • Signals — kill, sigaction, pthread_kill.
  • Sockets and protocol stacks — TCP, UDP, IPv6.

The BSD layer's source lives under bsd/ in the XNU tree.

apple-oss-distributions/xnubsd/kern/init_main.cbsdinit_task — the first BSD process. Boots the POSIX side of the kernel.View on GitHub(line ) apple-oss-distributions/xnubsd/sys/proc_internal.hstruct proc — note the `task` pointer back to Mach.View on GitHub(line )

BSD here is not a complete operating system: it has no scheduler, no VM, no IPC of its own. Those are all Mach. A BSD process is a wrapper around a Mach task; a BSD thread wraps a Mach thread; every mmap ends up in vm_map_enter.

See also: XNU, Mach, task.