Skip to content
linux/internals

Linux Internals — see the kernel and userspace

Linux Internals is a visual, animated guide to the kernel and userspace — from a process opening a file to a packet hitting the NIC.

loading kernel…

Linux kernel internals, subsystem by subsystem

The map above is a picture of how a running Linux system is put together: userspace at the top, the kernel in the middle, hardware at the bottom. Every box is listed here with what it does and where its code lives in the kernel tree (paths are for x86_64). Start with the read() syscall walkthrough to see one request cross most of these layers, or the scheduler deep-dive.

Userspace

  • User applications

    Your processes — shells, browsers, servers, daemons. Everything in ring 3.

  • systemd / init

    The first userspace process — supervises services, mounts, sockets, units. systemd is the dominant init today.

  • glibc / musl

    The C library: wraps syscalls (read, write, open…) and exposes a stable userspace ABI. Implements buffering, locale, threading on top.

  • Dynamic linker

    Resolves and maps shared libraries (.so) into a process before main() runs. PLT/GOT, lazy binding, RPATH/RUNPATH.

  • vDSO

    A small shared object the kernel maps into every process — turns frequent calls like gettimeofday/clock_gettime into pure userspace reads.

    arch/x86/entry/vdso

Kernel entry

  • Syscall entry

    Where ring 3 becomes ring 0. The SYSCALL instruction lands in entry_SYSCALL_64, which switches stacks and saves registers, then do_syscall_64() dispatches on the syscall number to the matching __x64_sys_*() handler.

    arch/x86/entry

Kernel: Processes

  • Scheduler

    Picks which task runs next on each CPU. CFS until 6.6, now EEVDF. Also handles RT and SCHED_DEADLINE classes.

    Read the scheduler deep-divekernel/sched

  • Signals & wait/wake

    Signal delivery (SIGINT, SIGSEGV…), wake-ups, futex — the primitives that make blocking, mutexes and condition variables possible.

    kernel/signal.c

  • IPC

    Pipes, FIFOs, System V & POSIX message queues, shared memory, Unix-domain sockets — how processes talk to each other.

    ipc

  • Namespaces & cgroups

    The containerization primitives. Namespaces isolate views (pid, mnt, net, user…); cgroup v2 accounts and limits resources.

    kernel/cgroup

Kernel: Memory

  • Virtual memory

    Per-process address space: VMAs describing mappings, multi-level page tables, TLB management, copy-on-write.

    mm

  • Page cache

    The unified cache of file-backed pages. Reads hit it before any I/O is issued; dirty pages are written back asynchronously.

    Follow a read() syscall through itmm/filemap.c

  • Allocators

    kmalloc/kfree are SLUB on top of the buddy page allocator. vmalloc covers non-contiguous large allocations.

    mm/slub.c

  • Swap & OOM

    Reclaim, swap, zswap and (eventually) the OOM killer — what happens when memory pressure can't be relieved.

    mm/oom_kill.c

Kernel: Storage and filesystems

  • VFS

    Virtual filesystem layer. Generic file/dir operations dispatched to concrete filesystems via f_op->… function pointers.

    Follow a read() syscall through itfs

  • Filesystems

    Concrete on-disk filesystems — ext4, btrfs, xfs, fuse, tmpfs. Each implements VFS hooks plus their own journaling/COW/allocators.

    fs/ext4

  • Block layer

    bio submission, multi-queue request layer, I/O schedulers (mq-deadline, bfq, kyber, none). The plumbing between filesystems and drivers.

    Follow a read() syscall through itblock

  • Storage drivers

    NVMe, AHCI/SATA, virtio-blk, SCSI — the drivers that talk to actual storage controllers and DMA pages to/from RAM.

    drivers/nvme/host

Kernel: Networking

  • Sockets

    The socket() syscall family. Glue between the file descriptor world and the protocol stacks below.

    net/socket.c

  • TCP / UDP / IP

    The protocol stacks. Connection tracking, congestion control, retransmits, fragmentation, routing.

    net/ipv4

  • Netfilter · qdisc

    Packet filtering and shaping. iptables/nftables hooks, conntrack, traffic-control disciplines (fq_codel, htb, …).

    net/netfilter

  • Network drivers

    NIC drivers (e1000e, igb, mlx5, virtio-net, …). NAPI poll loops, ring buffers, XDP for the fastest path.

    drivers/net

Kernel: Devices and I/O

  • Char devices

    Character-mode devices: /dev/null, /dev/random, ttys, GPIO, watchdogs, virtio-console.

    drivers/char

  • USB subsystem

    Host controllers (xhci, ehci), the USB core, class drivers (hid, storage, audio, cdc).

    drivers/usb

  • PCI subsystem

    PCI/PCIe enumeration, MSI/MSI-X, hotplug, BARs, IOMMU plumbing. The bus most devices live on.

    drivers/pci

  • Device model

    The kobject / driver model behind sysfs, udev events, probe/remove, power management.

    drivers/base

Hardware

  • CPUs

    The silicon the scheduler dispatches onto. Cores, SMT, NUMA nodes.

    arch/x86

  • DRAM

    Physical memory that backs the virtual address space.

  • NVMe / SATA

    Persistent storage. NVMe over PCIe is the modern fast path; SATA/AHCI still everywhere.

  • NIC

    The network interface — physical Ethernet, WiFi radios, or paravirtualized virtio-net.

  • USB / PCI devices

    Everything else hanging off USB or PCIe: keyboards, GPUs, sensors, accelerators.