монолитное ядро с загружаемыми модулямиa monolithic kernel with loadable modules

LinuxLinux

Архитектура ядра Linux и то, что из неё следует для практики: почему один и тот же кернел лежит и под сервером, и под телефоном, и под embedded-платой, и как дистрибутивы и производные системы расходятся поверх общего ядра. Плюс блок про разработку самого ядра (версии, kernel.org, сборка), блок про системный слой без которого ядро — не операционная система (bootloader, init, libc, package manager) и отдельный хаб про конкретные дистрибутивы.The Linux kernel's architecture and what follows from it in practice: why the same kernel runs under a server, a phone, and an embedded board, and how distros and derivative systems diverge on top of one shared kernel. Plus a block on kernel development itself (versions, kernel.org, building), a block on the system layer without which a kernel isn't an operating system (bootloader, init, libc, the package manager), and a separate hub for specific distros.

ТемыTopics

Архитектура ядраKernel architectureмонолит vs микроядро — спор Torvalds/Tanenbaum 1992 года дословно; LKM как модульность без изоляции; task_struct и clone() — почему в Linux нет отдельного syscall для потока.monolith vs microkernel — the 1992 Torvalds/Tanenbaum debate verbatim; LKM as modularity without isolation; task_struct and clone() — why Linux has no separate syscall for a thread.detailed Модули ядраKernel modulesEXPORT_SYMBOL, modules.dep, modalias — как модуль находит функции ядра, как modprobe достраивает зависимости сам, как udev автозагружает драйвер при подключении устройства; готовые к сборке hello-world и PCI-драйвер с coherent DMA-памятью (dma_alloc_coherent), отданной в userspace как /dev-блочное устройство через blk-mq/gendisk; Makefile, insmod/rmmod/depmod на практике. — how a module finds kernel functions, how modprobe fills in dependencies itself, how udev autoloads a driver when a device is plugged in; buildable hello-world and a PCI driver with coherent DMA memory (dma_alloc_coherent) exposed to userspace as a /dev block device via blk-mq/gendisk; a Makefile, insmod/rmmod/depmod in practice.detailed Дистрибутивы: семейства и различияDistros: families & differencesчто общее у всех (ядро) и что разное: init-система, пакетный менеджер, политика релизов (rolling vs LTS). Отдельные статьи: Debian/Ubuntu, RHEL/Fedora, Arch, Alpine, SUSE — зачем нужен именно этот, а не «ещё один Linux».what's shared by all of them (the kernel) vs what differs: the init system, package manager, release policy (rolling vs LTS). Separate writeups: Debian/Ubuntu, RHEL/Fedora, Arch, Alpine, SUSE — why this one and not "just another Linux".skeleton AndroidLinux-ядро (с патчами вроде Binder, low-memory killer) под нестандартным userspace: без glibc/systemd, своя модель процессов (Zygote, ART вместо обычного exec), Google как отдельный слой поверх AOSP.the Linux kernel (with patches like Binder, the low-memory killer) under a non-standard userspace: no glibc/systemd, its own process model (Zygote, ART instead of a plain exec), Google as a separate layer on top of AOSP. The Yocto Projectне дистрибутив, а build-система для сборки кастомных embedded-дистрибутивов Linux под конкретное железо: BitBake, слои (layers), recipes, чем отличается от Buildroot и готовых embedded-дистрибутивов.not a distro but a build system for assembling custom embedded Linux distributions for specific hardware: BitBake, layers, recipes, how it differs from Buildroot and off-the-shelf embedded distros. КонтейнеризацияContainerizationnamespaces + cgroups + OverlayFS изнутри: команды unshare/systemd-run/mount для работы с примитивами напрямую, что физически делают docker run и kubectl под капотом, чем контейнер отличается от VM на уровне ядра.namespaces + cgroups + OverlayFS from the inside: unshare/systemd-run/mount commands for working with the primitives directly, what docker run and kubectl physically do under the hood, how a container differs from a VM at the kernel level.detailed Файловые системыFilesystemsVFS — общий интерфейс (superblock/inode/dentry/file), под которым любая ФС подставляет свою реализацию; ext4 разобрана подробно (block group, extent-деревья, JBD2). Отдельные статьи: Btrfs, XFS, ZFS, F2FS.VFS — the common interface (superblock/inode/dentry/file) under which any filesystem plugs in its implementation; ext4 covered in detail (block groups, extent trees, JBD2). Separate writeups: Btrfs, XFS, ZFS, F2FS.detailed НаблюдаемостьObservability/proc, /sys, ftrace/eBPF — как заглянуть внутрь работающего ядра без перекомпиляции./proc, /sys, ftrace/eBPF — inspecting a running kernel without recompiling. Сетевой стекNetworking stackпуть пакета от драйвера до сокета и три точки перехвата на нём: XDP (до sk_buff, вне зависимости от netfilter), netfilter/nftables (уровень IP), io_uring (уровень приложения); nft/iptables-nft, bpftool net на практике.a packet's path from the driver to a socket, and three interception points along it: XDP (before sk_buff, independent of netfilter), netfilter/nftables (the IP layer), io_uring (the application layer); nft/iptables-nft, bpftool net in practice.detailed

