文章目录
一、OS的定义
1.资源管理器(resource manager)
2.对硬件机器的扩展(extended machine)
将底层硬件的功能扩展成了更丰富、更方便用户使用的功能。
意思就是一个通用的PC,就能完成各种服务(银行系统、航空服务、网页浏览),这就是扩展。
3.作为用户和计算机硬件之间的接口
- 联机命令接口(交互式指令)
就是在命令行里输入的指令,你输一句操作系统给你个反馈,这就是交互 - 脱机命令接口(批处理指令)
就是将一堆交互式指令集中到一个批处理文件中,在win10中是.bat
,在linux中是.sh
- 程序接口(系统调用)
只能通过应用程序调用,用户不能直接打在命令行,所以是程序接口。
这就是内核态提供给用户态的接口。
在win10里就是.dll
,在linux可以通过syscall()
函数在程序中调用。
二、OS structure
- Monolithic庞大的
- Layered分层的
屏蔽底层细节,提供给上层应用接口 - Virtual Machine虚拟机
如VM/370,OS/360,CMS(Conversational Monitor System)
用于云计算,web-host云主机 - client-server客户机服务器
用于分布式系统(distributed system),分布式计算,并行计算
三、OS Basic Concepts
- Shell
- System Calls:“trap into kernel”
- Process
- File System
file system= file + file management - IPC
四、考试题
1.填空
-
OS概念
Operating System is an extended machine and a resource manager -
系统调用
To obtain services from the operating system, a user program must make a system call, which traps into the kernel and invokes the operating system. The TRAP instruction switches from user mode to kernel mode and starts the operating system.
2.简答题
- What is system call? Use an example to illustrate(举例说明)the steps of system.
操作系统的主要功能是为应用程序的运行创建良好的环境,为了达到这个目的,内核提供一系列具备预定功能的多内核函数,通过一组称为系统调用(system call)的接口呈现给用户。
系统调用把应用程序的请求传给内核,调用相应的的内核函数完成所需的处理,将处理结果返回给应用程序,如果没有系统调用和内核函数,用户将不能编写大型应用程序。