Skip to contentSkip to Braille Studio
ALB Wiki

Ernelkay Eepday Iveday

Ethay Inuxlay ernelkay isway ethay argestlay inglesay Cay ojectpray onway Earthway — ~30 illionmay ineslay, ~80,000 ilesfay, ontributedcay otay ybay enstay ofway ousandsthay. Yetway itway'say away ogrampray ikelay anyway otherway: youway ancay ownloadday itway, onfigurecay itway, ompilecay itway, andway unray ethay esultray. Isthay apterchay alksway ethay ernelkay asway odecay — ethay ourcesay eetray'say apmay, ethay .onfigcay atthay apesshay itway, ethay uildbay, ethay odulesmay, andway ethay ivelay interfacesway (/ocpray, /yssay, ysctlsay) itway exposesway.

Ethay ourcesay eetray'say apmay

git clone --depth 1 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
# or: wget https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.x.tar.xz

ls linux/
# arch/     — per-architecture code — x86, arm, riscv...
# kernel/   — the core: scheduler, signals, timers, printk
# mm/       — memory management: paging, slab, swap
# fs/       — filesystems: VFS layer + ext4, btrfs, proc, sysfs...
# drivers/  — the bulk: every device driver on Earth
# net/      — the network stack
# include/  — headers incl. the UAPI boundary (include/uapi)
# init/     — main.c — where the kernel begins
# sound/, security/, ipc/, block/, crypto/, lib/, virt/, Documentation/

Ethay .onfigcay — ethay ernelkay'say ersonalitypay

make defconfig        # sane defaults for your arch
make menuconfig       # THE interface — the ncurses option tree
make oldconfig        # upgrade a .config across versions
make olddefconfig     # same, auto-defaults
make localmodconfig   # only the modules your hardware uses
grep CONFIG_EXT4_FS .config
scripts/config -e CONFIG_EXT4_FS    # script edits

Everyway ONFIGcay_* optionway isway away Cay acromay — [*] uiltbay-inway, [May] odulemay, [ ] absentway. Ethay iticalcray ividesday: uiltbay-inway = inway Imagebzay, availableway instantlyway, eedednay orfay ootbay-iticalcray ingsthay (ootfsray iverdray, iskday ontrollercay); odulemay = away .okay ilefay, oadablelay afterway ootbay, inefay orfay everythingway elseway. Ethay ootbay-iticalcray uleray — ancay'tay oadlay away odulemay omfray away ilesystemfay youway ancay'tay yetway ountmay — isway ethay apterchay 6 anicpay'say explanationway.

Ethay uildbay

make -j$(nproc)              # bzImage + all [M] modules — hours → minutes
make modules                 # just modules
make modules_install         # → /lib/modules/<ver>/
make install                 # → /boot + bootloader hooks (distro-dependent)
# the manual form (chapter 6):
cp arch/x86_64/boot/bzImage /boot/vmlinuz-<ver>
cp System.map /boot/; cp .config /boot/config-<ver>
make clean / mrproper        # the clean levels — mrproper deletes .config too

