See also note on:

  • Concurrency


Beej’s Guide to Network Programming Linux Kernel Development build the smallest possible linux system

Serial port programing termios

ioctl fcntl

System Calls

The Definitive Guide to Linux System Calls some nice info on how syscalls happens. Interrupt x80, syscall instruction etc. VDSO - v

Porting OpenBSD pledge() to Linux


Linux Kernel Labs

kernel documentation


  • pthreads



no libc small pre-processed fixed size stack ~4kb no floating point?

processes are tracked processes own resources pids. ps



LSM linux security module selinux and apparmor are based on lsm

selinux is externally sandboxing a process. landlock is program developer voluntarily giving up access


firejail? cool links

landlock restrict ambient rights, global file system access discussion about landlock, incudes ocmparsion of some other features

openbsd pledge, unveil

security things in Linux v…

kmsan KernelMemorySanitizer, a detector of uses of uninitialized memory in the Linux kernel



libuv libev libevent

File System

Disk sectors. Disk rotation speed Disk Seek time

RAID - Redundant array of inexpensive disks. Copy data to multiple disks, or use error correction. RAID0 just interleaves disks for parallelism striping - put subsequent blocks on different disks RAID 1 - mirroring. Just rwwrite the same thing to multiple disks complete operating system from scratch

Hypervisors - like OS for OSes hypervisor from scratch 5 Days To Virtualization: A Series On Hypervisor Development

How do programs start?


Memory management

Scheduling - interrupts


microkernels mirage os


Microkernel Functional correctness But also binary level verification. Uses gcc but disassemblers result to verify



Booting is like a whole thing.

UEFI BIOS basic input output system - loads first sector and runs it. 16 bit code



POST - power on self test

MBR master boot record. 512 bytes. See sector lisp, sector forth, sector games

bootloader stages - more an more complex systems

TPM secure boot So like malware can really fuck you by manipulating the boot process? I could see that.

Formal methods applied to booting

Formal Verification of a Modern Boot Loader 2018 - SABLE. Isabelle Towards a verified first-stage bootloader in Coq - 2020 - phd dissertation

SPIN 2009 Verified functional programming of an IoT operating system’s bootloader - 2021 Low* Riot Formally Verifying Security Properties for OpenTitan Boot Code with Uppaal - 2021

Model checking boot code from AWS data centers- 2020 - CBMC

Stuff proc documentation

cat /proc/self/mems
cat /proc/self/status query OS info as sqlite virtual table