Operating System 简明教程

Components of Operating System

操作系统有各种组件来执行明确定义的任务。尽管大多数操作系统在结构上各不相同,但从逻辑上来说,它们具有类似的组件。每个组件都必须是系统的明确定义的部分,恰当地描述其功能、输入和输出。

There are various components of an Operating System to perform well defined tasks. Though most of the Operating Systems differ in structure but logically they have similar components. Each component must be a well-defined portion of a system that appropriately describes the functions, inputs, and outputs.

操作系统有以下 8 个组件:

There are following 8-components of an Operating System:

以下部分将更详细地说明上述所有组件:

Following section explains all the above components in more detail:

Process Management

进程是加载到主存储器中的程序或程序的一部分。进程需要某些资源来完成任务,包括 CPU 时间、内存、文件和 I/O 设备。进程管理组件管理在操作系统上同时运行的多个进程。

A process is program or a fraction of a program that is loaded in main memory. A process needs certain resources including CPU time, Memory, Files, and I/O devices to accomplish its task. The process management component manages the multiple processes running simultaneously on the Operating System.

对于进程管理,操作系统负责以下活动:

The operating system is responsible for the following activities in connection with process management:

  1. Create, load, execute, suspend, resume, and terminate processes.

  2. Switch system among multiple processes in main memory.

  3. Provides communication mechanisms so that processes can communicate with each others

  4. Provides synchronization mechanisms to control concurrent access to shared data to keep shared data consistent.

  5. Allocate/de-allocate resources properly to prevent or avoid deadlock situation.

I/O Device Management

操作系统的一个目的是向用户隐藏特定硬件设备的特有之处。I/O 设备管理提供了 H/W 设备的抽象级别,并向应用程序隐藏了详情,以确保正确使用设备,防止错误,并向用户提供方便高效的编程环境。

One of the purposes of an operating system is to hide the peculiarities of specific hardware devices from the user. I/O Device Management provides an abstract level of H/W devices and keep the details from applications to ensure proper use of devices, to prevent errors, and to provide users with convenient and efficient programming environment.

以下是 I/O 设备管理组件的任务:

Following are the tasks of I/O Device Management component:

  1. Hide the details of H/W devices

  2. Manage main memory for the devices using cache, buffer, and spooling

  3. Maintain and provide custom drivers for each device.

File Management

文件管理是操作系统最显着的服务之一。计算机可以使用几种不同的物理形式存储信息;磁带、磁盘和鼓是最常见的形式。

File management is one of the most visible services of an operating system. Computers can store information in several different physical forms; magnetic tape, disk, and drum are the most common forms.

文件被定义为一组相关的信息,由文件创建者定义。文件通常表示数据、源和目标形式以及程序。数据文件可以是任何类型,如字母数字、数字和字母数字。

A file is defined as a set of correlated information and it is defined by the creator of the file. Mostly files represent data, source and object forms, and programs. Data files can be of any type like alphabetic, numeric, and alphanumeric.

操作系统通过管理大容量存储设备,如磁带和磁盘,来实现文件的抽象概念。此外,文件通常被组织到目录中,以方便使用。这些目录可能包含文件和其他目录,以此类推。

The operating system implements the abstract concept of the file by managing mass storage device, such as types and disks. Also files are normally organized into directories to ease their use. These directories may contain files and other directories and so on.

操作系统负责与文件管理相关的以下活动:

The operating system is responsible for the following activities in connection with file management:

  1. File creation and deletion

  2. Directory creation and deletion

  3. The support of primitives for manipulating files and directories

  4. Mapping files onto secondary storage

  5. File backup on stable (nonvolatile) storage media

Network Management

对于网络管理的定义通常较广泛,因为网络管理涉及多个不同的组件。网络管理是管理和管理计算机网络的过程。计算机网络是由相互连接的各种类型的计算机组成的集合。

The definition of network management is often broad, as network management involves several different components. Network management is the process of managing and administering a computer network. A computer network is a collection of various types of computers connected with each other.

网络管理包括故障分析、维护服务质量、提供网络和性能管理。

Network management comprises fault analysis, maintaining the quality of service, provisioning of networks, and performance management.

以下是网络管理的功能:

Following are the features of network management:

  1. Network administration

  2. Network maintenance

  3. Network operation

  4. Network provisioning

  5. Network security

Main Memory Management

内存是一个由大量单词或字节组成的数组,每一个单词或字节都有自己的地址。它是 CPU 和 I/O 设备之间共享的一个快速访问的数据存储库。

