
Mach Traps vs BSD System Calls on macOS
Learn how macOS routes one trap instruction to either a Mach trap or a BSD system call, how the number sign and class decide, and why you should call libSystem.
Everything you need to level up your coding skills.

Learn how macOS routes one trap instruction to either a Mach trap or a BSD system call, how the number sign and class decide, and why you should call libSystem.

Install Alire, select the gnat_arm_elf toolchain, create a crate, add a board support crate and run alr build to produce an ARM Cortex-M firmware ELF.

How Mach ports, port rights and mach_msg work on macOS 15, with a complete client and server in C using the bootstrap server, plus where XPC sits on top.

Write a build.zig that targets thumb-freestanding for a Cortex-M4, add a linker script and vector table, and produce a flashable ELF and binary with Zig 0.14.

Choose between DriverKit, system extensions and legacy kexts on macOS 15: what each runs in, what it can reach, how it installs, and a decision table.

Install TinyGo 0.37, write a Go blinky for the Raspberry Pi Pico, put the board in BOOTSEL mode and flash it with tinygo flash -target=pico.

How XNU combines Mach, a BSD layer and IOKit in one kernel: what each part owns, how a process maps to a task, and how a read call crosses all three.

Port a driver from embedded-hal 0.2 to 1.0 with exact trait changes for I2C, SPI, GPIO and delays, plus the embedded-hal-compat bridge for mixed crates.

Read kernel and driver messages on macOS 15 with log show and log stream, using predicates on process, subsystem and message text, plus time ranges and levels.

Build a TMP102 temperature driver generic over the embedded-hal 1.0 I2c trait, with typed errors, a release method and host unit tests using embedded-hal-mock.

Read macOS kernel state from Terminal with sysctl and ioreg: hardware sizes, boot time, the device registry, USB devices, and how to filter the output.

Learn the layers of embedded Rust crates, from cortex-m and the PAC through the HAL to a board support crate, with one pin toggle written at each level.
We send one email when a new post is published. No spam.