Command-Interpreter System(Cont 命令解释器系统 The program that reads and interprets control statements is called variously: 读入和解释控制语句的程序有各种名称 control-card interpreter控制卡解释器 command-line interpreter命令行解释器 shell (in UNIX) Its function is to get and execute the next command statement.其功能是获得和执行下一个命令语句 Applied Operating System Concepts 3.11
Applied Operating System Concepts 3.11 Command-Interpreter System (Cont.) 命令解释器系统 • The program that reads and interprets control statements is called variously: 读入和解释控制语句的程序有各种名称 – control-card interpreter 控制卡解释器 – command-line interpreter 命令行解释器 – shell (in UNIX) Its function is to get and execute the next command statement. 其功能是获得和执行下一个命令语句
Operating System Services 操作系统服务 Program execution system capability to load a program into memory and to run it.程序执行-调入一个程序进内存并运行之的系统能力 10 operations- since user programs cannot execute l/o operations directly, the operating system must provide some means to perform I/o O操作-由于用户程序不能直接执行Ⅳo操作,操作系统必须提供手段完成MO操作 File-system manipulation- program capability to read, write, create, and delete file.文件系统操作-读、写、创建和删除文件的能力 e Communications- exchange of information between processes executing either on the same computer or on different systems tied together by a network. Implemented via shared memory or message passing. H 通信-运行的进程在同一计算机或由网络连接的不同系统中交换信息。通过共享存 储器或消息传递实现 Error detection -ensure correct computing by detecting errors in the CPU and memory hardware, in l/o devices, or In user programs.出错检测-探测 在CPU与内存硬件中,在O设备中,或在用户程序中的错误,确保正确运算 Applied Operating System Concepts 3.12
Applied Operating System Concepts 3.12 Operating System Services 操作系统服务 • Program execution – system capability to load a program into memory and to run it. 程序执行 - 调入一个程序进内存并运行之的系统能力 • I/O operations – since user programs cannot execute I/O operations directly, the operating system must provide some means to perform I/O. I/O操作 - 由于用户程序不能直接执行I/O操作,操作系统必须提供手段完成I/O操作 • File-system manipulation – program capability to read, write, create, and delete files. 文件系统操作 - 读、写、创建和删除文件的能力 • Communications – exchange of information between processes executing either on the same computer or on different systems tied together by a network. Implemented via shared memory or message passing. 通信 - 运行的进程在同一计算机或由网络连接的不同系统中交换信息。通过共享存 储器或消息传递实现 • Error detection – ensure correct computing by detecting errors in the CPU and memory hardware, in I/O devices, or in user programs. 出错检测 - 探测 在CPU与内存硬件中,在I/O设备中,或在用户程序中的错误,确保正确运算
Additional Operating system Functions 其他操作系统功能 Additional functions exist not for helping the user, but rather for ensuring efficient system operations 其他的功能不是用于帮助用户,而是为了系统效率 Resource allocation allocating resources to multiple users or multiple jobs running at the same time. 资源分配-把资源分配给多个用户或多个同时运行的作业 Accounting-keep track of and record which users use how much and what kinds of computer resources for account billing or for accumulating usage statistics. 帐务-跟踪和记录用户对资源的使用,用于帐单和统计 Protection -ensuring that all access to system resources is controlled 保护确保对资源的所有访问均在控制中 Applied Operating System Concepts 3.13
Applied Operating System Concepts 3.13 Additional Operating System Functions 其他操作系统功能 Additional functions exist not for helping the user, but rather for ensuring efficient system operations. 其他的功能不是用于帮助用户,而是为了系统效率: • Resource allocation – allocating resources to multiple users or multiple jobs running at the same time. 资源分配- 把资源分配给多个用户或多个同时运行的作业 • Accounting – keep track of and record which users use how much and what kinds of computer resources for account billing or for accumulating usage statistics. 帐务 - 跟踪和记录用户对资源的使用,用于帐单和统计 • Protection – ensuring that all access to system resources is controlled. 保护 - 确保对资源的所有访问均在控制中
System Calls 系统调用 System calls provide the interface between a running program and the operating system系统调用提供在运行程序和操作系统之间的接口 Generally available as assembly-language instructions 通常以汇编语言指令形式提供 Languages defined to replace assembly language for systems programming allow system calls to be made directly(e.g, C. Bliss, P凵/360)替代汇编语言的、供系统编程的语言,允许直接使用系统调用 Three general methods are used to pass parameters between a running program and the operating system 3种常用方式用于在运行程序和操作系统之间的参数传递 Pass parameters in registers.寄存器中的参数传递 Store the parameters in a table in memory, and the table address is passed as a parameter in a register.参数存在内存的一张表中,表地址 作为寄存器的参数传递 Push(store) the parameters onto the stack by the program, and pop off the stack by operating system.程序把参数压入栈,由操作系统弹出 Applied Operating System Concepts 3.14
Applied Operating System Concepts 3.14 System Calls 系统调用 • System calls provide the interface between a running program and the operating system.系统调用提供在运行程序和操作系统之间的接口 – Generally available as assembly-language instructions. 通常以汇编语言指令形式提供 – Languages defined to replace assembly language for systems programming allow system calls to be made directly (e.g., C. Bliss, PL/360)替代汇编语言的、供系统编程的语言,允许直接使用系统调用 • Three general methods are used to pass parameters between a running program and the operating system. 3种常用方式用于在运行程序和操作系统之间的参数传递 – Pass parameters in registers. 寄存器中的参数传递 – Store the parameters in a table in memory, and the table address is passed as a parameter in a register. 参数存在内存的一张表中,表地址 作为寄存器的参数传递 – Push (store) the parameters onto the stack by the program, and pop off the stack by operating system. 程序把参数压入栈,由操作系统弹出
Passing of Parameters as a Table 表格方式的参数传递 X register X: parameters use parameters code for load address x from table X system system call 13 ca|13 user program operating system Applied Operating System Concepts 3.15
Applied Operating System Concepts 3.15 Passing of Parameters As A Table 表格方式的参数传递