没有合适的资源?快使用搜索试试~ 我知道了~
1.introduction 2.Operating-System Structures 3.Processes 4.Thread 5.CPU Scheduling 6.Process synchronization 7 Deadlocks 8 Main Memory 9 Virtual Memory 10 File-System Interface 11 File-System Structure 12 Mass-Storage Systems 共12章,60页内容总结,图文并茂,知识点覆盖全面。
资源推荐
资源详情
资源评论
introduction
操作系统的作用
计算机系统可被分为4个部分,即计算机硬件,操作系统,系统程序与应用程序,用户。
用户视角
系统视角
OS是资源分配器
资源:CPU time,memory space,I/O device,file等等
分配和回收资源
解决对资源需求的冲突
使计算机系统高效公平的运行
OS是控制程序
控制程序调用,防止错误和计算机的错误使用
定义
计算机上一直运行的一个程序(内核)
A program that acts as an intermediary (中介)between the application programs and
the computer hardware.
串行 serialization
并发 concurrency 交替
并行 parallel
No. 1 / 60
任务/进程 job/task/process
计算机系统组成
中断
Device controller informs CPU that it has finished its operation by causing an interrupt.
An interrupt is an input signal to the processor indicating an event that needs
immediate attention.
Interrupt transfers control to the interrupt service routine generally, through the
interrupt vector, which contains the addresses of all the service routines.
通过中断向量,把控制转移给合适的中断处理程序
Interrupt architecture must save the address of the interrupted instruction.
A trap or exception is a software-generated interrupt caused either by an error or a
user request.
An operating system is interrupt driven.
DMA 解决过多中断问题,缓解CPU压力
计算机系统结构
单处理器系统
多处理器系统 有多个通用处理器 共享bus,clock,memory,peripheral devices
Increased throughput(吞吐量)
Economy of scale(经济性)
Increased reliability –fault tolerance(可靠性-容错能力)
对称多处理器系统
master管理其他处理器工作 主从关系
非对称多处理器系统 SMP
每个处理器地位平等
操作系统结构
No. 2 / 60
多道运行方式 Multiprogramming
单个任务不能让CPU 或I/O设备一直忙碌,提高了系统的效率,资源利用率,适合batch
computer system 分批处理系统。
One job is selected and run via job scheduling
When the running job has to wait (for I/O operation to complete, for example), OS
switches to another job
As long as at least one job needs to execute, the CPU is never idle
分时运行方式 也叫多任务 Time sharing(Multitasking)
是多道程序设计的逻辑延伸
多道程序设计不提供用户与计算机系统的交互
交互操作系统
提供用户与系统之间的交互,用户通过输入设备向系统发送指令,等待输出设备的即时结果。
相应时间应该比较短
Provide each user/job with a short time in turn
区别
机制不同
在多道处理系统中,为了让系统各部分都去“忙”,尽量让各部分一直处于工作状态,当一
道程序因I/O请求暂停运行时,CPU才去运行另一道程序
而在分时系统中,把处理器的时间分成很短的时间片,时间片用完了,不管是否执行完,
都要进行切换
可以看出多道的切换是主动的,而分时的切换是被动的
目的不同
多道批处理系统的目的是为了解决人机矛盾及CPU和I/O设备之间速度不匹配矛盾,提高
系统有效性(包括资源利用率和吞吐量),并不提供人际交互能力
分时是剥夺,多道是非剥夺
操作系统功能
Modern operating system is interrupt driven
Events is usually signaled by an hardware interrupt(硬中断) or a trap(软中断)
A trap is a software-generated interrupt caused either by an error or a user request
Errors:division by zero or invalid memory access
a user request : request for operating system service (system call)
双模式 Dual-mode
保护os和其他的系统构件
User mode
execution done on behalf of a user
Kernel mode
execution done on behalf of operating system.
Mode bit 硬件提供
monitor (0) or user (1)
Provides ability to distinguish when system is running user code or kernel code
Some instructions designated as privileged, only executable in kernel mode.
能引起机器损害的机器指令作为特权指令,例如IO控制、定时器管理、中断管理等
No. 3 / 60
Timer(定时器)
防止程序陷入无限循环 not calling system services and never returning control to OS
Be set to interrupt the computer after a specific period
A variable timer is generally implemented by fixed-rate clock and a counter
2.Operating-System Structures
System Calls
Programming interface to the services provided by the OS
API
Specify a set of functions that are available to an application programmer
API typically invoke the actual system calls on behalf of the application programmer
优势
Portability / compatibility : program based on API can be compiled and run on any
different system that supports the same API
Simplicity / availability: API can be used more easily than system call
传递参数
registers
有时候参数多于寄存器
Parameters stored in a block or table in memory, and address of block passed as a
parameter in a register
Parameters can be placed, or pushed, onto the stack by the program and popped off
the stack by the operating system
Block and stack methods do not limit the number or length of parameters being
passed
Operating System Structure
Simple Structure
Layered Approach
The operating system can be divided into a number of layers (levels)
each layers built on top of lower layers.
The bottom layer (layer 0), is the hardware
No. 4 / 60
the highest (layer N) is the user interface.
Advantage
Simplicity of construction and debugging
Each layer uses the functions and services of only lower-level layers
Each hides the existence of certain data structures, operation and hardware
from higher-level layers. It does not need to know how these operations are
implemented
Disadvantage
definition of the various layers is difficult
a layer can use only lower-level layers, it makes planning is very difficult
sometime
Main difficulty with the layer approach
less efficient
每一层都要修改参数,传递数据,频繁的调用参数导致浪费时间较长,效率低
Microkernel Approach
Removing all nonessential components from the kernel and implementing them as
system and user-level programs
provides Minimal process and memory management and Basic Communication
Benefits
Easier to extend a microkernel
Easier to port the operating system to new architectures
More security and reliability
less code is running in kernel mode
Detriments(危害)
Performance decreases due to
increased system function overhead
increased communication between user space and kernel space
Modules Approach
Uses object-oriented approach to create a module kernel
The kernel has a set of core components and dynamical links in additional services
Uses dynamical loadable modules
When needed, any component can be added to the kernel
similar to layers but with more flexible
Can call any other module
similar to microkernel but more efficient
Communication don’t need to invoke message passing
3.Processes
Process Concept
Process include:
Program code
No. 5 / 60
剩余59页未读,继续阅读
资源评论
Abigail-0
- 粉丝: 263
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功