Memory is a large array of words or bytes, each with its own address. It is a repository of quickly accessible data shared by the CPU and I/O devices.

主内存是一种易失性存储设备,这意味着在系统发生故障或系统电源断电时,它会丢失其内容。

Main memory is a volatile storage device which means it loses its contents in the case of system failure or as soon as system power goes down.

操作系统负责在内存管理方面执行以下活动:

The operating system is responsible for the following activities in connections with memory management:

  1. Keep track of which parts of memory are currently being used and by whom.

  2. Decide which processes to load when memory space becomes available.

  3. Allocate and deallocate memory space as needed.

Secondary Storage Management

计算机系统的主要目的是执行程序。这些程序及其访问的数据在执行期间必须驻留在主内存中。由于主内存太小,无法永久容纳所有数据和程序,因此计算机系统必须提供辅助存储来备份主内存。

The main purpose of a computer system is to execute programs. These programs, together with the data they access, must be in main memory during execution. Since the main memory is too small to permanently accommodate all data and program, the computer system must provide secondary storage to backup main memory.

大多数现代计算机系统使用磁盘作为程序和数据的在线主存储介质。大多数程序(如编译器、汇编器、排序程序、编辑器、格式化程序等)都存储在磁盘上,直到装入内存中,然后使用磁盘作为其处理的源和目标。

Most modern computer systems use disks as the principle on-line storage medium, for both programs and data. Most programs, like compilers, assemblers, sort routines, editors, formatters, and so on, are stored on the disk until loaded into memory, and then use the disk as both the source and destination of their processing.

操作系统负责在磁盘管理方面执行以下活动:

The operating system is responsible for the following activities in connection with disk management:

  1. Free space management

  2. Storage allocation

Security Management

操作系统主要负责计算机系统中发生的所有任务和活动。操作系统中的各个进程必须受到彼此活动的影响。为了这个目的,各种机制可用于确保文件、内存段、cpu 和其他资源只能由获得操作系统适当授权的进程操作。

The operating system is primarily responsible for all task and activities happen in the computer system. The various processes in an operating system must be protected from each other’s activities. For that purpose, various mechanisms which can be used to ensure that the files, memory segment, cpu and other resources can be operated on only by those processes that have gained proper authorization from the operating system.

例如,内存寻址硬件可确保进程只能在其自己的地址空间内执行。定时器可确保没有进程可以在不放弃的情况下获得 CPU 的控制权。最后,不允许任何进程单独执行 I/O,以保护各种外围设备的完整性。

For example, memory addressing hardware ensure that a process can only execute within its own address space. The timer ensure that no process can gain control of the CPU without relinquishing it. Finally, no process is allowed to do it’s own I/O, to protect the integrity of the various peripheral devices.

Command Interpreter System

操作系统最重要的组成部分之一是其命令解释器。命令解释器是用户和系统其余部分之间的主要接口。

One of the most important component of an operating system is its command interpreter. The command interpreter is the primary interface between the user and the rest of the system.

命令解释器系统通过调用一个或多个底层系统程序或系统调用来执行用户命令。

Command Interpreter System executes a user command by calling one or more number of underlying system programs or system calls.

许多命令都通过控制语句发送到操作系统。一个读取和解释控制语句的程序被自动执行。此程序称为 shell,一些示例是 Windows DOS 命令窗口、Unix/Linux 的 Bash 或 Unix/Linux 的 C-Shell。

Many commands are given to the operating system by control statements. A program which reads and interprets control statements is automatically executed. This program is called the shell and few examples are Windows DOS command window, Bash of Unix/Linux or C-Shell of Unix/Linux.

Other Important Activities

操作系统是一个复杂的软件系统。除了上述组件和责任之外,操作系统还执行许多其他活动。其中一些列在下面:

An Operating System is a complex Software System. Apart from the above mentioned components and responsibilities, there are many other activities performed by the Operating System. Few of them are listed below:

  1. Security − By means of password and similar other techniques, it prevents unauthorized access to programs and data.

  2. Control over system performance − Recording delays between request for a service and response from the system.

  3. Job accounting − Keeping track of time and resources used by various jobs and users.

  4. Error detecting aids − Production of dumps, traces, error messages, and other debugging and error detecting aids.

  5. Coordination between other softwares and users − Coordination and assignment of compilers, interpreters, assemblers and other software to the various users of the computer systems.