How apple-oss-distributions/xnu works
XNU is Darwin’s hybrid kernel: Mach supplies core kernel facilities, BSD supplies system and networking interfaces, and IOKit exposes driver and hardware services. The principal workflow is a user process issuing a syscall, followed by policy evaluation, flow setup, packet processing, and delivery through a network device; syscall results return to the process. Separate branches cover bootstrapping, code-signing enforcement, interrupt and platform services, and Exclave storage upcalls. The graph combines README capabilities with sampled source; unsampled relationships are intentionally limited.
Main entry points: uipc_syscalls.c BSD System Calls · if.c Network Interfaces · necp_client.c NECP Policy · flow_manager.c Flow Manager
Components 22
Kernel Interfaces
- BSD System Calls
bsd/kern/uipc_syscalls.c - NECP Policy
bsd/net/necp_client.c
Networking
- Flow Manager
bsd/skywalk/nexus/flowswitch/flow/flow_manager.c - Skywalk Core
bsd/skywalk/core/skywalk.c - IP Stack
bsd/netinet/ip_output.c - Transport Stack
bsd/netinet/tcp_usrreq.c - Network Interfaces
bsd/net/if.c
IOKit Hardware
- Interrupt Controller
iokit/Kernel/IOInterruptController.cpp - Passthru Controller
iokit/Kernel/PassthruInterruptController.cpp - NVRAM Controller
iokit/Families/IONVRAM/IONVRAMController.cpp - RTC Controller
iokit/IOKit/rtc/IORTCController.h - Power Controller
iokit/IOKit/power/IOPwrController.h
Kernel Core
- Mach Kernel
osfmk - BSD Bootstrap
bsd/kern/bsd_init.c
Storage Security
- Exec Security
bsd/kern/kern_exec.c - Code Signing
bsd/kern/kern_codesigning.c - Storage Upcalls
osfmk/kern/exclaves_storage.c - Storage IPC
osfmk/kern/exclaves_storage.c
Other components
- User Process
- Network Device
- Platform Firmware
- Storage Exclave
Connections 17
- User Process → BSD System Calls: issues syscalls
- BSD System Calls → NECP Policy: requests policy
- NECP Policy → Flow Manager: registers flows
- Flow Manager → Skywalk Core: uses nexus
- Transport Stack → IP Stack: sends packets
- IP Stack → Network Interfaces: emits packets
- Network Interfaces → Network Device: drives device
- Network Device → Network Interfaces: delivers packets
- BSD System Calls → User Process: returns result
- BSD Bootstrap → Mach Kernel: starts kernel
- Exec Security → Code Signing: checks execution
- Platform Firmware → Passthru Controller: provides platform
- Passthru Controller → Interrupt Controller: forwards interrupts
- Network Device → Interrupt Controller: raises interrupts
- NVRAM Controller → Platform Firmware: registers storage
- Storage Exclave → Storage Upcalls: calls upcalls
- Storage Upcalls → Storage IPC: maps shared memory