Разработка ядраKernel development

версии, kernel.org, сборкаversions, kernel.org, building

Системный слой поверх ядраThe system layer on top of the kernel

из чего физически состоит дистрибутивwhat a distro is physically made of
Загрузчик (bootloader)BootloaderBIOS/MBR vs UEFI/GPT, NVRAM, chainloading — как один диск с GRUB может грузить Windows 11 и второй дистрибутив Linux с других физических дисков; os-prober, Secure Boot и shim, типичные грабли восстановления после установки Windows. — how one disk running GRUB can boot Windows 11 and a second Linux distro off other physical disks; os-prober, Secure Boot and shim, common recovery gotchas after installing Windows.detailed Init-система (PID 1)Init system (PID 1)systemd, OpenRC, runit — граф зависимостей (Requires/After) и параллельный запуск vs supervision suites без графа вообще; unit-файлы, socket activation, cgroup на сервис, и почему «systemd победил» значит рыночную долю, а не техническое единогласие. — dependency graphs (Requires/After) with parallel startup vs supervision suites with no graph at all; unit files, socket activation, a cgroup per service, and why "systemd won" means market share, not technical unanimity.detailed glibc / muslC-библиотека — слой между обычными программами и системными вызовами ядра: без неё ни один типичный бинарник не запустится. glibc — стандарт де-факто; musl — компактная альтернатива (Alpine), другие компромиссы по размеру и совместимости.the C library — the layer between ordinary programs and kernel syscalls: without it, no typical binary runs. glibc is the de-facto standard; musl is a compact alternative (Alpine), with different size/compatibility trade-offs. Пакетный менеджерPackage managerdpkg/apt, rpm/dnf, pacman — не строго обязателен для запуска системы, но фактически определяет идентичность дистрибутива: формат пакета, разрешение зависимостей, откуда берётся ПО и как оно обновляется. — not strictly required to boot, but in practice defines a distro's identity: package format, dependency resolution, where software comes from and how it updates. Shellbash, dash, zsh — интерпретатор командной строки и язык для системных скриптов; POSIX-совместимость, почему /bin/sh часто указывает не на bash, а на что-то более лёгкое. — the command-line interpreter and the language behind system scripts; POSIX compliance, why /bin/sh often points to something lighter than bash. coreutilsGNU coreutils, BusyBox — базовые утилиты (ls, cp, mv, cat и десятки других), без которых shell бесполезен даже с работающим ядром; GNU-версия vs BusyBox как один бинарник на все команды для embedded/Alpine. — the basic utilities (ls, cp, mv, cat, and dozens more) without which a shell is useless even with a working kernel; the GNU version vs BusyBox as a single binary covering every command, for embedded/Alpine. udevsystemd-udevd — userspace-демон, который создаёт и убирает файлы устройств в /dev по событиям от ядра; без него /dev либо пуст, либо статичен и не реагирует на подключение железа на лету. — the userspace daemon creating and removing device files in /dev in response to kernel events; without it /dev is either empty or static, unresponsive to hardware plugged in on the fly. D-Busшина межпроцессного взаимодействия (IPC), на которой держится значительная часть современного userspace — не только графических окружений, но и системных служб вроде NetworkManager; альтернатива прямым сокетам и сигналам.an inter-process communication (IPC) bus underpinning a large chunk of modern userspace — not just desktop environments but system services like NetworkManager; an alternative to raw sockets and signals.

статусstatus

9 карточек по темам («Архитектура ядра» — объединена с бывшей «Моделью процессов», «Модули ядра», «Контейнеризация» и «Сетевой стек» тоже написаны подробно, «Дистрибутивы» — ссылка на отдельный хаб), 3 по разработке ядра («Версии» и «kernel.org» написаны подробно, сборка — ещё каркас) и 8 по системному слою («Загрузчик» написан подробно, остальные 7 — ещё каркас) зафиксированы.9 topic cards ("Kernel architecture" now merged with the former "Process model", "Kernel modules", "Containerization" and "Networking stack" are also written up in detail, "Distros" links to a separate hub), 3 kernel-development cards ("Versions" and "kernel.org" are written up in detail, building is still a skeleton), and 8 system-layer cards ("Bootloader" is written up in detail, the other 7 are still a skeleton) are locked in.