Os - PPT 2

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 43

Operating System

CSE Sec-C
Computer-System Architecture

 Based on the processor computer system divided into three


types.

1. Single-Processor Systems

2. Multiprocessor Systems

3. Clustered Systems

2
1. Single-Processor Systems

 A single processor system contains only one processor.


 So only one process can be executed at a time and then the
process is selected from the ready queue.

3
2. Multiprocessor system
 A multiprocessor system consists of multiple processors.
 Also known as parallel systems, tightly-coupled systems.
Advantages:
I. Increased throughput
II. Economy of scale (cheaper than single processor systems)
III. Increased reliability (if one processor fails)

4
Types of Multiprocessor system

 There are mainly two types of multiprocessors i.e.


symmetric and asymmetric multiprocessors.

1. Symmetric Multiprocessors
 In these types of systems, each processor contains a similar
copy of the operating system and they all communicate
with each other.

5
Asymmetric Multiprocessors
 In asymmetric systems, each processor is given a predefined task.
 There is a master processor that gives instruction to all the other
processors.
 Asymmetric multiprocessor system contains a master slave
relationship.

Example:-
DECsystem-1055
and the IBM
System/360

6
3. Clustered System
 Like multiprocessor systems, but multiple systems working
together.
 Basically, they have independent computer systems with a
common storage and the systems work together.

7
Operating System Services:-
 It provides certain services to programs and to users of that
programs.

1. User Interface
 An interface is required to communicate with the user. Then it can
either be a Command Line Interface (CLI) or a Graphical User
Interface (GUI).
2. Program Execution

 To execute a program, several tasks need to be performed.


 A complier is a program that translate source code into
machine language code.
 A object code is a machine code that processor can execute.
3. Input-Output Operations:-
 User cannot directly control the input and output devices.
you may think that when you are using your keyboard and
mouse you feel like you are controlling it.
4. File system Manipulation
 File system manipulation or file system management
involves files now there are many files and directories in
your system that has to be used now the operating system
must control how these files are manipulated or how these
files are managed.
5. Communication
 Communications may occur between processes that may be
executing on the same computer or between processes that
are executing on different computers tied together by a
computer network.
6. Error Detection
 Service that is provided by the operating system
is known as error detection now errors can always
occur in the course of our computing.
7. Resource Allocation
 Resource allocation means allocating resources to different
processes or different users.
8. Accounting
 Accounting is that we want to keep track of which
users use how much and what kind of computer
resource
9. Protection and Security

 Protection and security so our data should be secure and then


everything that we do must be protected.
Command Interpreter :-

 It allows user to directly enter commands that are to


be performed by the OS.
 Some of OS include CLI in the Kernel while other os
Windows xp and Linux treat as special program.

Kernel:-
 kernel is the core of the operating system that

controls all the tasks of the system.


 The kernel is the heart of the operating system.

 It is the interface between the user and the hardware.

It performs a variety of tasks including file handling,


memory management, controlling hardware devices,
process management and many more.
Shell:-
 The shell is the interface that allows the users to
communicate with the kernel.
 The user can enter commands to the shell. Then it
interprets the commands to perform the required task.
 There are various types of shells. The Bourne shell (sh)
is the most popular Unix shell. Korn shell (ksh) and
Bourne Again Shell (bash) etc.
Operating System Structure:
 An operating system is a construct that allows the user
application programs to interact with the system hardware.
 Following structures of the operating system:
1. Simple structure
2. Monolithic Structure
3. Layered Structure
4. Micro-kernel
5. Modular structure

19
1. Simple structure
 Such operating systems do not have well defined structure
and are small, simple and limited systems.
 MS-DOS is an example of such operating system.
 All the layers are accessing the base hardware.

20
2. Monolithic Structure
 The monolithic operating system is a very basic operating system
in which file management, memory management, device
management, and process management are directly controlled
within the kernel.
 This is followed by earlier UNIX operating system.
 Example: VMS, Linux, OS/360, open vms

