Operating System 简明教程
Operating System - Overview
一个 Operating System (操作系统)是在计算机用户和计算机硬件之间的一个接口。操作系统是一个软件,它执行所有基本任务,如文件管理、内存管理、进程管理、处理输入和输出,以及控制磁盘驱动器和打印机等外围设备。
An Operating System (OS) is an interface between a computer user and computer hardware. An operating system is a software which performs all the basic tasks like file management, memory management, process management, handling input and output, and controlling peripheral devices such as disk drives and printers.
操作系统是一种让应用程序与计算机硬件进行交互的软件。包含操作系统核心组件的软件被称为 kernel 。
An operating system is software that enables applications to interact with a computer’s hardware. The software that contains the core components of the operating system is called the kernel.
Operating System 的主要目的是让应用程序(软件)能与计算机硬件进行交互,并管理系统的硬件和软件资源。
The primary purposes of an Operating System are to enable applications (spftwares) to interact with a computer’s hardware and to manage a system’s hardware and software resources.
一些流行的操作系统包括 Linux 操作系统、Windows 操作系统、VMS、OS/400、AIX、z/OS 等。如今,操作系统几乎出现在所有设备中,例如手机、个人电脑、大型机、汽车、电视、玩具等。
Some popular Operating Systems include Linux Operating System, Windows Operating System, VMS, OS/400, AIX, z/OS, etc. Today, Operating systems is found almost in every device like mobile phones, personal computers, mainframe computers, automobiles, TV, Toys etc.
Definitions
我们可以对操作系统进行多种定义。让我们来了解一些定义:
We can have a number of definitions of an Operating System. Let’s go through few of them:
我们可以将此定义优化为如下:
We can refine this definition as follows:
以下是摘自维基百科的另一定义:
Following is another definition taken from Wikipedia:
Architecture
我们可以为操作系统绘制一张通用架构图,如下所示:
We can draw a generic architecture diagram of an Operating System which is as follows:
Operating System Generations
操作系统多年来一直在发展。我们可以根据不同的世代对这种评估进行分类,如下简述:
Operating systems have been evolving over the years. We can categorise this evaluation based on different generations which is briefed below:
0th Generation
第 0 代一词指的是计算发展的时期,当时查尔斯·巴贝奇发明了分析机,后来约翰·阿塔纳索夫在 1940 年创造了一台计算机。该时期的硬件组件技术是电子真空管。这一代计算机没有可用的操作系统,并且计算机程序以机器语言编写。这一代计算机效率低下,并且依赖于各个操作员的不同能力。
The term 0th generation is used to refer to the period of development of computing when Charles Babbage invented the Analytical Engine and later John Atanasoff created a computer in 1940. The hardware component technology of this period was electronic vacuum tubes. There was no Operating System available for this generation computer and computer programs were written in machine language. This computers in this generation were inefficient and dependent on the varying competencies of the individual programmer as operators.
First Generation (1951-1956)
第一代标志着商用计算的开始,包括 1951 年初埃克特和莫奇利 UNIVAC I 的引入,以及稍晚的 IBM 701。
The first generation marked the beginning of commercial computing including the introduction of Eckert and Mauchly’s UNIVAC I in early 1951, and a bit later, the IBM 701.
系统操作是在专家操作员的帮助下进行的,当时还没有操作系统,尽管程序开始使用高级的、面向过程的语言编写,因此操作员的例程得到扩展。后来开发了单程序操作系统,从而消除了运行作业的部分人工干预,并为程序员提供了一些所需的功能。这些系统仍继续在人的操作员控制下运行,他们过去遵循许多步骤来执行程序。约翰·W·巴克斯于 1956 年开发了 FORTRAN 等编程语言。
System operation was performed with the help of expert operators and without the benefit of an operating system for a time though programs began to be written in higher level, procedure-oriented languages, and thus the operator’s routine expanded. Later mono-programmed operating system was developed, which eliminated some of the human intervention in running job and provided programmers with a number of desirable functions. These systems still continued to operate under the control of a human operator who used to follow a number of steps to execute a program. Programming language like FORTRAN was developed by John W. Backus in 1956.
Second Generation (1956-1964)
第二代计算机硬件最显着的特征是晶体管取代真空管作为硬件组件技术。第一款操作系统 GMOS 是由 IBM 计算机开发的。GMOS 基于单流批处理系统,因为它将所有类似的作业收集到组或批次中,然后使用穿孔卡将作业提交给操作系统以完成机器中的所有作业。操作系统在完成一项作业后被清理,然后继续读取并启动穿孔卡中的下一项作业。
The second generation of computer hardware was most notably characterised by transistors replacing vacuum tubes as the hardware component technology. The first operating system GMOS was developed by the IBM computer. GMOS was based on single stream batch processing system, because it collects all similar jobs in groups or batches and then submits the jobs to the operating system using a punch card to complete all jobs in a machine. Operating system is cleaned after completing one job and then continues to read and initiates the next job in punch card.
研究人员开始在其称为分时系统的计算服务中尝试多道程序设计和多处理。一个值得注意的例子是 20 世纪 60 年代初在麻省理工学院开发的兼容分时系统 (CTSS)。
Researchers began to experiment with multiprogramming and multiprocessing in their computing services called the time-sharing system. A noteworthy example is the Compatible Time Sharing System (CTSS), developed at MIT during the early 1960s.
Third Generation (1964-1979)
第三代于 1964 年 4 月正式开始,当时 IBM 宣布了其 System/360 系列计算机。硬件技术开始使用集成电路 (IC),这在速度和经济性方面产生了显着优势。
The third generation officially began in April 1964 with IBM’s announcement of its System/360 family of computers. Hardware technology began to use integrated circuits (ICs) which yielded significant advantages in both speed and economy.
操作系统开发的进展是引入和广泛采用多道程序设计。充分利用计算机数据通道 I/O 能力的想法继续发展。
Operating system development continued with the introduction and widespread adoption of multiprogramming. The idea of taking fuller advantage of the computer’s data channel I/O capabilities continued to develop.
另一项导致第四代个人计算机发展的进步是 DEC PDP-1 的小型计算机新发展。对于计算机硬件和附带操作系统的开发而言,第三代确实是一个激动人心的时代。
Another progress which leads to developing of personal computers in fourth generation is a new development of minicomputers with DEC PDP-1. The third generation was an exciting time, indeed, for the development of both computer hardware and the accompanying operating system.
Fourth Generation (1979 – Present)
第四代以个人计算机和工作站的出现为特征。第三代的组件技术被超大规模集成 (VLSI) 取代。我们今天使用的许多操作系统,例如 Windows、Linux、MacOS 等,都是在第四代开发的。
The fourth generation is characterised by the appearance of the personal computer and the workstation. The component technology of the third generation, was replaced by very large scale integration (VLSI). Many Operating Systems which we are using today like Windows, Linux, MacOS etc developed in the fourth generation.
以下是操作系统的部分重要功能。
Following are some of important functions of an operating System.
-
Memory Management
-
Processor Management
-
Device Management
-
File Management
-
Network Management
-
Security
-
Control over system performance
-
Job accounting
-
Error detecting aids
-
Coordination between other software and users
Memory Management
内存管理是指对主内存或主存储器的管理。主内存由一组单词或字节组成,每个单词或字节拥有自己的地址。
Memory management refers to management of Primary Memory or Main Memory. Main memory is a large array of words or bytes where each word or byte has its own address.
主内存提供一种由 CPU 直接访问的快速存储器。程序需要在主内存中才能执行。操作系统针对内存管理执行以下活动:-
Main memory provides a fast storage that can be accessed directly by the CPU. For a program to be executed, it must in the main memory. An Operating System does the following activities for memory management −
-
Keeps tracks of primary memory, i.e., what part of it are in use by whom, what part are not in use.
-
In multiprogramming, the OS decides which process will get memory when and how much.
-
Allocates the memory when a process requests it to do so.
-
De-allocates the memory when a process no longer needs it or has been terminated.
Processor Management
在多道程序设计环境中,操作系统决定哪个进程在何时获得处理器,以及获得多长时间的处理器。此功能称为 process scheduling 。操作系统针对处理器管理执行以下活动:-
In multiprogramming environment, the OS decides which process gets the processor when and for how much time. This function is called process scheduling. An Operating System does the following activities for processor management −
-
Keeps tracks of processor and status of process. The program responsible for this task is known as traffic controller.
-
Allocates the processor (CPU) to a process.
-
De-allocates processor when a process is no longer required.
Device Management
操作系统通过各个驱动程序管理设备通信。操作系统针对设备管理执行以下活动:-
An Operating System manages device communication via their respective drivers. It does the following activities for device management −
-
Keeps tracks of all devices. Program responsible for this task is known as the I/O controller.
-
Decides which process gets the device when and for how much time.
-
Allocates the device in the efficient way.
-
De-allocates devices.
File Management
文件系统通常根据目录进行整理,以方便浏览和使用。这些目录可能包含文件以及其他的方向。
A file system is normally organized into directories for easy navigation and usage. These directories may contain files and other directions.
操作系统对文件管理执行以下活动 -
An Operating System does the following activities for file management −
-
Keeps track of information, location, uses, status etc. The collective facilities are often known as file system.
-
Decides who gets the resources.
-
Allocates the resources.
-
De-allocates the resources.
Other Important Activities
以下是操作系统执行的部分重要活动 -
Following are some of the important activities that an Operating System performs −
-
Security − By means of password and similar other techniques, it prevents unauthorized access to programs and data.
-
Control over system performance − Recording delays between request for a service and response from the system.
-
Job accounting − Keeping track of time and resources used by various jobs and users.
-
Error detecting aids − Production of dumps, traces, error messages, and other debugging and error detecting aids.
-
Coordination between other softwares and users − Coordination and assignment of compilers, interpreters, assemblers and other software to the various users of the computer systems.