Operating System exam summary

introduction

concept

Bare : no computer system software support.

Virtual Machine : software simulation of a complete hardware system functions, run a full computer system in a completely isolated environment.

Operating system : a computer system to manage and control hardware and software resources,

System Software computer rational organization of work processes, to provide users with a powerful, easy to use, scalable, secure working environment, is an interface between the user and the computer

Operating system history

Manual stage : the input and output tapes or cards, CPU utilization rate

Single-batch phase : for a loaded tape or disk, usually made up of several jobs to make up, peripherals busy depending on the operating characteristics

Online Batch : submit paper tape, tape output, CPU wait

Offline batch : Satellite machine is responsible for a scratch tape, in parallel with the host

Channel: a special means for controlling the processing of data transfer between I / O devices and memory. The channel has a dedicated instruction i / o implemented with the CPU instructions in parallel work

Multi-channel Batch : multi-channel (memory storing a plurality of jobs simultaneously) concurrently,

Advantages: CPU and memory utilization of high heavy workload per unit time

Disadvantages: but the poor interaction (when the system error interrupts)

Time-sharing system : multiple users share the same computer, multiple programs to share resources, time slice allocated short, so that each user are occupied because the host

Real-time systems : a short response time, resource utilization is low

General-purpose operating systems : to improve the handling capacity

Common mode: timeshare / real (foreground) + batch (background)

Concurrency : Parallel macroscopically (in operation, no operation End), serial microscopically

Two or more events occur within the same time interval, parallel: the same time

Synchronization : asynchronous environment, a set of concurrent processes cooperate with each other, waiting for each other's execution

The operating system type

  • • Multi-channel batch operating systems (batch processing system)
  • • sharing operating system (time-sharing system)
  • • RTOS (real time system)
  • • general-purpose operating system (multi-purpose system)
  • • Single-user operating system (single user system)
  • • Network operating system (network operating system): target communicate with each other, share resources, to provide network services
  • • distributed operating system (distributed operating system): tightly coupled (+ memory plurality CPU), loose (1CPU memory + 1)
  • • multiprocessor operating system (multi-processor system)

Job consists of:

  • By a program operating instructions, data and operations
  • Generating job control block JCB

Operating System Features

Concurrency

Shared: the plurality of programs share various hardware and software resources of the system, under the coordination and control of the operating system.

Virtual of: a physical device into multiple logical devices.

Uncertainty

Wherein execution of the program order

  • * Sequential
  • * Closed
  • * Reproducibility

Input and output:

Line input and output: a complete, another input

Off-line input and output: buffer memory (USB) + I / O + host; artificial not intervene

Direct coupling: common memory host + + I / O, manual intervention may be

Spooling system: DMA input buffer + channels or wells, Virtual Storage

Network online system: The above method joint

Process Management

Program: the computer used to describe the individual functions to be completed, and the operation sequence according to the order before and after the collection of computers on a strict time sequentially, a static concept.

Process : program of concurrent execution of allocation and management of resources of the basic unit during execution.

Features: dynamic, complicated

Process control block the PCB : flag exists process data structure, where all the information needed to save the system management processes.

Content description information, control information, resource management information, CPU protection site structure

Process context physical environment and support the process of physical entities collectively referred to as the process of running the process context.

Overhead : run the operating system program completion time and space systems management spent.

initial

Þ ready to run: due priority, time slice to obtain processor

Þ ready to run: deprivation processor

Run Þ wait: apply resources are not, start I / O

Þ ready to wait: the availability of resources, I / O interrupts

termination

Deadlock

Multiple processes competing for resources due to the stalemate caused by, without external force, the process can not advance

A necessary condition for deadlock: Resources exclusive, non-preemptive, to maintain the application, wait loop

** Treatment Method: ** occur: Deadlock prevention - static policy (destruction of one, resource sharing embodiment four conditions), deadlock avoidance - dynamic policy (allocation, the dynamic prediction)

