Skip to content

Glossary

Mach

The microkernel core of XNU. Originated at CMU in the 1980s; provides tasks, threads, ports, messages, and virtual memory.

Mach is the lowest layer of XNU. Originally developed at Carnegie Mellon (Rick Rashid, 1986) and adopted by NeXTSTEP, it provides the kernel's most fundamental abstractions:

  • Tasks — owners of address space and ports.
  • Threads — execution contexts within a task.
  • Ports — kernel-owned message queues, addressed by capability.
  • Messages — typed data and rights transferred between tasks.
  • Virtual memoryvm_map and pmap, the address-space machinery.

In XNU, Mach lives under osfmk/ (OSF Mach Kernel — a hint about Mach's lineage through the Open Software Foundation).

apple-oss-distributions/xnuosfmk/kern/task.hThe task structure — the kernel's root object for everything else.View on GitHub(line ) apple-oss-distributions/xnuosfmk/ipc/ipc_port.hThe Mach port — the IPC primitive every higher layer is built on.View on GitHub(line )

Despite the "microkernel" label, XNU's Mach runs in the same address space as the BSD code and IOKit — it's a microkernel architecturally, not at runtime. The trade was made very early in NeXTSTEP's life for performance reasons.

See also: Mach port, task, pmap.