unit 2
unit 2
unit 2
1
Services of Operating System
1. User Interface
2. Program Execution
3. I/O operation
4. File Manipulation
5. Error detection
6. Communication
7. Protection/ Security
8. Resource allocation
9. Accounting
2
Services of Operating System
1. User Interface
Command Line Interface (CLI)
Windows Ubuntu
Services of Operating System
2. Program Execution
Operating System provide facility to user to create
program then it loads in memory and finally get
executed.
After successful execution, program get terminated
successfully
After unsuccessful execution , program terminated
abnormally by indicating errors
5
Services of Operating System
3. I/O operation
It provide facility to perform input/output operation with hardware
or different process.
e.g Read or Write data on I/O device.
6
Services of Operating System
4. File Manipulation
Program needs to read a file or write a file.
The operating system gives the permission to
the program for operation on file.
Permission varies from read-only, read-write,
denied and so on.
Operating System provides an interface to
the user to create/delete files/directories.
Operating System provides an interface to
create the backup of file system.
7
Services of Operating System
5. Error Detection
An error is one part of the system
may cause malfunctioning of the
complete system. To avoid such a
situation the operating system
constantly monitors the system for
detecting the errors.
Errors may occur in CPU, Memory,
I/O devices or programs
For each type of error, Operating
System must take corrective step to
recover from that.
8
Services of Operating System
6. Communication
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.
Specific hardware or user program
used for this.
9
Services of Operating System
7. Protection
Protection refers to mechanism or a
way to control the access of programs,
processes, or users to the resources
defined by a computer systems.
Operating System ensures that
external I/O devices are protected from
invalid access attempts.
Operating System provides
authentication feature for each user by
means of a password.
10
Services of Operating System
8. Resource Allocation
Allocating resources to multiple users or
multiple jobs running at the same time.
Resource may be hardware – CPU, Memory,
I/O Device or software- Programs
It must handle situation in such manner
that all user or jobs get resources whenever
they demand
11
Services of Operating System
9. Accounting
Keep track of and record which users use how much
and what kinds of compute resources for account
billing.
It can be use to detect error/bug or to add some
resources or for protection of Operating System.
It is also used to debug/modify/upgrade the system
12
System call
System Calls: System calls provide an interface
between the process and the Operating System.
Safe Mode
There are two modes of
Privileged Mode operation in the operating
system to make sure it
works correctly.
13
System call
14
System call Implementation:
Eg of System
calls:
1. open()
2. close()
3. read()
4. write()
15
Types of System call
16
Types of System call
Process Control
End
Abort
Load
Execute
Create
Terminate
Suspend
Resume
Get and Set process attributes: id,
state, priority
Wait for time, Event
Change the priority of process 17
Types of System call
File manipulation
Create File
Delete File
Open File
Close
Read
Write
Reposition
Get File Attributes
Set File Attributes
18
Types of System call
Device Management
Request device
Release device
Read
Write
Reposition
Get and Set device attributes:
id, name, type, speed
19
Types of System call
Information Management
Get Time
Set Time
Get system data
Set system data
Get and Set Process, File or Device
attributes
20
Types of System call
Communication
Create connection
Delete connection
Send message
Receive message
Transfer status information
Logically attach and detach remote
device
21
Operating System Components
Operating System breaks into modules or parts
which perform specific task
1. Process Management
2. Memory Management
3. File Management
4. I/O System Management
5. Networking Management
6. Secondary Storage Management
22
Operating System Components
1. Process Management
Process: Program in Execution state
Activities involve in handling process called process
management
Process is active entity which require resources for
execution
Activities:
Creation of user and system process
Suspending and resuming process
Mechanism for process communication,
Synchronization, deadlock handling
23
Operating System Components
Activities:
Tracking of memory
Deciding priority to allocate memory
Allocation and Deallocation of memory
24
Operating System Components
3. File Management
File: Collection of programs and data
Directory: Collection of Files
Activities involve in handling Files called File management
Activities:
Creation, deletion, updation of files and directories
Backup to secondary storage
File Manipulation
25
Operating System Components
4. I/O System Management
It includes Hardware
Drivers required to operate I/O device
Activities involve in handling I/O device called I/O device
management
Activities:
Performing Buffering, Caching and Spooling
Memory management of devices
Effective utilization of devices
Driver Support and hiding complexity of hardware
26
Operating System Components
5. Secondary Storage Management
It includes CD, DVD, Floppy, Pen Drive, Hard Disk
Security mechanism is required
Activities involve in handling device called management.
Activities:
1 Managing the free space available on the secondary-storage
device.
2 Allocation of storage space when new files have to be written.
3 Scheduling the requests for memory access.
27
Operating System Components
6. Networking Management
Computers are connected to each other for sharing information
is called network
Protocol is used
Activities involve in networking called networking management
Activities:
Mechanism to share data or resource
Mechanism to connect computers to each other
Providing security and permissions
Mechanism to detect fault over network
28
Use of Operating System Tools
1. User Management
Operating System can be multiuser or
single user.
In case of multiple users, the levels of
rights and privileges can be different.
So operating system needs to keep log
of everything related to the user. It could
be even login and logout times.
Operating System provides tools to
create users, modify them or even
delete them from the system.
It even ensures required and limited
access to the system.
Use of Operating System Tools
2. Security Policy
Every Operating System has standard
security policies. Implementation of
most of the security policies depends
on the organization.
Operating System Security policy helps
in protecting systems from various
threats to the system, malware,
spyware, ransomware, viruses, worms
and many more.
Security policies provide all possible
preventive measures and techniques to
keep Operating System safe.
Use of Operating System Tools
2. Security Policy
Major areas where Operating System
Security policies used are-
System updating or patching system
regularly.
Software installation or updating of
various antiviruses.
Firewall installation and management of
incoming and outgoing traffic on
networks.
Provide security to users account.
Deciding what kind of data, users and
hardware is vital in the system.
Use of Operating System Tools
3. Device Management
Device Management is needed for smooth
functioning of computer system.
Operating System communicates and
does coordination among devices.
It includes
Keep track of present devices
Resources/Device allocation.
Choose efficient ways to allocate devices
to different programs or processes.
Deallocate the devices.
Use of Operating System Tools
4. Performance Monitor
Performance monitor supervises
performance of the system.
It monitors different activities like
memory usage and CPU utilization
It also monitors performance of the
hardware, software and
applications.
It analyses the different problems in
the system and can find out by
monitoring function.
Use of Operating System Tools
5. Task Scheduler
- Throughout the lifetime of process it migrates or
travels to the various scheduling queues.
Schedulers - An OS should select processes for scheduling purposes
from these queues in some manner. The selection
Long Term Short Term
procedure is done by schedulers.
Scheduler Scheduler
- The scheduler which picks up job from this pool and
(Job Scheduler) (CPU Scheduler)
loads into main memory for execution is called long
term scheduler or job scheduler.
- There is another scheduler which selects the jobs or
processes which are ready to execute from this pool
and allocates the CPU to one of them is called Short
term Scheduler or CPU Scheduler