It does not occur: deadlocks and recovery test

Deadlock recovery: reboot, terminate the thread, deprived of resources + fallback process

There are certain deadlock loop ( when the number of resource class instance for each unique time )

PV statements

P application, V release resources when the value> 0, when executed, or wait another statement execution

Here Insert Picture Description

Banker's algorithm

work operation resources

max maximum resource limit = need still need + allocation of resources allocated resources

REQUEST request Number

available resources can be used

Thread

(Advanced) Job Scheduling

  • System status of each job record.
  • Choose from backlog in the part of the job into execution.
  • Was selected for the job well prepared before execution.
  • After the implementation of rehabilitation, recovery resources

(Intermediate) exchange scheduling

Situation conversion

(Low-level) process scheduling

meaning

  • Implementation of the system of record for all processes
  • Possession processor selection process
  • Carried out a process context switch

opportunity

  • 1) Run the end of the implementation process or can no longer perform due to some event
  • 2) running process calls the blocking primitives (active waiting), P, V primitive
  • 4) Run the process initiated by I / O requests (resource wait)
  • 5) the time sharing system has run out of sheets
  • 7)就绪队列中的某个进程的优先级别高于当前执行进程的

处理机调度

调度算法

  1. FCFS先来先服务
  2. 轮转(分相同时间)
  3. 多级反馈轮转法(分不同时间)
  4. SJF优先级法(动态、静态优先数(优先数是否改变))
    1. 非剥夺式静态优先数,获得处理机的进程运行,直至终止
    2. 剥夺式动(静)态优先数获得处理机的进程运行,直至终止或更高优先级
  5. 短作业优先法
  6. HRN高响应比优先法(FCFS和SJF折中)

分时调度算法

  1. 时限调度算法(C/T之和<=1)以较短频率程序为主
  2. 频率单调调度算法(C/T之和<=n(2pow(1/n)-1))为每一个程序分相同时间段

计算

周转时间=等待时间+执行时间

周转时间=作业完成时间—作业进入时间

带权周转时间:作业的周转时间/CPU为其提供服务的服务时间

存储管理

存储管理的功能

  • 虚拟存储
  • 地址变换
  • 内外存数据传输的控制
  • 内存的分配与回收
  • 内存信息的共享与保护

分区管理

静态

Here Insert Picture Description

动态

Here Insert Picture Description

动态分区分配与回收算法

  1. 最先适应法,最先使用前面地址
  2. 最佳适应法,最先使用小空间地址
  3. 最坏适应法,最先使用最大地址

优缺点

  • 实现内存共享

    硬件支持少

  • 内存利用率不高

    作业或进程的大小受分区控制

    无法实现区间的信息共享

覆盖和交换技术

内存扩充方法

页式管理

基本原理

进程的虚拟空间被划分成若干个长度相等的页。

分页管理的重点在于页划分后的地址变换以及页面的调入调出技术。

静态

过程:页号——页面号——相对地址——绝对地址

页表:页号、页面号

请求表:进程号、请求页面数、页面起址、页表长度、状态(是否分配)

动态

加中断位

优缺点

  • 不用连续存放,解决了碎片问题

    ​ --实现了内外存的统一管理

  • 要求硬件支持

    ​ --增加系统开销

    ​ --请求调页的算法如不当选择,可能抖动

    ​ --最后一页有浪费。

段式与段页式

段式结构

Segment table ( each process a ): end of the first site, length

Free list (system)

Block table: Block number, the first end address, the segment length

Shared segment table:

Advantages and disadvantages

  • And dynamic management is the same with virtual reality
  • The same function information can be shared terminal
  • Large hardware overhead
  • By available memory size of the control region

Paragraph of page

Page Segment superior formula: protection and easy to share

Page type is superior stage: the elimination of "fragmentation" problem

Section of page: Each course consists of several segments; each segment contains several pages

Guess you like

Origin blog.csdn.net/weixin_45320238/article/details/93777388