Download presentation
Presentation is loading. Please wait.
1
Operating System Structure
2
System Components Process Management Main Memory Management
File Management I/O System Management Secondary Management Networking Protection System Command-Interpreter System
3
Process Management A process is a program in execution.
A process needs certain resources, including CPU time, memory, files, and I/O devices, to accomplish its task. The operating system is responsible for the following activities in connection with process management. Process creation and deletion. process suspension and resumption. Provision of mechanisms for: process synchronization process communication
4
Memory Management Memory is a large array of words or bytes, each with its own address. It is a repository of quickly accessible data shared by the CPU and I/O devices. Main memory is a volatile storage device. It loses its contents in the case of system failure. The operating system is responsible for the following activities in connections with memory management: Keep track of which parts of memory are currently being used and by whom. Decide which processes to load when memory space becomes available. Allocate and deallocate memory space as needed.
5
I/O Management Much of the OS kernel is concerned with I/O.
The OS provides a standard interface between programs (user or system) and devices. Device drivers are the processes responsible for each device type. A driver encapsulates device-specific knowledge, e.g., for device initiation and control, interrupt handling, and errors. There may be a process for each device, or even for each I/O request, depending on the particular OS.
6
Secondary Storage Management
Since main memory (primary storage) is volatile and too small to accommodate all data and programs permanently, the computer system must provide secondary storage to back up main memory Most modern computer systems use disks as the principal on- line storage medium, for both programs and data. The operating system is responsible for the following activities in connection with disk management: Free space management Storage allocation Disk scheduling
7
File Management A file is a collection of related information defined by its creator. Commonly, files represent programs (both source and object forms) and data. The operating system is responsible for the following activities in connections with file management: File creation and deletion. Directory creation and deletion. Support of primitives for manipulating files and directories. Mapping files onto secondary storage. File backup on stable (nonvolatile) storage media.
8
Protection System Protection refers to a mechanism for controlling access by programs, processes, or users to both system and user resources. The protection mechanism must: distinguish between authorized and unauthorized usage. specify the controls to be imposed. provide a means of enforcement. protection mechanisms help to detect errors as well as to prevent malicious destruction
9
Command Interpreter Many commands are given to the operating system by control statements which deal with: process creation and management I/O handling secondary-storage management main-memory management file-system access protection networking
10
What is a kernel? Operating system provides an hardware abstraction layer Since OS provides resource sharing → every access to the hardware from user programs should be done through the OS To enforce this in a secure way, and prevent malicious or buggy applications, a protection is needed at the hardware level
11
What is a kernel? (Contd…)
Hardware must provide at least two execution levels: Kernel mode: the application has access to all the instructions and every piece of hardware. User mode: the application is restricted and cannot execute some instructions, and is denied access to some hardware (like some area of the main memory Two areas are defined at application level: Kernel space: Code running in the kernel mode is said to be inside the kernel space User space: Every other programs, running in user mode, is said to be in user space
12
The OS (a simplified view) Secondary Storage Management
OS Structure Hardware The OS (a simplified view) Memory Management I/O System Secondary Storage Management File System Protection System Accounting System Process Management Command Interpreter Information Services Error Handling
13
Operating Systems Structures
Structure/Organization/Layout of OSs Monolithic (one unstructured program) Layered Microkernel Virtual Machines
14
Monolithic OS OS is simply a collection of functions
One big program including everything (system calls, system programs, every managers, device drivers, etc) Entire OS resides in main memory Ex: MS-DOS, Multics, Unix, BSD, Linux
15
Monolithic OS (Contd…)
Most work is done via system calls These are interfaces, that access some subsystem within the kernel such as disk operations Essentially calls are made within programs and a request is passed through the system call
16
Monolithic OS (Contd…)
17
Monolithic OS (Contd…)
Pros Every component contained in kernel direct communication among all components All OS services operate in kernel space high performance Cons Larger size makes it hard to maintain Complexity is more Dependencies between system component not easily extended/modified: new devices, emerging technologies not easily added
18
Layered Approach The operating system is divided into a number of layers (levels), providing different functionalities The bottom layer (layer 0) is the hardware; the highest (layer N) is the user interface. A layer can only use the services provided by layer in a level below System calls might pass through many layers before completion
19
Layered Approach (Contd…)
20
Layered Approach (Contd…)
Pros: Information hiding between layers Increased security and protection Easy to debug, test, and modify OS Cons: If one layer stops working, entire system will stop Mapping overhead between layers Difficult to categorize into layers
21
Microkernel OS Move as much functionality as possible from the kernel into user space. Only a few essential functions in the kernel primitive memory management (address space) I/O and interrupt management Inter-Process Communication (IPC) basic scheduling Other OS services are provided by processes running in user mode (vertical servers): device drivers, file system, virtual memory…
22
Microkernel OS (Contd…)
Communication takes place between user modules using message passing. More flexibility, extensibility, portability and reliability. But performance overhead caused by replacing service calls with message exchanges between processes.
23
Benefits of a Microkernel
Extensibility/Reliability easier to extend a microkernel easier to port the operating system to new architectures more reliable (less code is running in kernel mode) more secure small microkernel can be rigorously tested. Portability changes needed to port the system to a new processor is done in the microkernel, not in the other services.
24
Virtual Machines A Virtual Machine (VM) takes the layered and microkernel approach to its logical conclusion. It treats hardware and the operating system kernel as though they were all hardware. A virtual machine provides an interface identical to the underlying bare hardware. The operating system host creates the illusion that a process has its own processor and (virtual memory). Each guest provided with a (virtual) copy of underlying computer. 24
25
Virtual Machines (Contd…)
The resources of the physical computer are shared to create the virtual machines: CPU scheduling can create the appearance that users have their own processor. Spooling and a file system can provide virtual card readers and virtual line printers. A normal user time-sharing terminal serves as the virtual machine operator’s console.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.