Skip to content
Search

Linux:Kernel

lastmod 2025-09-18created 2015-01-2845 edits

Interactive map of Linux kernel

The Linux kernel is an open-source, monolithic, Unix-like computer operating system kernel. Linux-family operating systems are based on this kernel and are deployed, usually in the form of Linux distributions, on traditional computer systems such as personal computers and servers as well as on various embedded devices such as routers, wireless access points, PBXs, set-top boxes, FTA receivers, smart TVs, PVRs, and NAS appliances. The Android operating system for tablet computers, smartphones, and smartwatches uses services provided by the Linux kernel to implement its features. Although their adoption on desktop computers is relatively low, Linux-based operating systems dominate almost every other computing sector, from mobile devices to mainframes. As of November 2017, all of the world's 500 most powerful supercomputers run Linux.

The Linux kernel was conceived and developed in 1991 by Linus Torvalds for his own personal computer, with no cross-platform intentions, but it has since expanded to support a wider range of computer architectures than any other operating system or kernel. Linux rapidly attracted developers and users who adopted it as the kernel for other free software projects, notably the GNU operating system. The Linux kernel has received contributions from nearly 12,000 programmers from more than 1,200 companies, including some of the largest software and hardware vendors.

The Linux kernel API, the API through which user programs communicate with the kernel, is meant to be very stable and not to break userspace programs (some programs with GUIs that rely on other APIs). As part of the kernel's functionality, device drivers control the hardware; that is, mainstream device drivers are meant to be very stable. However, unlike many other kernels and operating systems, this does not mean that the interface between the kernel and loadable kernel modules (LKMs) is designed to be very stable.

Developed by contributors worldwide, the Linux kernel is a prominent example of free and open-source software, and depending on the version it is supported for up to 6 years. Day-to-day development discussion takes place on the Linux kernel mailing list (LKML). The Linux kernel is released under the GNU General Public License version 2 (GPLv2), and includes some firmware images released under various non-free licenses.

Linux Features

  • libc and the standard header files are not available. Instead, common libc functions are implemented inside the kernel.
  • Uses GNU C.
  • No memory protection.
  • Floating-point arithmetic cannot be used easily.
  • Uses a small, fixed-size stack.
  • Supports asynchronous interrupts, is preemptive, and supports symmetric multiprocessing. (Synchronization and concurrency issues must be considered.)
  • Portability (Endian, 64bit, WORD, Paging, etc) must be considered.

master branch

The Linux kernel master branch can be found here.
For reference, the clone addresses are as follows.

Category

Linux v0.01

The Linux kernel is a huge open-source project of 36 million lines, but the first version was 10239 lines (8670 excluding comments/blank lines)

Thanks to its simplicity, Linux v0.01 is a good starting point for learning the internals of a Unix-style OS kernel

  • v0.01 has only 66 system calls
    • File/directory creation, deletion, writing
    • chmod, chown, pipe, fork, execve
    • No network support, since the socket concept had not been introduced
    • mount not yet implemented
  • Hard-coded for the Intel 386 architecture (the author of MINIX criticized this)
    • strcpy is coded in assembly using i386 instructions
  • Supports only PC/AT devices
    • CMOS, PIT (Programmable Interval Timer), ATA (PIO), VGA (text mode), Intel 8042 PS2 keyboard (assembly)
    • No drivers folder yet; hard-coded into the subsystems
  • The Makefile has a comment with "FREAX" Kernel, the name Linus originally gave it
  • Only the MINIX file system is supported (ext was inspired by MINIX)
  • The scheduler code has a comment saying "This is pretty good code that works in all environments, so there should be no reason to change it!"
    • Of course, it has since been modified as various improvements and algorithms were introduced, so this prophecy was wrong
  • The kernel panic implementation is just 5 lines: prints "Kernel panic: reason" and halts the system with for(;;)
  • There is a part that calls fork(2) in kernel space
    • It looks that way, but the trick is actually the move_to_user_mode() before it
  • Linus had no machine with more than 8Mb of RAM (he couldn't test it since he didn't have one, so those who do should give it a try..)
  • Hard to compile with modern toolchains
    • GCC is backward compatible, but not enough
    • Linus had his own GCC with an option called -mstring-insns (probably an option supporting x86 string instructions)

Documentation

The Linux Kernel (David A Rusling) Korean translation
Netmemo :: The Linux Kernel (Korean translation of The Linux Kernel)
The_Linux_Kernel-David_A_Rusling-ko.pdf

See also

Favorite site

Tunning

Articles

  • Object-oriented design patterns in C and kernel development | GeekNews
    • [Original] Object-oriented design patterns on OSHub
    • Object-oriented design patterns enable polymorphism and modularity even in kernels written in C, allowing flexible system design
    • Uses vtables (virtual function tables) to standardize device and service interfaces, supporting various behaviors through dynamic changes at runtime
    • Kernel services and the scheduler provide consistent interfaces such as start, stop, and restart through vtables, encapsulating implementation details
    • Combined with kernel modules, supports dynamic driver loading, allowing the system to be extended without recompilation
    • This approach offers flexibility and freedom to experiment, but the clutter from complex syntax and explicit object passing is a drawback

References


  1. Wiki.kldp.org-EmbeddedKernel.zip ↩

  2. Kernel_2.6_makefile_analyze.pdf ↩

  3. LPC_2019_kernel_fastboot_on_the_way.pdf ↩

author Zer0 sitemap