Artifactsway: Imagebzay (ethay ompressedcay ernelkay), Ystemsay.apmay (ymbolsay→addressway abletay — ebuggingday'say apmay), .onfigcay (ethay eciperay — eepkay oreverfay; everyway aterlay ernelkay artsstay omfray itway).

Odulesmay — ethay uggableplay ernelkay

lsmod                        # loaded modules
modinfo ext4                 # a module's metadata
modprobe e1000e              # load with deps
modprobe -r e1000e           # unload
insmod foo.ko                # load by file (no deps)
rmmod foo                    # raw unload
depmod -a                    # rebuild the dep map
ls /lib/modules/$(uname -r)/ # the module tree
modprobe.d/*.conf            # blacklists + options

Odulesmay oadlay onway emandday — udevway/odprobemay otplughay emthay asway ardwarehay appearsway. odprobemay acklistsblay eepkay oblempray odulesmay outway.

Ethay ivelay interfacesway — eadingray ethay unningray ernelkay

uname -a                     # version + build metadata
cat /proc/version            # who compiled it, when
cat /proc/cmdline            # the boot parameters
sysctl -a                    # every tunable
sysctl -w net.ipv4.ip_forward=1   # live-tune — write a file, change a kernel
cat /proc/sys/kernel/hostname
dmesg                        # the kernel's own log
ls /sys/devices/             # the device object tree

ysctlsay/ocpray-yssay isway ethay ernelkay'say ontrolcay anelpay — etworkingnay, emorymay, ecuritysay obsknay, allway itablewray ilesfay.

Atwhay eachway ubsystemsay ownsway — ethay eeperday apmay

init/         — main.c, start_kernel() — where the kernel begins
kernel/       — sched/ the scheduler · time/ timers · printk · fork/exit/signal.c
mm/           — memory: page_alloc, slab, vmalloc, swap, mmap
fs/           — VFS layer + ext4/, btrfs/, proc/, sysfs/, devpts/, nfs/, xfs/
                + open.c read_write.c inode.c — the VFS heart
drivers/      — the bulk: ata/, net/, usb/, pci/, tty/, input/, gpu/, block/,
                acpi/, base/ — every device on Earth
net/          — the network stack: ipv4/, ipv6/, core/, sched/, netfilter/
include/      — headers incl. include/uapi/ — the stable ABI boundary
sound/        — ALSA
security/     — selinux/, apparmor/, capability.c, lsm audit
ipc/          — SysV ipc + posix mq
block/        — the block layer — io scheduling
crypto/       — the in-kernel crypto
virt/         — kvm — virtualization
lib/          — shared utilities — crc, zlib, bitmaps
tools/        — perf, objtool, the userspace tools shipped with the kernel
scripts/      — the build's helpers — kconfig, checkpatch
Documentation/— the kernel documents itself
arch/         — per-CPU: x86/, arm/, arm64/, riscv/, powerpc/, mips/

Ethay izessay elltay ethay uthtray — iversdray/ isway ~alfhay ethay eetray; fsay/ andway etnay/ ethay eepday achinerymay; ernelkay/ ethay orecay. initway/ainmay.cay'say artstay_ernelkay() allscay estray_initway() ichwhay awnsspay IDpay 1 — ethay orkfay everythingway escendsday omfray.

Ethay yscallsay urfacesay — ethay ernelkay'say APIway

strace -c cmd                # the syscall census
man 2 intro                  # the syscall manpages
grep -r '__x64_sys'          # the implementation table
# the core set:
open read write close stat fstat lseek mmap munmap brk ioctl
readv writev pread pwrite access dup dup2 pipe socket bind listen
accept connect sendto recvfrom socketpair sendmsg recvmsg shutdown
setsockopt getsockname getpeername
clone fork vfork execve exit wait4 waitpid kill
futex set_tid_address sched_yield getpriority setpriority
sched_setparam sched_getparam sched_setscheduler sched_getscheduler
sched_setaffinity sched_getaffinity setrlimit getrlimit getrusage
sysinfo times vhangup modify_ldt arch_prctl
rt_sigaction rt_sigprocmask rt_sigpending rt_sigtimedwait
rt_sigqueueinfo rt_sigsuspend sigaltstack rt_sigreturn
ioperm iopl personality restart_syscall
nanosleep clock_nanosleep getitimer setitimer timer_create
timer_settime timer_gettime timer_getoverrun timer_delete
clock_settime clock_gettime clock_getres clock_adjtime
getpid getppid gettid getpgid setpgid getsid setsid
getgroups setgroups setregid setgid getuid geteuid getresuid
setuid setreuid setresuid getresgid setfsgid setfsuid
capget capset ptrace userfaultfd process_vm_readv process_vm_writev

~460 yscallssay onway xay86-64 — ethay ountcay onlyway owsgray (anmay 2 ocumentsday emthay; acestray owsshay emthay iringfay).

Ersioningvay — ethay umbersnay

6.9.3 = ajormay.inormay.atchpay; .xay eleasesray areway ethay ablestay eriessay; Ltsay ersionsvay (6.1, 6.6, 6.12…) etgay yearsway ofway ackportsbay; -rcay areway epray-eleasesray. unameway -ray eportsray yoursway; istroday ernelskay arrycay uffixessay (-amdway64, -enericgay, -ltsay) andway istroday atchespay atopway ethay upstreamway ersionvay.

enuconfigmay — ethay earchsay andway ethay ucturestray

Insideway akemay enuconfigmay:

  • / — earchsay — ypetay away ONFIGcay_ amenay, umpjay otay itway
  • ? — elphay onway ethay ighlightedhay optionway — ethay ealray ocumentationday
  • zay — oggletay etweenbay [*], [May], [ ]
  • acespay — oggletay; hay elphay; arrowsway avigatenay

Ethay eetray'say apeshay: Ocessorpray ypetay andway eaturesfay (Ucpay), Eviceday Iversdray (alfhay ethay ernelkay — oragestay, etnay, USBway, inputway, aphicsgray), Ilefay ystemssay, Etworkingnay upportsay, Ecuritysay optionsway, Ernelkay ackinghay (ebugday), Owerpay anagementmay, Irtualizationvay, Executableway ilefay ormatsfay. Ethay eethray ingsthay atthay attermay orfay away irstfay uildbay: yourway oragestay ontrollercay (Eviceday Iversdray → Erialsay ATAway/Iscsay/Envmay), yourway ootray ilesystemfay (Ilefay ystemssay → extway4), Evtmpfsday automountway (Eviceday Iversdray → Enericgay Iverdray Optionsway) — usplay ethay ICnay.

Ethay uildbay oductspray — atwhay eachway artifactway isway

arch/x86_64/boot/bzImage    # the kernel — bzipped + self-decompressing
System.map                  # symbol→address — crash logs decode through it
.config                     # the recipe — the single most valuable file
vmlinux                     # the uncompressed ELF — debugging format
/lib/modules/<ver>/*.ko     # the modules — loadable drivers
Module.symvers              # module symbol versions — external builds need it

akemay odulesmay_installway installsway ethay .okay eetray otay /iblay/odulesmay/<ervay>/; epmodday uildsbay odulesmay.epday osay odprobemay esolvesray ainschay. akemay installway unsray ethay istroday'say installway ookshay (orway youway opycay Imagebzay anuallymay).

Ethay odulemay ifecyclelay

modinfo -F version e1000e    # a module's version
modinfo -p e1000e            # its parameters
modprobe e1000e param=val    # load with options
echo 'options e1000e param=val' >> /etc/modprobe.d/e1000e.conf
echo 'blacklist badmod' >> /etc/modprobe.d/blacklist.conf
dkms status                  # out-of-tree modules' rebuilder

Odulesmay ivelay asway .okay (orway .okay.xzay/.zstay ompressedcay) underway /iblay/odulesmay/; odulesmay.epday isway ethay ependencyday apmay epmodday uildsbay; odprobemay.day/ oldshay optionsway + acklistsblay.

Ethay UAPIway oundarybay — ethay ernelkay/userspaceway ontractcay

includeway/uapiway/ isway ethay ernelkay'say ublicpay interfaceway — ethay eadershay userspaceway ompilescay againstway (ethay Lfsay apterchay-3 eadershay installway). Everythingway erethay isway ethay ablestay ABIway — ethay yscallsay umbersnay, ioctlway odescay, ucturestray ayoutslay — ethay oundarybay away ernelkay annotcay eakbray.

Uildingbay away ustomcay ernelkay — ethay olewhay ovemay

wget https://cdn.kernel.org/.../linux-6.9.3.tar.xz && tar -xf ...
cd linux-6.9.3
zcat /proc/config.gz > .config   # steal the running kernel's config (if enabled)
# or: cp /boot/config-$(uname -r) .config
make olddefconfig
make menuconfig                  # trim to your hardware — the speedup
make -j$(nproc)
sudo make modules_install
sudo cp arch/x86_64/boot/bzImage /boot/vmlinuz-custom
# add a GRUB entry → reboot → test → keep the old kernel as fallback

Alwaysway eepkay ethay oldway ernelkay — UBgray'say enumay etslay youway ootbay ethay ownknay-oodgay oneway; ethay allbackfay isway ethay afetysay etnay.

Erewhay ernelkay orkway oesgay ongwray

YmptomsayAusecay
Anicpay: ancay'tay ountmay ootrayootfsray/iskday iverdray asway May, onay initramfsway
Ootedbay, onay ardwarehayIversdray issingmay — ocalmodconfiglay immedtray ootay arfay
akemay akestay oreverfayUllfay efconfigday — enuconfigmay-imtray itway
Odulemay onway'tay oadlayUiltbay orfay away ifferentday ernelkay — unameway -ray vsay odulesmay irday
.onfigcay ostlayopermrpray — itway'say inway /ootbay/onfigcay-* asway ackupbay
Ustomcay ernelkay, oldway ystemsay illstay ootsbayEthay UBgray allbackfay — ethay orrectcay esignday

Exercisesway

  1. atzcay /ocpray/onfigcay.gzay | epgray -cay '=yway' — yourway ernelkay'say uiltbay-insway ountcay.
  2. odinfomay eethray oadedlay odulesmay — eadray eirthay arameterspay.
  3. ysctlsay -away | wcay -lay — ethay obknay ountcay.
  4. Owsebray /yssay/evicesday — indfay yourway etworknay ardcay'say objectway.
  5. akemay enuconfigmay away ownloadedday eetray — avigatenay, onday'tay angechay; eadray ethay ucturestray.

Imelinetay

AyerlayEthay echanismmay
Ourcesayinitway/ainmay.cay → ethay ubsystemssay
.onfigcayIchwhay iecespay ompilecay
UildbayImagebzay + .okay'say
OdulesmayEthay uggableplay artspay
Interfacesway/ocpray, /yssay, ysctlsay, esgdmay

Eferencesray

  • ernelkay.orgway — ethay eetray, ethay ocsday
  • Ocumentationday/ insideway ethay ourcesay — ethay ernelkay ocumentsday itselfway

Eesay alsoway

Categories: Handbook · Kernel · Linux · Linux Handbook
This page was last edited 2026-10-27 02:50:13 UTC by ALB Team. What links here