What is Linux?
Linux is a free and open source UNIX-like operating system kernel. There are currently many different Linux releases that can be installed on a variety of computer hardware devices, from mobile phones, tablets, routers and audio and video game consoles to desktop computers, large Computer and super computer. Linux is a leading operating system kernel. The world's top 10 super computers run Linux kernel-based operating systems.
The Linux operating system is also the most famous example in the development of free software and open source code. As long as the GNU General Public License is followed, anyone and institution can freely use all the underlying source code of Linux, and can freely modify and re-release it.Strictly speaking, the term Linux only represents the Linux kernel, but in fact people are used to using Linux to describe the entire Linux kernel.
Engineering tools and database operating systems (also known as GNU/Linux ).Generally, Linux is packaged into a Linux release version for desktop computers and servers. Some popular mainstream Linux releases, including Debian (and its derivative versions Ubuntu), Fedora and openSUSE. Linux is named after Linus Torvalds, a computer enthusiast.
Instead of What Baidu encyclopedia saysLinux is a clone system of UNIX operating systems. It was born on Linux desktop in 1991 [1] In October 5 (this is the first official release date ). With the help of Internet networks and the joint efforts of computer enthusiasts from all over the world, it has become the most widely used UNIX operating system in the world today, and the number of users is growing rapidly.
Linux is only a kernel, not an operating system. Therefore, let's take a look at what the operating system is composed.
Operating System
Operating System (OS) is a computer program used to manage computer hardware and software resources. It is also the core and cornerstone of the computer System. The operating system needs to handle basic transactions, such as managing and configuring memory, prioritizing supply and demand of system resources, controlling input and output devices, operating networks, and managing file systems. The operating system also provides an operation interface for users to interact with the system. The operating system types are very diverse. The operating systems installed on different machines can be from simple to complex, from mobile phone embedded systems to super computer large operating systems. Many operating system manufacturers have different definitions on its scope. For example, some operating systems integrate a graphical user interface (GUI), while some only use the command line interface (CLI ), the GUI is considered as a non-essential application.
The operating system is located between the underlying hardware and users, and serves as a bridge between the two. You can enter commands on the user interface of the operating system. The operating system explains the commands and drives hardware devices to meet user requirements. In terms of modern standards, a standard PC operating system should provide the following features:
- Process management)
- Memory management)
- File system)
- Network Communication (Networking)
- Security)
- User interface)
- Device drivers)
Let's take a look at the differences between the two. This is a linux architecture diagram. We can find that the kernel is only at the underlying layer.
Almost complete Linux architecture Diagram |
User Mode |
Applications (sh, vi, OpenOffice.org, etc) |
Complex libraries (such as KDE and glib) |
|
|
Simple Library (opendbm, sin, etc) |
|
C library (open, fopen, socket, exec, calloc, etc) |
Kernel Mode |
Software and Hardware messages such as system interruptions, calls, and errors |
Kernel (drivers, processes, networks, memory management, etc) |
Hardware (processor, memory, various devices) |
We can find that the linux kernel + shell can constitute an operating system, and linux itself is only a kernel, that is, the kernel mode in the figure, responsible for controlling these parts of the system. That is, we can find that the Linux Kernel Forms an operating system except the user interface, and shell is the final user interface.
Parts other than the Linux kernel are made up of the GNU program.
For more information, see GNU and its operating system.
China's Computer Culture (III)
Shell
Shell is a system user interface that provides an interface for users to interact with the kernel. It receives user-input commands and sends them to the kernel for execution.
In fact, Shell is a command interpreter that explains the commands entered by the user and sends them to the kernel. In addition, Shell has its own programming language for editing commands. It allows users to write programs composed of shell commands. The Shell programming language has many features of a common programming language. For example, it also has a loop structure and a branch control structure. The Shell program written in this programming language has the same effect as other applications.
Bash is a Unix shell written for the GNU program. Its name is a series of abbreviations: Bourne-Again SHell-this is a puntion about the Bourne shell (sh) (Bourne again/born again ). Bourne shell is an important early shell written by Steve burn around 1978 and released together with Version 7 Unix. Bash was created by Brian fox in 1987. In 1990, Chet
Ramey has become a major maintainer.
Shell will be one of the frequently used tools in GNU/linux for operating computers. Before migrating to linux, we can try cygwin for simulation:
Cygwin is a collection of many free software, initially developed by Cygnus
Solutions Development for Microsoft
Run UNIX-like systems on Windows. Cygwin
GCC
GCC (GNU Compiler Collection, GNU Compiler set) is a programming language Compiler developed by GNU. It is a set of Free Software issued with GPL and LGPL licenses. It is also a key part of the GNU program and a standard compiler for free Unix-like and Mac OS X operating systems on Apple computers. GCC (especially the C language compiler) is often considered as a de facto standard for cross-platform compilers.
GCC, formerly known as the gnu c language Compiler (gnu c Compiler), can only process C languages. GCC quickly expands and becomes capable of processing C ++. Later, it became possible to process Fortran, Pascal, Objective-C, Java, Ada, and Go and other languages.
Like shell, for GNU/linux systems, the role of GCC is irreplaceable. Of course, if it is only for general purpose, GCC may be useless to general users. But on some GNU/Linux systems, we may need to compile the source code into a binary file without a software package, therefore, its importance is self-evident. Naturally, if we compile the GNU/Linux operating system by ourselves, we will understand its significance. If you are interested, try: Linux
From Scratch (LFS ).
Start the boot program
Finally, when we make up the above, we need a boot program to enable the system to start and boot into the kernel.
A bootloader is a program that directs the operating system to start on a computer or other computer applications. The method of starting a program depends on the type of the application model. For example, in a normal PC, a boot program is usually divided into two parts: the first phase of the boot program is located in the Master Boot Record, used to guide the second phase of the boot program located on a partition, such as NTLDR and gnu grub.
After the BIOS is started, bootloader takes over the hardware device initialization and creates a memory space ing to prepare the operating system kernel.
Correct software and hardware environment.
Simple bootloader virtual assembly code, as shown in the following eight commands:
- 0: set the value of P to 8.
- 1: Check whether the tape ({paper tape) Reader can be read.
- 2: Skip to 1 if you cannot read
- 3: Read a byte from the tape reader to the accumulators.
- 4: If it is the end of the strap, jump to 8
- 5: store the value of the temporary storage to the address specified by the value in the P temporary storage.
- 6: Increase the value of P latches.
- 7: Jump to 1
However, as computer operating systems become more and more complex, the MBR space is no longer able to guide the operating system code, so there is a second-stage boot program, the code function in MBR also changes from direct boot to the pilot program that guides the second stage.
Generally, gnu grub is used as the boot program in a GNU/Linux system. For example, GRUB2 is used in Ubuntu.
Gnu grub ("GRUB" for short) is a startup Bootstrap program from the GNU project. GRUB is the implementation of multi-boot specifications. It allows you to have multiple operating systems in your computer and select the operating system you want to run when the computer starts. GRUB can be used to select different kernels on the operating system partition or to pass startup parameters to these kernels.
The predecessor of gnu grub is Grand uniied Bootloader. It is mainly used in Unix-like systems. Like many Linux distributions, the GNU system uses gnu grub as its initiator. Solaris also uses gnu grub as the starter on x86 systems starting from version 10 and 1/06.
The above constitutes a simple operating system.