torvalds/linux
The tree is organized as core kernel code (init/, kernel/, mm/, ipc/), a VFS layer with ~50 filesystems (fs/), networking (net/), block layer (block/), io_uring (io_uring/), drivers (drivers/), security modules (security/), crypto (crypto/), per-architecture ports (arch/, 22 architectures), Rust support (rust/), userspace tooling (tools/), documentation (Documentation/, ~4000 rst files) and scripts/ for the build. There is no single binary entrypoint: the linker composes initcall sections and start_kernel() in init/main.c is the canonical C entry after arch-specific setup. Build is driven by the top-level Makefile (VERSION=7 PATCHLEVEL=3 SUBLEVEL=0 EXTRAVERSION=-rc4) plus Kconfig; there are no CI configs in-tree. The runtime boundary is the syscall table, generated from per-arch .tbl files.
- Top-level Makefile pins the release: VERSION=7, PATCHLEVEL=3, SUBLEVEL=0, EXTRAVERSION=-rc4, NAME="Baby Opossum Posse"; requires GNU Make >= 4.0 and uses a recursive Kbuild descent where sub-Makefiles only modify their own directory.
- start_kernel() in init/main.c is the architecture-independent C entrypoint; it runs a strictly ordered bring-up — set_task_stack_end_magic, smp_setup_processor_id, boot_cpu_init, setup_arch, mm_core_init_early/mm_core_init, sched_init, rcu_init, early_irq_init, init_IRQ, timers_init, hrtimers_init — and ends by calling rest_init().
- rest_init() creates PID 1 by calling kernel_clone() with kernel_init as the thread function and creates kthreadd via kernel_thread(); the boot CPU then becomes the idle thread via schedule_preempt_disabled() and cpu_startup_entry(CPUHP_ONLINE).
- Subsystem initialization is linker-ordered: __define_initcall macros (early_initcall, core_initcall ... device_initcall, late_initcall) emit function pointers into initcall sections, and do_initcalls() walks initcall_levels[0..7] calling do_one_initcall on each entry; do_pre_smp_initcalls() runs the 'early' level before smp_init().
- The top-level Kconfig file is an aggregator that sources init/Kconfig, kernel/Kconfig.freezer, fs/Kconfig.binfmt, mm/Kconfig, net/Kconfig, drivers/Kconfig, fs/Kconfig, security/Kconfig, crypto/Kconfig, lib/Kconfig, lib/Kconfig.debug, Documentation/Kconfig and io_uring/Kconfig.
- The init/ Makefile links the boot sequence objects: main.o, version.o, mounts.o (do_mounts.o plus do_mounts_rd.o/do_mounts_initrd.o when initrd support is enabled), initramfs.o or noinitramfs.o, calibrate.o and initramfs_test.o under CONFIG_INITRAMFS_TEST.
- x86-64 syscall entry is arch/x86/entry/entry_64.S entry_SYSCALL_64, which calls do_syscall_64() in arch/x86/entry/syscall_64.c; that function wraps dispatch in syscall_enter_from_user_mode_randomize_stack()/syscall_exit_to_user_mode() and calls do_syscall_x64, which bounds-checks nr with array_index_nospec and calls x64_sys_call — a dense switch generated from <asm/syscalls_64.h> rather than the legacy sys_call_table[] pointer jump.
- Syscall numbers and their implementing symbols are declared per-architecture in table files such as arch/x86/entry/syscalls/syscall_64.tbl (e.g. nr 9 mmap -> sys_mmap, nr 16 ioctl -> sys_ioctl), which are compiled into generated headers that build both the switch dispatcher and sys_call_table[] (kept only for trace_syscalls).
- Rust is a first-class in-tree language: rust/kernel/lib.rs defines a #![no_std] 'kernel' crate that all Rust kernel code depends on, with per-subsystem modules (alloc, block, driver, fs, i2c, ...) gated by CONFIG_* cfgs; its doc comment instructs contributors to wrap missing C APIs in this crate rather than bypass it.
- The device model lives in drivers/base/: bus.c implements bus/driver/device matching and dd.c runs probing via driver_probe_device -> __driver_probe_device -> really_probe, which calls driver_sysfs_add and the driver's probe hook.
- Loadable kernel modules are handled by kernel/module/main.c: SYSCALL_DEFINE3(init_module) and SYSCALL_DEFINE3(finit_module) both call may_init_module() (CAP_SYS_MODULE + modules_disabled check) then load_module(), which validates the ELF image, checks signatures and modinfo, lays out sections and calls do_init_module().
- The LSM layer in security/security.c generates dispatch wrappers via call_int_hook()/call_void_hook() over hook lists declared in include/linux/lsm_hook_defs.h; security/lsm_init.c registers staged LSM initcalls (pure, early, core, subsys, fs) and early_security_init()/security_init() are invoked from start_kernel().
- There is no CI configuration in the repository root (no .github or .gitlab-ci.yml); the contribution pipeline is email/patch based and documented in Documentation/process/, with scripts/checkpatch.pl and scripts/get_maintainer.pl as the local quality gates.