What is the Linux system architecture? __linux

Source: Internet
Author: User
What is the Linux system architecture.


To understand the Linux system, you must have a certain understanding of its system architecture, the following small series on the Linux system to bring the architecture of the explanation, interested friends may wish to understand the next.

I am based on the following diagram to illustrate the Linux Architecture (architecture). (This diagram references "Advanced Programming in Unix Environment")


What is the Linux system architecture.
The most inner layer is the hardware, the outermost is the user commonly used application, for example Firefox browser, Evolution view mail, a computational fluid model and so on. Hardware is the material base, while applications provide services. But in between the two, but also have to go through some setbacks.
Remember Linux startup. Linux first starts the kernel (kernel), the kernel is a computer program, which directly manages the management hardware, including CPU, memory space, hard disk interface, network interface and so on. All computer operations are passed through the kernel to the hardware.
To facilitate the invocation of the kernel, Linux makes the kernel's functional interface a system call. The system call looks like a C-language function. You can call it directly in the program. The Linux system has more than 200 such system calls. Users do not need to understand the complex structure of the kernel, they can use the kernel. System calls are the smallest functional unit of the operating system. An operating system, as well as an operating system based application, is unlikely to achieve the function beyond system invocation. A system call function is like a stroke of Chinese characters. Any Chinese character should be composed of basic strokes (dots, transverse, skimming, etc.). I can't do the Strokes.
Enter $man 2 syscalls on the command line to view all system calls. You can also view the description of the system call read () by $man 2 read. 2 of the two commands indicate that we want to query in Class 2 (the System call Class) (what each class can see through the $man man).
System calls provide a very basic function, so it is cumbersome to use. A simple operation to allocate memory space to a variable requires the use of multiple system calls. Linux defines some library functions (libraries routine) to combine system calls into some commonly used functions. The above allocated memory operation can be defined as a library function (such as a malloc () function). For example, when reading a file, the system call requires that we set the necessary buffers. I can use the Read function in the standard IO library. This read function is responsible for setting the buffer and for using the Read system call function. Using library functions does not have an efficient advantage for machines, but it can save programmers from the details. A library function is like the Chinese character's radical, which consists of strokes, but it is easier to form words, such as "Iron", using the radicals. Of course, you can simply call the system function without using the library function, just like the word "person" without the radical.
(In fact, an operating system needs to have some library functions, such as the ISO C standard library, POSIX standard, and so on, to be called a UNIX system.) )
The shell is a special application. Many users call it the command line. The shell is a command interpreter (interpreter), and when we enter "Ls-l" it interprets the string as
1. Locate the file (/BIN/LS) in the default path,
2. Execute the file with the parameter "-L".
I used the term "redirect" to use | to express the pipe, and also to explain the meaning of & or | by means of a shell. The shell then passes through the system and uses the command kernel to implement specific redirects or pipelines. In the absence of a graphical interface, the shell acts as a user interface, and when the user wants to run certain applications, the shell enters commands to run the program. The shell is programmable, and it can execute text that conforms to the shell syntax. Such text is called a shell script. As you can see in the architecture diagram, the shell system call, the use of various applications, and many of its own gadgets can be used. Shell scripts can implement complex functionality in a few lines.
One of the philosophies of UNIX is to allow each program to do a small function as independently as possible. The shell acts as a "glue" between these small functions, enabling different programs to work together with a clear interface (text flow) to enhance the functionality of each program. This is one of the reasons the Linux veteran has encouraged the novice to use shell more and use less graphical interface.
(Shell also has many kinds, the most common is bash, in addition there are sh, csh, tcsh, Ksh.) They occur in different eras, and the features that are supported vary. )

What is the Linux system architecture.


A terminal that uses the bash shell
A shell corresponds to a terminal (terminal). Once, a terminal is a hardware device that is used to enter and display output. Today, because of the popularity of graphical interfaces, terminals tend to be a graphical window like the one pictured above. You can enter or output text through this window. This text is passed directly to the shell for analysis and interpretation, and then executed.
Finally, we go into the general application. Application is a program that can
1. Call system function directly
2. Call library function
3. Run the shell script
These applications can be developed in a variety of languages. The most common is the C language.
Summarize
Linux uses the kernel to implement the hardware and software dialogue.
This interface, which is called by the system, separates the upper application from the underlying kernel, hides the underlying complexity, and improves the portability of the upper application.
The library function uses the system call to create the modular function,
The shell provides a user interface and allows us to use the syntax of the shell to write scripts to consolidate the program.
The above is the Linux system architecture Introduction, from the picture can be seen, the Linux system mainly by hardware, kernel, system call, Shell, library functions of these parts, through the reading of this article I believe you have a certain understanding of the Linux system.

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.