
Isolate the Filesystem with Mount Namespaces and pivot_root
Give a process its own root filesystem using CLONE_NEWNS, a private mount propagation and the pivot_root system call on Linux 6.12, with a complete C program.
Tag
255 posts

Give a process its own root filesystem using CLONE_NEWNS, a private mount propagation and the pivot_root system call on Linux 6.12, with a complete C program.

Map a PCI BAR on Linux 6.12 with pci_iomap, read and write device registers with ioread32 and iowrite32, check sizes first and avoid the posted-write trap.

Write a minimal Linux 6.12 PCI driver with a pci_device_id table, probe and remove, pci_enable_device, region claiming, bus mastering and the error unwinding.

Start a process that sees itself as PID 1 using clone with CLONE_NEWPID or unshare plus fork on Linux 6.12, and learn why unshare never moves the caller.

How PCI Express links train, how configuration space and BARs describe a device, and how Linux 6.12 turns that into memory the driver can map and use.

Use avr-libc set_sleep_mode, sleep_enable and sleep_cpu to power down an ATmega328P and wake on a pin change interrupt, with the race-free sequence.

Move UART bytes from an interrupt to a task with a FreeRTOS stream buffer: trigger level, ISR send, blocking receive and the single-writer rule.

Decide between libusb in user space and a Linux 6.12 kernel USB driver by latency, device class, security, deployment and what else needs to see the device.

Cut RP2040 current by gating unused clocks with the CLOCKS sleep-enable registers and entering dormant mode, then wake on a GPIO edge with pico-extras.

Send vendor and standard USB control requests from a Linux 6.12 driver with usb_control_msg and the safer usb_control_msg_recv and usb_control_msg_send helpers.

Move large buffers between FreeRTOS tasks and ISRs without copying them: a fixed buffer pool, a queue of small descriptors and a strict one-owner rule.

Send and receive bulk data from a Linux 6.12 USB driver with usb_bulk_msg: pipes, DMA-safe buffers, timeouts, short transfers and how to recover from a stall.