embedded Linux development Kernel porting (i)--Kernel kernel introduction First,
Linux Kernel1.
Introduction to Linux kernel
Linux kernel is a free and free, POSIX-compliant Unix-like operating system developed by Finnish hacker Linus Torvalds 1991 on the Intel x86 architecture in C language.
Linux The kernel is an integrated kernel (monolithic kernel) system that provides Hardware Abstraction Layer, disk and file system control, multi-tasking, and other functions.system software , not a complete set of operating systems.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/83/5D/wKioL1dx0GvDDdJeAAJsGnSyccI159.png "title=" Picture 1.png "alt=" Wkiol1dx0gvdddjeaajsgnsycci159.png "/>
kernel space and user space are two different states of program execution, which can be transferred from user control to kernel space through system call and hardware interrupt.
2.Linux kernel architecture
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/83/5E/wKiom1dx0QqR6iPkAAORvn7YUAs387.png "title=" Picture 2.png "alt=" Wkiom1dx0qqr6ipkaaorvn7yuas387.png "/>
System Call Interface SCI:
The SCI layer provides a standard set of system call functions for user space to access the linux kernel and build a bridge between user space and kernel space.
Process scheduling Management pm:
the focus of process management is to create processes (Fork, exec), stop processes (Kill, Exit), and control communication between them (signal or POSIX mechanism ). process Management also includes controlling how active processes are shared CPU, that is, process scheduling.
Memory management mm:
The primary role of memory management is to control multiple processes to safely share memory areas
Network protocol stack:
The Kernel protocol stack provides a rich network protocol implementation for Linux.
Virtual File System :
VFS hides the specifics of various file systems, providing a unified interface for file operations.
Device driver:
The device driver module is part of the Linux kernel and is the Hardware Device Management module in the kernel.
Second,
Linux distribution version
Linux distributions are organizations or manufacturers that package Linux kernel with peripheral utilities (Utilities) software and documentation, and provide some system installation interfaces and system configurations, settings andManagement Tools, it constitutes a distribution (distribution) . Distribution of LinuxSubstanceis thatLinuxKernelplus the peripheral utilities that make up theof thepackage. Relative toLinuxKernelVersion , the release version number varies with the publisher, andThe version number of the Linux system kernel is relatively independent. So the SUSE,RedHat,Ubuntu, Slackware and so on are directly said to be Linux is not exact, they are The distribution version of Linux. Under the GPL 's guidelines, Linuxdistributions originate from a kernel and have their own contributions, but none of them have their own copyright. Linux the various releases ( Distribution ), are all used Linus lead the development and release of the same Linux kernel, so there is no compatibility issue at the kernel level. Each version is a different feeling, but only in the outermost layer of the release version is reflected, and not the Linux itself, especially the kernel is not uniform or incompatible.
Some of the most popular official versions are: SUSE, RedHat, Fedora, Debian, Ubuntu, CentOS, Gentoo, Mint wait , users can choose the right Linux distribution based on their experience and preferences.
Third,
modularity of the Kernel
Linux kernel is a large code, extremely complex engineering projects, so each function module needs to be modular design, in order to achieve the function module internal parts of the high cohesion, functional modules between the low coupling.
The modular design of the Linux kernel makes it easy and flexible to cut the kernel of each function module , which can be configured before kernel compilation or Kernel The runtime loads the compiled function modules dynamically into the Kernel the link in the space runs.
Kernelmodule isLinuxKernelan interface provided externally, all referred to as dynamically loadable kernel modules(Loadable Kernel Module,LKM), referred to as KernelModule. Linux kernel can be used to tailor the configuration module as needed before compiling, or the kernel function module can be compiled, in kernel The runtime dynamically loads the link to run in the kernel space.
This article from "Endless life, Struggle not only" blog, reprint please contact the author!
Embedded Linux Development kernel porting (i)--kernel kernel introduction