The types of operating systems are very diverse, and the operating systems installed on different machines can range from simple to complex, from embedded systems of mobile phones to large operating systems of supercomputers. Many operating system manufacturers have different definitions of its coverage. For example, some operating systems integrate graphical user interfaces, while others only use text interfaces, treating graphical interfaces as unnecessary applications.
Operating system theory is an active branch of computer science with a long history. The design and implementation of operating system is the foundation and core of software industry.
Modern operating systems usually have a graphical user interface of the drawing device used, and add input devices different from keyboards, such as a mouse or a touch panel. Old OS or performance-oriented servers usually don't have such a friendly interface, but use command line interface (CLI) and keyboard as input devices. The above two interfaces are actually called shells, and their functions are to accept and process the user's instructions (such as pressing a button or typing instructions at the command prompt).
The choice of operating system to install usually has a lot to do with its hardware architecture. Only Linux and BSD can run on almost all hardware architectures, while Windows NT is only ported to DEC Alpha and MIPS Magnum. In the early1990s, the choice of personal computers was limited to Windows series, Unix-like series and Linux. Until today, Linux and Mac OS X are still the most important alternatives.
Mainframes and embedded systems use a variety of operating systems. Recently, many hosts began to support Java and Linux in order to enjoy the resources of other platforms. Recently, from Berkeley Tiny OS, which is used in sensor networks, to Windows CE, which can run Microsoft Office, various schools of thought have launched a fierce debate on embedded systems.
Personal computer: Apple Macintosh-Apple OS X computer, Windows system (Intel platform only), Linux, BSD.
IBM is compatible with PC-Windows, Linux, BSD and Mac OS X (informal support).
Hosts: Burroughs MCP-B5000, IBM OS/360-IBM System/360, Univac Exec8-Univac1108.
Embedded system: Embedded systems use a wide range of operating systems (such as VxWorks, eCos, Symbian OS and Palm OS) and some simplified versions of Linux or other operating systems. In some cases, OS refers to a huge general program with fixed application software built in. In many of the simplest embedded systems, the so-called OS refers to the only application on it.
Unix-like system: The so-called Unix-like family refers to a wide variety of OS, including System V, BSD, Linux and so on. Since Unix is a registered trademark of Open Group, it refers to the operating system that abides by the behavior defined by this company. Unix-like usually refers to an operating system that contains more functions than the original Unix.
Unix system can run under a variety of processor architectures, and has a high utilization rate on server systems, such as workstations in universities or engineering applications. Unix variants of free software, such as Linux and BSD, have become more and more popular recently, and have also made great gains in the personal desktop computer market, such as Ubuntu system.
Some Unix variants, such as HP-UX of HP and AIX of IBM, are designed only for their own hardware products, while SUN's Solaris can be installed on their own hardware or x86 computers. Mac OS X of Apple Computer is a micro-core BSD system derived from NeXTSTEP, Mach and FreeBSD***, which replaces the early non-Unix MAC OS of Apple Computer.
After several years of efforts, the free and open source Unix system gradually encroaches on the professional field of patented software. For example, the IRIX system of ——SGI, a computer animation giant, has been replaced by Project No.9 and Inferno system designed by Linux family and Bell Labs R&D team, which are both used in decentralized expression environment. Unlike other Unix systems, they choose a built-in graphical user interface. Plan 9 is not popular because it was not free software when it was first introduced. Later, after the release of the free open source software license Lucent Public License, a large number of users and communities began to emerge. Inferno has been sold to Vita Nuova and distributed under the license of GPL/MIT.
At present, among the top 500 computers in the world, 472 use Linux, 6 use Windows, and the rest are Unix such as BSD.
Microsoft Windows: Microsoft Windows series operating system is a graphical operating system based on MS-DOS designed by Microsoft for IBM machines. The current Windows systems, such as Windows 2000 and Windows XP, are all created in the modern Windows NT kernel. The NT kernel is borrowed from OS/2 and OpenVMS. Windows can run on 32-bit and 64-bit Intel and AMD processors, but earlier versions can also run on DEC Alpha, MIPS and PowerPC architectures. Although the market share of Windows has declined due to people's increasing interest in open source operating system, by 2004, Windows operating system had occupied 90% of the global desktop operating system market. [3]
Windows system is also used for low-level and middle-level servers, and supports some functions such as database service of web service. Recently, Microsoft has spent a lot of R&D funds to enable Windows to run large enterprise programs.
Apple Mac OS: Mac OS is an operating system running on Apple Macintosh series computers. Mac OS is the first successful graphical user interface in the business field.
Chrome OS: Google Chrome OS is a lightweight computer operating system project of Google, based on the Linux kernel of Google browser Chrome.
Process management: Both resident programs and application programs run on the basis of process. When building a computer using the von Neumann structure, each CPU can only run one process at a time. Early OS (such as DOS) did not allow any program to break this restriction, and DOS only had one process running at the same time (although DOS claimed to have the ability to terminate and wait for a pause (TSR), which could partially and difficultly solve this problem). Modern operating system, even with only one CPU, can run multiple processes at the same time by multi-tasking function. Process management refers to the function of the operating system to adjust complex processes.
Because most computers only contain a central processing unit, in the case of a single core, multiple processes just switch processes quickly so that each process can run. In the case of multi-core or multi-processor, all processes are transformed on each processor or kernel through many cooperative technologies. The more processes are running at the same time, the smaller the proportion of time each process can allocate. Many OS will encounter this problem, such as intermittent sound effects or mouse jumping (called system bump, the OS can only keep running its own management program and run out of system resources, and other users or hardware programs can't run). Process management usually practices the concept of time sharing, and most operating systems can change the time sharing ratio of each process by specifying different privilege levels. The higher the privilege, the higher the priority of operation and the higher the proportion of unit time. Interactive OS also provides a feedback mechanism to a certain extent, which makes the process that interacts directly with users have higher privilege value.
In addition to process management, OS is also responsible for IPC, abnormal process termination, deadlock detection and handling.
There are still problems with running threads under the process, but most OS will not deal with the problems encountered by running threads. Usually, OS only provides a set of APIs for users to operate themselves or control the interaction between running threads through the management mechanism of virtual machines.
Memory management: According to Parkinson's law: "If you give a program more memory, the program will try its best to use it up", so programmers usually want the system to give him unlimited and infinitely fast memory. Most modern computer memory architectures are hierarchical, with the fastest and least number of registers ranked first, followed by cache, memory and the slowest disk storage devices. The memory management of operating system provides the functions of searching available memory space, configuring and releasing memory space, and exchanging the contents of memory and low-speed storage devices. This function, also known as virtual memory management, greatly increases the available memory space of each process (usually 4GB, although the actual amount of RAM is much smaller). However, it also brings the disadvantage of slightly reducing the operation efficiency, and even leads to process collapse in serious cases.
Another key activity of memory management is to manage virtual locations with the help of CPU. If there are multiple processes stored on the memory device at the same time, the operating system must prevent them from interfering with the memory content (unless they run in a controllable range through some protocols, limiting the accessible memory range). Partition memory space can achieve the goal. Each process will only see that the entire memory space (from 0 to the maximum limit of memory space) is configured for itself (of course, some locations are reserved by the OS and access is forbidden). The CPU stores several tables in advance to compare the virtual location with the actual memory location. This method is called paging configuration.
By creating a separate and independent location space for each process, the operating system can also easily release all the memory occupied by the process at once. If the process does not release memory, the operating system can quit the process and automatically release memory.
Disk and file system: the so-called file system usually refers to the system that manages disk data, and can store data in the form of directories or files. Each file system has its own special format and functions, such as log management or diskless reorganization.
The operating system has many kinds of built-in file systems. For example, Linux has various built-in file systems, such as ext2, ext3, ext4, ReiserFS, Reiser4, GFS, GFS2, OCFS, OCFS2, NILFS and Google File System. Linux also supports non-local file systems, such as XFS, JFS, FAT series and NTFS. On the other hand, the only file systems that Windows can support are FAT 12, FAT 16, FAT32 and NTFS. NTFS system is the most reliable and efficient file system on Windows. Other FAT families are older than NTFS, which has great restrictions on file length and partition disk capacity, thus causing many problems. The file system of UNIX is mostly UFS, and Solaris, a branch of UNIX, recently began to support a new type of ZFS.
Most of the above file systems have two construction methods. The system can be built in a log file system or a non-log file system. Log file system can run system recovery in a more secure way. If a file system without a log encounters a sudden system crash, resulting in data creation stopping halfway, the system needs a special file system checking tool to undo it; Log types can be automatically replied. Microsoft's NTFS and Linux's ext3, ext4, reiserFS and JFS are log file systems.
Each file system implements a similar directory/subdirectory architecture, but there are many differences under similarity. Microsoft uses the \ "symbol to create a directory/subdirectory relationship, and the file name ignores the case difference; UNIX systems use "/"to create directory patterns, and file names are different in case.
Network: Many modern OS have the ability to run the mainstream network communication protocol TCP/IP. In other words, such an operating system can enter the network world and share resources such as files, printers and scanners with other systems.
Many OS also support various network communication protocols in the past network enlightenment era, such as SNA founded by IBM, DECnet architecture set by DEC in its system, and special communication protocol developed by Microsoft for Windows. There are also many communication protocols developed for special functions, such as NFS system, which can provide file access on the network. Nowadays, a large number of UDP protocols are used for streaming media and game message transmission.
Security: Most operating systems contain some information security mechanisms. The information security mechanism is mainly based on two concepts:
Operating system provides direct or indirect access to various resources for the outside world, such as files on local disk drives, protected privileged system calls, private data of users and services provided by programs run by the system.
The operating system can authorize resource access requests. Allow the authentication request, reject the illegal request that cannot pass, and grant the appropriate authority to the request. The authentication mechanism of some systems simply divides resources into privileged and non-privileged, and each request has a unique identification number, such as user name. Resource requests usually fall into two categories:
Internal resource: usually a resource request from a running program. On some systems, once the program can run, it can do anything (such as viruses in the DOS era), but usually the OS will give the program an identification code, and when the program makes a request, it will check the relationship between its code and the access rights of the required resources.
External sources: resource requests from non-local computers, such as remote login to local computers or some network connection requests (FTP or HTTP). In order to identify these external requests, the system can put forward authentication requirements for the requests. User name and corresponding password are usually required. The system sometimes uses other authentication methods, such as magnetic cards or biometric data. In some cases, such as network communication, resources (such as anonymous FTP servers or P2P services) can usually be accessed without authentication.
In addition to the security mechanism in the form of allow/deny, the high-security system will also provide recording options, allowing recording of various requests to access resources (for example, "Who has read this file?" )。
Because military and commercial organizations record sensitive data on computers, security mechanism has been a long-term concern and discussion issue in the history of operating systems. The United States Department of Defense (DoD) established the Trusted Computer System Evaluation Program (TCSEC), which established the basic principles for evaluating the effectiveness of security mechanisms. This is very important for the author of the operating system, because TCSEC is a standard program for evaluating, classifying and selecting computer systems that process, store and obtain sensitive or confidential data.
Internal information security: Internal information security can be regarded as a means to prevent running programs from accessing system resources at will. Most OS allows ordinary programs to directly operate the CPU of a computer, so some problems have arisen, such as how to forcibly stop programs that can handle transactions like OS and run the same special instructions. After all, in this case, OS is just another equal program. The CPU produced for general-purpose OS usually practices the concept of special instruction protection to some extent at the hardware level. Usually, programs with lower privilege level will be blocked when they want to run some special instructions, such as directly accessing external devices such as hard disks. Therefore, the program must require the operating system to run special instructions to access the disk. Therefore, the operating system has the opportunity to check the identity of the program and accept or reject its request accordingly.
On the hardware that does not support special instruction architecture, another and only protection method is that the OS does not directly use the CPU to run the user's program, but simulates a CPU or provides a P code system (pseudo-code running machine) to make the program run on the virtual machine like Java.
Internal security mechanism is particularly important in multi-user computers: it allows each system user to have his own personal files and directories, and other users cannot access or delete them at will. Because any program may bypass the monitoring of the OS, it is more likely to bypass the monitoring of the side recording program, and the internal security mechanism with coercive force is also very important when the side recording is started.
External information security: Usually, an operating system will provide (host) various services for computers or users on other networks. These services are usually provided by digital access points behind ports or operating system network addresses. Generally, this service includes file sharing (NTFS), print sharing, e-mail, web services and file transfer protocol (FTP). The forefront of external information security is hardware devices, such as firewalls. Many kinds of software firewalls are usually set inside the operating system. Software firewalls can be set to accept or reject connections between services running on the operating system and the outside world. Therefore, anyone can install and run some unsafe network services, such as Telnet or FTP, and set up a mechanism to block all other connections except some private channels to prevent bad connections.
User interface: Most operating systems today include a graphical user interface. There are several older OS that closely combine the graphical user interface with the core, such as the earliest Windows and Mac OS implementation products. This method can provide faster graphics response ability, and it is labor-saving without cutting the module, but it will have strong side effects, such as the collapse of the graphics system will lead to the collapse of the whole system, such as the blue screen of death. Many modern OS have been modularized, separating the subsystem of graphical interface from the core (it is known that Linux and Mac OS X were originally designed in this way, and some extended versions of Windows finally adopted this method).
Many operating systems allow users to install or create any graphical interface they like. Most Unix and Unix-derived systems (BSD, Linux and Minix) usually use GNOME or KDE desktop environment to install X Window system. However, some operating systems do not have such a flexible graphical user interface, such as Windows. This kind of OS can only change its graphical user interface through extra programs, or even only change the menu style or color configuration at all.
Graphical user interface keeps pace with the times. For example, every time a new version of Windows comes on the market, its graphical user interface will change, and the GUI of Mac OS will also undergo major changes when Mac OS X comes on the market.
Driver: The so-called device driver refers to a kind of computer software designed to interact with hardware. Usually, it is a well-designed equipment interactive interface, which provides the equipment with the functions of ordering and receiving information by using the computer collection subsystem or communication subsystem connected with the hardware; And ultimately provide messages to the operating system or applications. Driver is software designed for specific hardware and specific OS, which usually runs under the OS kernel in the form of operating system core module, application software package or ordinary computer program, so as to achieve the effect of transparent and smooth interaction with hardware, and provide an interrupt handler needed by hardware when dealing with asynchronous time-varying hardware interfaces.
The main purpose of driver design is abstract operation. Any hardware module, even the same equipment, has great differences in hardware design. Newer modules introduced by manufacturers are usually more reliable and efficient, and the control methods will be different. Computers and their operating systems often can't predict the difference between existing devices and new devices, so they can't know their operation methods. In order to solve this problem, the OS usually actively sets the operation mode of each device, and the function of the driver is to translate the behavior descriptions set by the OS into a custom operation mode that the device can understand.
Once the theoretically appropriate driver is installed, the corresponding new device can run without error. This new driver can make this device fit perfectly in the OS, so that users don't realize that this is a function that the OS didn't have originally.