Deep Dive: Tracing the `write()` System Call in OpenBSD

2025-03-29

This article delves into the low-level implementation of the `write()` system call in OpenBSD. Starting from the user-space `write()` call, it traces the data's journey through the kernel, detailing the complete path from system call to data written to an NVMe hard drive. The article reveals a chain of kernel function calls, including `mi_syscall`, `sys_write`, `dofilewritev`, `vn_write`, `ffs_write`, `uiomove`, `bdwrite`, `syncer`, `bwrite`, `ufs_strategy`, `spec_strategy`, `sdstrategy`, and finally the NVMe driver. It illustrates data transformation and transmission across different abstraction layers, highlighting key technical details such as caching mechanisms and DMA transfers.

Read more
Development System Call