21
3. Layered Structure
 The layered structure approach breaks up the operating system
into different layers. The bottom layer (layer 0) is the hardware,
and the topmost layer (layer N) is the user interface.
 Each of the layers in the operating system can only interact with
the above and below layers.
 Ex: Windows NT OS

22
4. Micro-kernel
 Instead of big kernel having so many functionality, we have
micro kernel & the main function of micro-kernel provide
communication between client & other services.
 Ex: Mac OS 8, Minix, L4Linux

23
5. Modular structure
 It is considered as the best approach for an OS.
 Modern OS development is object-oriented, with a relatively
small core kernel and a set of modules which can be linked in
dynamically.

24
What is a System Call ?
 A system call is a method for a computer program to request
a service from the kernel of the operating system on which it
is running.
 There are two modes of operation in which program run
which is:
1. User mode
2. Kernel mode
System Call:-

 When a program runs in user mode it may access some of


the resources like memory & hardware.
 When a program runs in user mode it call certain resources
i.e. program switch from user mode to kernel mode & it is
known as Context switching.
 A system call can be written in assembly language or a high-
level language like C & C++.
Ex: Read data from one file & copy them to another file
Types of System Call:-
 There are mainly five types of system calls.

1. Process Control
2. File Management
3. Device Management
4. Information Maintenance
5. Communications
1. Process Control:-

 There are various process running in our system and all this
process need to be controlled.
 This system calls perform the task of process creation, process
termination, etc.
 Example:
1. End and Abort
2. Load and Execute
3. Create Process and Terminate Process
4. Allocate and free memory
2. File Management

 File management system calls handle file manipulation jobs


like creating a file, reading, and writing, etc.
 Functions:
1. Create a file
2. Delete file
3. Open and close file
4. Read, write, and reposition
5. Get and set file attributes
3.Device Management:-

 Device management does the job of device manipulation like


reading from device buffers, writing into device buffers, etc.
 Functions:
1. Request and release device
2. Logically attach/ detach devices
3. Get and Set device attributes
4. Information Maintenance:-

 It handles information and its transfer between the OS and the


user program.
 Functions:
1. Get or set time and date
2. Get process and device attributes
5. Communication:

 These types of system calls are specially used for interprocess


communications.
 Functions:
1. Create, delete communications connections
2. Send, receive message
3. Help OS to transfer status information
4. Attach or detach remote devices
System programs:-
 System programs provide an environment where programs can
be developed and executed.
Types of System Programs:

 System programs can be divided into six parts. These are


given as follows:
1. File Management
2. Status Information
3. File Modification
4. Programming Language Support
5. Program Loading and Execution
6. Communications
File Management

 File management is defined as the process of manipulating


files in the computer system, its management includes the
process of creating, modifying and deleting files.
 It helps to create new files in the computer system and
placing them at specific locations.
 It helps to store files in separate folders known as
directories.
 Examples: create, delete, copy, rename, print etc.
Status Information –

 Information like date, time, amount of available memory, or


disk space is asked by some users.
 Others providing detailed performance, logging, and
debugging information which is more complex.
 All this information is displayed on output devices or
printed.
File Modification –

 For modifying the contents of files we use this.


 System programs that are used for file modification
basically change the data in the file or modify it in some
other way. Text editors are a big example of file
modification system programs.
Programming-Language support –
 These system programs provide additional support features
for different programming languages. Some examples of
these are Compilers, Assemblers, Debuggers, and
interpreters which are already provided to users.
 It provides all support to users. We can run any
programming language.
 .
Program Loading and Execution –
 When the program is ready after Assembling and
compilation, it must be loaded into memory for execution.
 A loader is part of an operating system that is responsible
for loading programs and libraries.
Communications –

 System programs that helps the communication between


processes or users.
 These programs provide the mechanism for :
 Creating Virtual connections among processes, users, and
computer systems.
 Allowing Users can send messages to another user on their
screen.
 User can send e-mail.
 Browsing on web pages.

You might also like