Operating system and operating system kernel

Source: Internet
Author: User
First, preface

Recently read a UNIX and Linux history of the post, although a bit of water, but still put a link to spend a day, and finally the UNIX, Linux, iOS, Android, the difference between the roughly clear, it seems very complex, this post written by the comparison of words, But to understand the development and History of UNIX and Linux is very helpful, after reading this post, despite the knowledge of Unix and Linux from scratch, but found that the operating system this thing is more ambiguous, because the early reading of the "deep understanding of computer systems" and " Operating system two books, understand some of the contents of the operating system, but because of the non-trained, there are many essential concepts do not understand, so this review of the above two books, and some of the information on the Internet, the operating system and operating system core concepts are collated.


second, operating system understanding

understand the operating system: the operating system is to provide users (using the computer) services, so that users can use a variety of applications on the computer (QQ, browser) to operate computer resources (such as QQ needs to use the display resources, download data in the browser requires hard disk resources, At the same time, all of these applications need to use the CPU, the most important resource.

The above sentence can be understood from two aspects, on the one hand, from the operating system itself. actually speaking of the concept of operating system, as non-trained most of us are relatively vague, at the same time feel with this thing is very close, because in each computer has an operating system, you run any application software is inseparable from the operating system, why can not be separated from the operating system. In fact, a computer is a group of resources, you run on the computer application is essentially a variety of computer resources (such as processor, memory, I/O devices, etc.), just for convenience, people have constructed the operating system this thing, because each computer's various resources from different manufacturers, They have different standards, there are different differences, so the application you develop for one type of I/O device cannot run on another computer with different I/O devices, and the operating system perfectly eliminates the disadvantage of this difference and the inability to expand, so logically, The operating system is located in the middle tier of application and computer resources


At the same time, as the middle tier, you must do a good job of the middle tier, so in general, the operating system has two basic functions :

(1) Prevent the hardware from being abused by runaway applications;

(2) provide a simple and consistent mechanism for the application to control complex and often disparate low-level hardware devices

On the other hand, from the computer CPU (processor), the operating system is actually a set of computer programs (can be understood as a collection of many applications, and these applications are basically dealing with hardware), Similar to other computer programs (whether you write your own Helloword applet or an application like QQ, and a large server program), they provide instructions to the processor, and then the processor executes the instructions to complete the functions of these programs, The biggest difference is that the operating system and other programs have different intentions: the operating System program uses other computer resources to control the processor and controls the timing of other programs, prompting the processor to complete the scheduling of the system tasks. But (it also shows that the operating system, in addition to the other program's intentions, the others are the same, so) the processor in order to do any one such thing (refers to the execution of another program), must stop executing the operating system program, to execute other programs (this is actually a process switch), Since the operating system is also a program (process), and any processor can only process one process, so the operating system and other programs (processes) need to dispatch, but the operating system is in the active scheduling, and other programs are passive by the control of the operating system to implement scheduling.


third, operating system kernel

On the two concepts of operating system and operating system kernel, many people try to differentiate and explain, but find it difficult to explain completely (including myself, here just put my own understanding of the collation, what is wrong, I hope you criticize correct, common progress).

Looking at some of the conceptual explanations of the operating system kernel in the online and CS series Books, I understand that:

(1) The operating system includes the operating system kernel (this is inevitable), that is, the kernel program is a subset of computer programs included in the operating system, so the kernel program is a set of computer programs, which are the operating system most often use the basic module, directly dealing with hardware, Consists primarily of those parts that are used to manage storage, files, peripherals, and system resources.

(2) The kernel program always occupies a memory, so that the processor can call these kernel programs at any time;

(3) while operating system in addition to the kernel program, there are other basic components , such as text editor, compiler, used to interact with the user program, etc.

For Point (2), it is possible to introduce a picture of "virtual memory" (P12) interpretation in the book "in-depth understanding of computer systems", as follows:


In the illustration above, in the description of the virtual address space of the process, the topmost sub-region "Kernel virtual memory" is used to store kernel programs and data , this address space is a fixed structure, so for each application (process), has the same structure of the virtual address space, This ensures that each process can invoke the operating system kernel program to complete its function.

The following illustration shows that the operating system kernel is a set of sub-routines of the operating system


In the image above, the operating system's kernel surrounds the hardware, and its outer layer is the system call interface, which is the other component in the operating system other than the kernel.

The following two users about the operating system and operating system core interpretation, the personal feel that the explanation is still relatively good:

(1) The kernel is the basic module of the operating system, which is used to manage system resources. For example, it provides abstraction of the software level (such as manipulation and permission control of objects such as processes, file systems, synchronizations, memory, network protocols, etc.), and abstraction of hardware access (such as disks, displays, network interface cards (NICs)), and operating systems, which extend from the kernel, including the system components that provide the underlying services.

(2) The kernel, is the computer science in the sense of the operating system, directly interacting with the hardware, to provide CPU time slice management, interrupt, memory management, IO management, etc. in general, the operating system contains more things, at least the basic program of user interaction, such as a command line interface and basic instructions (file traversal, process management, etc.), or the graphical interface of the desktop and file browser.


Iv. Summary

In general, an operating system contains the kernel (a system software that provides hardware abstraction layers, disk and file system control, multitasking, and so on) and other computer systems that are required (such as function libraries, compilers, modal tools, text editors, Web servers, and a UNIX user interface (Unix shell), these are all part of the operating system, and each module, such as a compiler, is a separate process running in the operating system. so a kernel is not a complete set of operating systems, for Linux, The Word Linux itself only represents the Linux kernel, but now everyone has the default to understand Linux as a whole Linux system, which is due to historical reasons (specifically, the article mentioned in the preface of this article), This means that people have become accustomed to using Linux to describe the entire Linux kernel, and use the GNU engineering of various tools and applications operating systems (also known as Gnu/linux), and the Linux software based on these components is known as the Linux distribution. In general, a Linux distribution comes out of the Linux kernel and includes a large number of software (kits), such as software development tools, databases, Web servers (such as Apache), X Window, desktop environments (such as GNOME and KDE), Office suites (such as OpenOffice, org) and more.

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.