mohitmishra786/low-level-dev-skills

linux-kernel-architecture

Linux kernel architecture skill for subsystem overview.

Voir la source
Document Skill original

Rendu depuis le dépôt source en conservant titres, exemples, code, tableaux, liens et images.

Linux Kernel Architecture

Purpose

Provide a mental map of the Linux kernel: boot sequence, major subsystems, key data structures, and where to look in source — complementing skills/kernel/kernel-internals with architecture-level navigation for driver and subsystem work.

When to Use

  • First time exploring linux.git for a feature or bug
  • Understanding how boot reaches init and driver probe
  • Tracing a syscall or interrupt through subsystems
  • Onboarding before skills/kernel-dev/platform-device-model or driver skills

Workflow

1. Boot flow (x86/ARM64 simplified)

firmware/UEFI
├── arch/*/boot — decompress kernel, early setup
├── start_kernel() — mm, scheduler, timers, IRQ subsys
├── rest_init() → kernel_init → run_init_process
└── userspace init (systemd)

Driver module_init / device_initcall run during start_kernel before init.

2. Major subsystems

SubsystemPath (typical)Key structs
Schedulerkernel/sched/task_struct, sched_entity
Memorymm/struct page, mm_struct, vm_area_struct
VFSfs/inode, dentry, file, super_block
Blockblock/request_queue, gendisk
Netnet/sk_buff, net_device
Driversdrivers/device, device_driver
Syscallskernel/, fs/, mm/SYSCALL_DEFINE*

3. Initcall levels

c
/* include/linux/init.h — order matters */
early_initcall → core_initcall → postcore_initcall
→ arch_initcall → subsys_initcall → fs_initcall
→ device_initcall → late_initcall

Platform drivers usually register at subsys_initcall or via module_init.

4. Finding code

bash
# Locate symbol
grep -rn "platform_driver_register" drivers/

# Trace config
./scripts/config --state CONFIG_FOO

# File hierarchy docs
ls Documentation/admin-guide/

5. Agent usage

/linux-kernel-architecture Where does page fault handling live and what calls it?

Common Problems

SymptomCauseFix
Driver probes too earlyInitcall vs DT orderingDefer with deferred_probe
Symbol missingBuilt as modulemodprobe or built-in CONFIG_*
Wrong subsystemSimilar names in drivers/Follow struct bus_type
Boot hangEarly printk disabledearlyprintk, initcall_debug

Related Skills

  • skills/kernel/kernel-internals — scheduler, SLUB, VFS depth
  • skills/kernel-dev/kernel-memory-management — mm/ details
  • skills/kernel-dev/platform-device-model — driver model
  • skills/kernel-dev/device-tree — hardware description
  • skills/low-level-programming/linux-kernel-modules — LKM basics
du même dépôt

Autres Skills

Tous les Skills
mohitmishra786
Communauté

static-analysis

Static analysis skill for C/C++ codebases. Use when hardening code quality, triaging noisy builds, running clang-tidy, cppcheck, or scan-build, interpreting check categories, suppressing false positives, or integrating static analysis into CI. Activates on queries about clang-tidy checks, cppcheck, scan-build, compilecommands.json, code hardening, or static analysis warnings.

installations
1
GitHub Stars
263
Mis à jour
27 juin
mohitmishra786
Communauté

assembly-x86

x86-64 assembly skill for reading, writing, and debugging assembly code. Use when reading GCC/Clang assembly output, writing inline asm in C/C++, understanding the System V AMD64 ABI calling convention, or debugging register and stack state. Activates on queries about x86-64 assembly, AT&T vs Intel syntax, inline asm, calling conventions, SIMD intrinsics, or reading disassembly output from objdump or GDB.

installations
1
GitHub Stars
258
Mis à jour
27 juin
mohitmishra786
Communauté

cpp-modules

C++20 modules skill for modern C++ projects. Use when working with named modules, module partitions, header units, CMake MODULESOURCES, Clang -fmodules-ts, BMI caching issues, or migrating from headers to modules. Activates on queries about C++20 modules, import statements, module interface units, header units, or BMI files.

installations
1
GitHub Stars
258
Mis à jour
27 juin
mohitmishra786
Communauté

gcc

GCC compiler skill for C/C++ projects. Use when selecting optimization levels, warning flags, debug builds, LTO, sanitizer instrumentation, or diagnosing compilation errors with GCC. Covers flag selection for debug vs release, ABI concerns, preprocessor macros, profile-guided optimization, and integration with build systems. Activates on queries about gcc flags, compilation errors, performance tuning, warning suppression, or cross-standard compilation.

installations
1
GitHub Stars
258
Mis à jour
27 juin