Linux Kernel Common Sense You Must Know

Source: Internet
Author: User
Keywords linux linux kernel linux kernel common sense
First, kernel function, kernel release
1. What is an operating system?
(1) Linux, windows, android, ucos are operating systems;

(2) The operating system is essentially a program consisting of many source files, which need to be compiled and linked into operating system programs (vmlinz, zImage);

(3) The main function of the operating system is to manage computer hardware and provide a running environment for applications.

Must-know Linux kernel common sense detailed explanation

2. Operating system core functions (management resources)
(1) Memory management

If there is no operating system, the memory needs to be managed by the program itself. For example, which memory to use in uboot is determined by the program itself, and there is no registration or restriction. At this time, if the program accidentally reuses the same block of memory, program logic errors will occur.

With the operating system, the operating system is responsible for controlling all memory. When an application needs to use memory, it must apply and register with the operating system, and the memory management module of the operating system will allocate the memory. The advantage of this is to ensure that memory usage will not conflict.

(2) Process scheduling

The operating system supports multiple applications running at the same time, which is a macroscopic parallelism. In fact, it is impossible to parallelize on a single-core CPU at the micro level. The parallel at the macro level is the time-sharing multiplexing mechanism provided by the operating system. The process scheduling module of the operating system is responsible for switching between processes.

(3) Hardware equipment management

When there is no operating system, you must write your own code to control any hardware. With the operating system, the operating system itself will control each hardware, and the application does not need to consider the specific details of the hardware.

The hardware device management module of the operating system is the drive module.

(4) File system

The file system is a way to manage storage devices. The storage device is composed of many sectors, each sector has 512/1024/2048/4096 bytes, and the storage device reads and writes in units of sectors. If there is no file system, and the program needs to read and write sectors by itself, it has to remember which file is in which sector. With the file system, we no longer need to pay attention to which sector of the physical disk a file is in, only the directory and file name in the file system.

3. Operating system extended functions
(1) Protocol stack

(2) Useful application packages

The application itself is not part of the operating system kernel.

The application program is for human use, for a certain function, for example, the ping program is used to test whether the network is connected, and the ifconfig program is used to configure the network card.

4. The difference between kernel and release
(1) The kernel is short for operating system kernel.

The kernel is responsible for implementing the core functions of the operating system. The kernel does not include application programs.

Therefore, only the kernel cannot be used, because everything is done through the corresponding application.

The person selling the operating system packs the kernel and some commonly used applications together and provides it to ordinary users. This is the release version of the operating system (that is, the operating system in the ordinary sense).

(2) There is only one kernel (), and there are many distributions (integrating different applications, such as ubuntu, redhat, suse, centos...).

Second, the relationship between the kernel and the driver
1. The idea of learning linux
(1) Have an understanding of the huge whole. The learning route is to first establish the framework and the whole, and then gradually learn the details and gradually refine them.

(2) Be clear about the role of each layer.

(3) To understand the association and mutual call between levels.

2. The driver is part of the kernel
(1) The driver is the hardware device management module in the kernel, which is a part of very active development.

(2) The driver works in kernel mode (cpu is running operating system) (the difference from user mode (cpu is running application): different permissions)

(3) Driver failure may cause the entire kernel to crash.

(4) Driver vulnerabilities can make the kernel insecure.

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.