1, say the Linux kernel

Source: Internet
Author: User

1. What is the difference between the kernel and the release? What is the operating system
    • Linux, Windows, Android, Ucos is the operating system
    • The operating system is essentially a program, consisting of a number of source files that need to be compiled to connect to the operating system program (Vmlinz, Zimage)
    • The main function of the operating system is to manage the computer hardware and provide the operating environment for the application.
Operating system core Features:
    • Memory management. If there is no operating system, memory needs to be managed by the program itself. For example, in the Uboot to use the memory where is their own casual use, no registration and no restrictions. The program logic error occurs when the program accidentally reuses the same piece of memory. After the system is big (memory is more) memory management is very troublesome, with the operating system, the operating system is responsible for controlling all the memory, all applications need to use memory to the operating system to apply and register, by the operating system memory management module to allocate memory for you to use, The benefit is that memory usage does not conflict.
    • Process scheduling. The operating system supports multiple applications running at the same time (so you can chat QQ while watching movies ...) ), which is macroscopic on the parallel. In fact, on a single core CPU is not parallel on the micro, macro-parallel is the operating system provides time-sharing mechanism. The process scheduling module of the operating system is responsible for switching between the various processes.
    • Hardware Device Management. No operating system to control any hardware to write their own code, the operating system after the operating system itself to control the hardware, the application does not have to consider the specifics of the hardware. The Hardware Device Management module of the operating system is the driver module.
    • File system. A file system is a way to manage storage devices. A storage device consists of a number of sectors, each of which has 512/1024/2048/4096 bytes, and the storage device is read and written in sector units. If there is no file system, the program will go to read and write to the sector, you have to remember which file in which sector. With the file system, we don't have to focus on the sector anymore, people just focus on the directory and file name in the file system, not on which sector of the physical disk the file is on.
Operating system expansion Features:
    • Protocol stack
    • A useful application package. The application itself is not part of the operating system kernel, and the application is intended for human use and for a certain function. For example, the ping program is used to test whether the network is connected, and the Ifconfig program configures the NIC.
The difference between the kernel and the release version
    • Difference: Kernel is the operating system kernel abbreviation, the kernel is responsible for implementing the core functions of the operating system (resource management module, such as memory management, scheduling system ... ), the kernel does not include applications. So it's not possible for a kernel person to do anything, because people do everything through the appropriate application. So the people who sell the operating System package the kernel with some common applications for ordinary users, which is the operating system's distribution (that is, the operating system in the ordinary sense).
    • There is only one kernel. www.kernel.org
    • There are lots of distributions. such as Ubuntu, Redhat, SuSE, CentOS
2. Kernel and driver-related learning Linux ideas
    • Have an understanding of the vast whole. Learning route is to build the framework and the whole, and then gradually learn the details of each part, gradually refinement.
    • The role of each layer should be clear.
    • To understand the association between the layers and call each other.
Drive part of the kernel
    • Driver is the Hardware Device Management module in the kernel
    • The drive works in the kernel state.
    • Driver failure can cause the entire kernel to crash
    • Driver vulnerabilities can make the kernel unsafe
3. Relationship between kernel and application, root file system application and kernel
    • The application is not part of the kernel, but on top of the kernel
    • The application works in a user state and is restricted.
    • Application failure does not cause kernel crashes
    • Applications invoke kernel work through kernel-defined API interfaces
    • Summary 1: The application is the ultimate goal
    • Summary 2: The kernel is the attendant that provides the underlying resource management for the application
Kernel and Root file system
    • The root file system provides the root directory.
    • Process 1 is stored in the root file system
    • The kernel boot will eventually mount the root filesystem.
    • Summary: The root file system provides many of the necessary resources for operating system startup: root, Process 1
Modular design of 4.linux cores what is modular design
    • Because the Linux kernel is huge, the code is large, it's a lot of stuff, and if the design is completely integrated (tightly coupled between individual files and functions), the complexity is beyond the scope of what people can understand. So modular design is also a necessity.
    • Modular design is the kernel of each function module in the code is independent of each other, for example, the scheduling system and memory management system does not have a global variable reference, and even function calls are very few, even if there are also follow an interface specification. The purpose of modular design is to realize the loose coupling of functional modules.
The embodiment of modular design
    • Can be cropped when configured. The Linux kernel can be configured before compiling, and the configuration can be configured with the choice of the thousands of modules that make up the kernel each one or the other. After that, there are a few more details to configure.
    • Modular compilation and installation. For ease of operation, gradually from the static upgrade to a dynamic upgrade (no need to restart the system, but also do not need to re-burn the system). This dynamic upgrade is also supported by modularity.
    • The source code uses conditional compilation. This has already been seen in the uboot.
The benefits of modular design
    • Ability to cut, flexibility
    • Scalability (Dynamic on-load, new hardware support)
    • Facilitates collaboration
Modular design is a universal system design principle 5. Select the appropriate version of kernel Linux kernel version change history
    • linux0.01. First edition
    • linux0.11. Many of the Linux kernel source code parsing books are based on this version of the original. "The art of graphic Linux kernel design"
    • linux2.4. Compared to the modern version, many classic books are based on the 2.4 kernel, such as "LDD3". The late kernel of linux2.4 will often come across useful in previous years.
    • linux2.6 early. The early 2.6 and the late 2.4 kernel are quite similar.
    • Late linux2.6. The late kernel of 2.6 has some changes to the earlier kernel, especially the driver-related parts and the location of some header files. The late kernel of 2.6 is now more mainstream.
    • linux3.x 4.x
How to choose the right kernel version
    • Not the newer version of the kernel the better
    • Selecting the SOC Manufacturer migration version reduces effort
s5pv210 Applicable kernel version
    • 2.6.35.7+android2.3/qt4.8.3
    • 3.0.8+android4.0
This session uses the 2.6.35.7 version of the kernel to explain

1, say the Linux kernel

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.