Presentation is loading. Please wait.

Presentation is loading. Please wait.

Cs238 Lecture 3 Operating System Structures Dr. Alan R. Davis.

Similar presentations

Presentation on theme: "Cs238 Lecture 3 Operating System Structures Dr. Alan R. Davis."— Presentation transcript:

1 Cs238 Lecture 3 Operating System Structures Dr. Alan R. Davis

2 System Components Process Management Main-Memory Management File Management I/O System Management Secondary-Storage Management Networking Protection System Command-Interpreter System

3 Process Management The creation and deletion of both user and system processes. The suspension and resumption of processes. Providing mechanisms for process synchronization. Providing mechanisms for process communication. Providing mechanisms for deadlock handling.

4 Main-Memory Management Keep track of which parts of memory are currently being used, and by whom. Decide which processes are to be loaded into memory when memory space becomes available. Allocate and deallocate memory space as needed.

5 File Management The creation and deletion of files. The creation and deletion of directories. The support of primitives for manipulating files and directories. The mapping of files onto secondary storage. The backup of files on nonvolatile storage media.

6 I/O System Management A memory management component including buffering, caching, and spooling. A general device-driver interface. Drivers for specific hardware devices.

7 Secondary Storage Management Free space management. Storage allocation. Disk scheduling. Defragmenting disks. Partitioning and formatting disks.

8 Networking Create, delete communications connection Send, receive messages Transfer status information Attach or detach remote devices

9 Protection Systems When multiple programs and users share a system we must prevent them from adversely affecting each other. A properly designed operating system must ensure that an incorrect (or malicious) program cannot cause other programs to execute incorrectly. We give the operating system control over other processes by distinguishing its instructions from all others.

10 Protection Systems cont’d By adding a special bit to the hardware, we can distinguish between instructions being executed in system mode, privileged mode, monitor mode, supervisor mode, and those being executed in user mode. The system starts (boots) in privileged mode, loads the operating system,and then starts user processes in user mode. Interrupts cause the system to switch from user mode to privileged mode. Some machine instructions are designated as privileged instructions.

11 Protection cont’d The hardware allows privileged instructions to be executed only in monitor mode. Attempts to do otherwise result in errors. To prevent the user from performing illegal I/O operations, all I/O instructions are privileged. Memory protection is accomplished by special purpose hardware to contain the base address and limit address for a program.

12 Protection cont’d CPU protection is accomplished with a timer. The operating system sets a timer before each change to user mode so that a user process can not monopolize the CPU. File protection is accomplished with extra bits associated with a file to indicate access rights (read, write, protected, etc.)

13 Command Interpreter System This is the interface between the user and the operating system. It could handle control statements on punched cards, statements typed on a console from the keyboard, or icons clicked by a mouse in a GUI environment. Commands deal with process creation and management, I/O handling, secondary-storage management, main memory management, file- system access, protection, and networking.

14 Operating System Services Program execution I/O operations File system manipulation Communications Error detection Resource allocation Accounting Protection

15 System Calls System calls provide the interface between a process and the operating system. They are generally available as assembly- language instructions, or in some higher level languages. System calls can be grouped into categories: process control, file manipulation, device manipulation, information maintenance, and communications.

16 System Calls cont’d Information must be passed to the operating system in a system call. It could be passed in registers. It could be passed in a block or table in memory. It could be passed on the stack.

17 Systems Programs File manipulation Status information - date, time, CPU usage File modification - editors Programming language support - compilers, assemblers, interpreters Program loading and execution - Communications - e-mail, ftp, telnet Applications programs

18 Virtual Machines Operating systems are thought of as consisting of layers. The base layer is the hardware layer. Then comes the operating system kernel. Then come the system programs. The kernel can access the hardware with hardware instructions. It also wraps those instructions in system calls for use by the next higher layer. The application layer can use either method to access the hardware and often does not distinguish the two methods.

19 Virtual Machines cont’d The virtual machine architecture provides an interface that is identical to the underlying hardware. Each process is provided with a (virtual) copy of the underlying computer. The resources of the physical computer are shared to create the virtual machines. CPU scheduling for a virtual CPU, spooling and a file system for virtual I/O, disk management to supply virtual disks.

20 Virtual Machines cont’d IBM’s VM operating system is the prime example. Users are given their own virtual machine. They can run any of the operating systems or software packages available on the underlying physical machine. Usually IBM VM users run CMS, a single- user interactive operating system.

21 Virtual Machines cont’d The virtual machine concept was important for large mainframe installations. However, it is also useful currently to solve system compatibility problems. A virtual Intel machine can be created on a Sun Microsystem machine to allow it to run all MS-DOS software. We also currently have the Java Virtual Machine(JVM).

Download ppt "Cs238 Lecture 3 Operating System Structures Dr. Alan R. Davis."

Similar presentations

Ads by Google