- Operating system: a program that manages the computer hardware
- Operating system goals:
- Execute user programs and make solving user problems easier.
- Make the computer system convenient to use.
- Use the computer hardware in an efficient manner.
- The development of OS:
- Manual operation
- Simple batch processing:顺序性、单道性、自动性
- Multiprogrammed batch systems:无序性、多道性、调度性
- Time-sharing system:多路性、独占性、交互性、及时性
- Characteristic of modern OS:
- Concurrency并发
- Sharing共享
- Virtual虚拟
- asynchronism异步性
- 操作系统的功能:
- Managing the processor处理机管理
-
- Control processes进程控制
- Dispatch processes进程调度
- Synchronize processes进程同步
- Communicate among processes进程通信
- Managing the storage存储管理
-
- Allocate and recycle the memory存储分配与回收
- Protecting the memory存储保护
- Relocate the address地址重地位
- Expand the memory内存扩充
- Managing the equipment设备管理
-
- Manage the buffer缓冲管理
- Allocate and recycle the equipments设备分配与回收
- 设备处理:利用设备驱动程序(通常在内核中)完成对设备的操作。
- Virtualize equipments虚拟设备
- 设备独立性:提供统一的I/O设备接口,使应用程序独立于物理设备
- Managing the files文件管理
-
- 文件存储控件管理
- Manage the catalog目录管理
- 文件存取管理
- Manage the software软件管理
- User interfaces用户接口
- Hardware protection
- Dual-Mode operation
-
- User mode, Monitor mode
- mode bit added to computer hardware to indicate the current mode: monitor(0) or user(1)
- at boot time, the hardware starts in monitor mode
- starts user processes in user mode
- when an interrupt or fault occurs hardware, switching to monitor mode
-
- Privileged instructions: change mode, I/O
- I/O protection
-
- All I/O instructions are privileged instructions
- It must be ensured that a user program could never gain control of the computer in monitor mode
- Memory protection
-
- In order to have memory protection, add two registers that determine the range of legal addresses a program may access: base register, limit register(memory ouside the defined range is protected)
- CPU protection
-
- We must prevent a program from getting stuck in an infinite loop, or not calling OS services and never returning control to the OS
- Use a timer: interrupts computer after specified period to ensure operating system maintains control
- Load-timer is a privileged instruction
-
- before turning over control to the user’s program, the OS ensures that the timer is set to interrupt
- if the timer interrupts, control transfers to the OS, and the user program may be killed or given more time to run
- Commonly used to implement time sharing
Chapter 1 Introduction
最新推荐文章于 2025-04-19 23:38:09 发布