2. Operating System Structure,Services,Call, Design and Implementation.pptx

viceprincipalbfc 51 views 27 slides Jul 26, 2024
Slide 1
Slide 1 of 27
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27

About This Presentation

Operating System Structure


Slide Content

Operating System Structures Dr. MANISH bANSAL

Topics To Be Covered Operating System Components Operating System Services System Calls System Design and Implementation

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

Operating System Components Process Management Operating System is responsible for the following activities in connection with process management Creating and deleting both user and system processes Suspending and resuming processes Providing mechanisms for process synchronization Providing mechanisms for process communication Providing mechanisms for deadlock handling

Operating System Components Main Memory Management Operating System is responsible for the following activities in connection with Main Memory Management Keeping track of which parts of memory are currently being used and by Whom Deciding which processes are to be loaded into memory when memory space becomes available Allocating and deallocating memory space as needed

Operating System Components File Management Operating System is responsible for the following activities in connection with File Management Creating and deleting files Creating and deleting directories Supporting primitives for manipulating files and directories Mapping files onto secondary storage Backing up files on stable storage media

Operating System Components I/O-System Management I/O system consists of followings A memory-management component that includes buffering, caching and spooling A general device-driver interface Drivers for specific hardware devices Only the device driver knows the peculiarities of the specific device to which it is assigned

Operating System Components Secondary-Storage Management Operating System is responsible for the following activities in connection with Main Memory Management Free-Space Management Storage Allocation Disk Scheduling

Operating System Components Protection System Multiple users and processes are allowed to execute concurrently Mechanisms must be provided to protect the process form each other Mechanism ensure that files, memory segments, CPU and other resources can be operated on by only those processes that have gained proper authorization from the operating System. For example: Memory addressing hardware ensures the a process can execute only within its own address space.

Operating System Components Command-Interpreter System One of the most important system programs for an operating system is the command interpreter, which is the interface between the user and operating system. Some Operating system include the command interpreter in the Kernel other OS like Ms-Dos and Unix treat it as a special program. Many commands are given to the Operating system by control statements. When a new job is started in a batch system When a new user logged on to the Time-Sharing Operating System

Operating System Services Program Execution I/O Operation File-System Manipulation Communications Error Detection Resource allocation Accounting Protection

Operating System Services Program Execution The system must be able to load a program into memory and to run that program The program must be able to end its execution, either normally or abnormally (including error)

Operating System Services I/O Operations A running program may require I/O. This I/O may involve a file or an I/O device. For efficiency and protection, user usually can not control I/O devices directly, Therefore the operating system must provide a means to do I/O.

Operating System Services File-System Manipulation The file system is of particular interest. Obviously, programs need to read and write files. Programs also need to create and delete files by name.

Operating System Services Communication In many circumstances, one process need to exchange information with other process. Such communication can occur in tow major ways. The first takes place between process that are executing on the same computer. Second takes place between processes that are executing on different computer that are tied together by a computer networks. Communications may be implemented via shared memory, or by the technique of message passing, in which packets of information are moved between process by the operating system

Operating System Services Error Detection The Operating system constantly needs to be aware of possible errors. Errors may occur in the CPU and memory hardware (Such as memory error or a power failure) In I/O devices (Such as a parity error on tape, a connection failure on a network, or lack of paper in the printer) In user program (Such as arithmetic overflow, an attempt to access an illegal memory location, or a too-great use of CPU time). For each type of error, the operating system should take appropriate action to ensure correct and consistent computing

Operating System Services Resource Allocation When multiple user are logged on the system or multiple jobs are running at the same time, resources must be allocated to each of them. Many different types of resources are managed by the operating system. Such as CPU cycles, main memory, storage, I/O devices etc.

Operating System Services Accounting Operating system keep track of which users use how many and what kinds of computer resources This record keeping may be used for accounting or simply for accumulating usage statistics.

Operating System Services Protection The owners of information stored in a multiuser computer system may want to control use of that information. When several disjoined processes execute concurrently, it should not be possible for one process to interfere with others or with operating system itself. Protection involves ensuring that all access to system resources is controlled. Security of the system from outsiders is also important. Such security starts with each user having to authenticate himself to the system, usually by means of password, to be allowed access to the resources. It extends to defending external I/O devices, including modems and network adapters, from invalid access attempts, and to recording all such connections for detection of break-ins.

System Calls In computing, a  system call  is the programmatic way in which a computer program requests a service from the kernel of the operating system it is executed on. A system call is a way for programs to  interact with the operating system . A computer program makes a system call when it makes a request to the operating system’s kernel. System call  provides  the services of the operating system to the user programs via Application Program Interface(API). It provides an interface between a process and operating system to allow user-level processes to request services of the operating system. System calls are the only entry points into the kernel system. All programs needing resources must use system calls.

System Calls Services Provided by System Calls : Process creation and management Main memory management File Access, Directory and File system management Device handling(I/O) Protection Networking, etc. Types of System Calls :  There are 5 different categories of system calls – Process control:  end, abort, create, terminate, allocate and free memory. File management:  create, open, close, delete, read file etc. Device management Information maintenance Communication

System Calls

System Calls

System Design and Implementation Design Goals Mechanism and Polices Implementation

It is quite complicated to define all the goals and specifications of the operating system while designing it. The design changes depending on the type of the operating system i.e if it is batch system, time shared system, single user system, multi user system, distributed system etc. There are basically two types of goals while designing an operating system. These are − User Goals The operating system should be convenient, easy to use, reliable, safe and fast according to the users. However, these specifications are not very useful as there is no set method to achieve these goals. System Goals The operating system should be easy to design, implement and maintain. These are specifications required by those who create, maintain and operate the operating system. But there is not specific method to achieve these goals as well. System Design and Implementation Design Goals

There is no specific way to design an operating system as it is a highly creative task. However, there are general software principles that are applicable to all operating systems. A subtle difference between mechanism and policy is that mechanism shows how to do something and policy shows what to do. Policies may change over time and this would lead to changes in mechanism. So, it is better to have a general mechanism that would require few changes even when a policy change occurs. For example - If the mechanism and policy are independent, then few changes are required in mechanism if policy changes. If a policy favors I/O intensive processes over CPU intensive processes, then a policy change to preference of CPU intensive processes will not change the mechanism. System Design and Implementation Mechanism and Polices

The operating system needs to be implemented after it is designed. Earlier they were written in assembly language but now higher level languages are used. Advantages of Higher Level Language There are multiple advantages to implementing an operating system using a higher level language such as: the code is written more fast, it is compact and also easier to debug and understand. Also, the operating system can be easily moved from one hardware to another if it is written in a high level language. Disadvantages of Higher Level Language Using high level language for implementing an operating system leads to a loss in speed and increase in storage requirements. However in modern systems only a small amount of code is needed for high performance, such as the CPU scheduler and memory manager. Also, the bottleneck routines in the system can be replaced by assembly language equivalents if required. System Design and Implementation Implementation