2.services and Component of OS Notes

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Unit 2

Services and component of Operating system Mark 08


Introduction-
 An operating system provides and environment for the execution of program.
 It provides certain services to the program and to the user of those program.
 The specific services provided by operating system is different from one operating system to
another but we can identify common classes use operating system services are provided for the
convenience of the programmer.
 To make the programming tasks easier.

2.1 Operating system Services -

Operating System Services


One set of operating-system services provides functions that are helpful to the user
Communications – Processes may exchange information, on the same computer or between
Computers. Over a network Communications may be via shared memory or through message
Passing packets moved by the OS.
Error detection – OS needs to be constantly aware of possible errors May occur in the CPU and
memory hardware, in I/O devices, in user program For each type of error, OS should take the
appropriate action to ensure correct and consistent computing Debugging facilities can greatly
enhance the user’s and programmer’s abilities to efficiently use the system. Another set of OS
functions exists for ensuring the efficient operation of the system itself via resource sharing
Resource allocation - When multiple users or multiple jobs running concurrently, resources
must be allocated to each of them
Many types of resources - Some (such as CPU cycles, main memory, and file storage) may have
special allocation code, others (such as I/O devices) may have general request and release code
Accounting - To keep track of which users use how much and what kinds of computer resources
Protection and security - The owners of information stored in a multiuser or networked computer
system may want to control use of that information, concurrent processes should not interfere
with each other
Protection involves ensuring that all access to system resources is controlled
Security of the system from outsiders requires user authentication, extends to defending external
I/O
devices from invalid access attempts
If a system is to be protected and secure, precautions must be instituted throughout it. A chain is
only as strong as its weakest link.

2.2 System Call Concept-


The system call provides an interface to the operating system services.
Application developers often do not have direct access to the system calls, but can access them
through an application programming interface (API). The functions that are included in the AP I
invoke the actual system calls. By using the API, certain benefits can be gained:
 Portability: as long a system supports an AP I, any program using that API can compile
and run.
 Ease of Use: using the API can be significantly easier than using the actual system call.

System Call Implementation-


Typically, a number associated with each system call.
System-call interface maintains a table indexed according to theseNumbers.
The system call interface invokes intended system call in OS kernel and returns status of the
system call and any return values
The caller need know nothing about how the system call is
implemented Just needs to ob ey API and understand what OS will
do as a result call Most details of OS interface hidden from
programmer b y API
Managed by run-time support library (set of functions built into libraries included with compiler)
API – System Call – OS Relationship-

Types of System Calls

There are 5 different categories of system calls :


1. Process control,
2. File manipulation,
3. Device manipulation,
4. Information maintenance,
5. Communication.

1. Process Control
A running program needs to be able to stop execution either normally or abnormally.
When execution is stopped abnormally, often a dump of memory is taken and can be
examined with a debugger.
2. File Management
Some common system calls are create, delete, read, write, reposition, or close. Also,
there is a need to determine the file attributes – get and set file attribute. Many times
the OS provides an API to make these system calls.
3. Device Management
Process usually requires several resources to execute, if these resources are available,
they will be granted and control returned to the user process. These resources are also
thought of as devices. Some are physical, such as a video card, and others are abstract,
such as a file.
User programs request the device, and when finished they release the device. S imilar to
files, we can read, write, and reposition the device.

4. Information Management
Some system calls exist purely for transferring information between the user program
and the operating system. An example of this is time, or date.
The OS also keeps information about all its processes and provides system calls to
report this information.
5. Communication
There are two models of interprocess communication, the message-passing model
and the shared memory model.
Message-passing uses a common mailbox to pass messages between processes.
Shared memory use certain system calls to create and gain access to create and gain
access to regions of memory owned by other processes. The two processes exchange
information by reading and writing in the shared data.

2.3 Components of operating system

Process Management
A process is a pro gram in execution. It is a unit of work within the system. Pro gram is a
passive entity, process is an active entity.
Process needs reso urces to accomp lish
its task
CPU, memory,
I/O, files
Initializati
on data
Process termination requires reclaim of any reusable
resources
Single-threaded process has one program counter specifying location of next instruction to
execute
Process executes instructions sequentially, one at a time, until
comp letion
Multi-threaded process has one program counter
per thread
Typically system has many processes, some user, some operating system running concurrently
on o ne or more CP Us
Concurrency by multiplexing the CPUs among the processes / threads

Process Management Activities


The 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

Main Memo ry Management


All data in memo ry befo re and after
processing
All instructions in memory in order to
execute
Memory management determines what is in
memory when
Optimizing CP U utilization and computer response
to users
Memory management activities
Keeping track of which parts of memo ry are currently being used and by
whom Decid ing which processes (or parts thereof) and data to move into and
out of memo ry Allocating and deallocating memo ry space as needed
Storage Management
OS provides unifo rm, logical view of information sto rage
Abstracts p hysical properties to logical storage unit - file
Each med ium is co ntrolled by device (i. e., disk d rive, tape drive)
Varying properties include access speed, capacity, data-transfer rate, access method
(sequential or random)
File-System management
Files usually o rganized into directories
Access control on most systems to determine who can access what
OS activities include
Creating and deleting files and
directories P rimitives to
manipulate files and dirs Mapping
files onto secondary storage
Backup files onto stable (no n- volatile) storage media

Mass-Storage Management
Usually disks used to store data that does not fit in main memory or data that must be kept for a
―long‖
period of time
Proper management is of central importance
Entire speed of computer operation hinges on disk sub system and its algo rithms
MASS STORAGE
activities Free-
space management
Storage allocation
Disk scheduling
Some storage need not be fast
Tertiary storage includes optical sto rage, magnetic tape
Still must be managed
Varies between WORM (write-once, read- many-times) and RW (read-write)

I/O System Manage ment


One purpose of OS is to hide peculiarities of hardware devices from the user
I/O sub system responsible for
Memory management of I/O including buffering (storing data temporarily while it is being
transferred), caching (storing parts of data in faster storage for performance), spooling (the
overlapping of o utput of one job with input of other jobs)
General device-driver interface
Drivers for specific hardware devices

Protection and Security-


Protection – any mechanism for controlling access of processes or users to resources defined by the
OS
Security – defense o f the system against internal and external attacks
Huge range, including denial-o f-service, worms, viruses, identity theft, theft of service
Systems generally first d istinguish among users, to determine who can do what
User identities (user IDs, security IDs) include name and associated number, one per user
User ID then associated with all files, processes of that user to determine access control
Group identifier (group ID) allows set of users to be defined and controls managed, then
also associated with each process, file
Privilege escalation allows user to change to effective ID with more rights

2.3 Components of operating system

Process Management
A process is a pro gram in execution. It is a unit of work within the system. Pro gram is a
passive entity, process is an active entity.
Process needs reso urces to accomp lish
its task
CPU, memory,
I/O, files
Initializati
on data
Process termination requires reclaim of any reusable
resources
Single-threaded process has one program counter specifying location of next instruction to
execute
Process executes instructions sequentially, one at a time, until
comp letion
Multi-threaded process has one program counter
per thread
Typically system has many processes, some user, some operating system running concurrently
on o ne or more CP Us
Concurrency by multiplexing the CPUs among the processes / threads
Process Management Activities
The 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

Main Memo ry Management


All data in memo ry befo re and after
processing
All instructions in memory in order to
execute
Memory management determines what is in
memory when
Optimizing CP U utilization and computer response
to users
Memory management activities
Keeping track of which parts of memo ry are currently being used and by whom
Decid ing which processes (or parts thereof) and data to move into and out of
memo ry Allocating and deallocating memo ry space as needed
Storage Management
OS provides unifo rm, logical view of information sto rage
Abstracts p hysical properties to logical storage unit - file
Each med ium is co ntrolled by device (i. e., disk d rive, tape drive)
Varying properties include access speed, capacity, data-transfer rate, access method
(sequential or random)
File-System management
Files usually o rganized into directories
Access control on most systems to determine who can access what
OS activities include
Creating and deleting files and
directories P rimitives to manipulate
files and dirs Mapping files onto
secondary storage
Backup files onto stable (no n- volatile) storage media

Mass-Storage Management
Usually disks used to store data that does not fit in main memory or data that must be kept for a
―long‖
period of time
Proper management is of central importance
Entire speed of computer operation hinges on disk sub system and its algo rithms
MASS STORAGE
activities Free-space
management Storage
allocation
Disk scheduling
Some storage need not be fast
Tertiary storage includes optical sto rage, magnetic tape
Still must be managed
Varies between WORM (write-once, read- many-times) and RW (read-write)

I/O System Manage ment


One purpose of OS is to hide peculiarities of hardware devices from the user
I/O sub system responsible for
Memory management of I/O including buffering (storing data temporarily while it is being
transferred), caching (storing parts of data in faster storage for performance), spooling (the
overlapping of o utput of one job with input of other jobs)
General device-driver interface
Drivers for specific hardware devices
Protection a nd Security
Protection – any mechanism for controlling access of processes or users to resources defined by the OS
Security – defense o f the system against internal and external attacks
Huge range, including denial-o f-service, worms, viruses, identity theft, theft of service
Systems generally first d istinguish among users, to determine who can do what
User identities (user IDs, security IDs) include name and associated number, one per user
User ID then associated with all files, processes of that user to determine access control
Group identifier (group ID) allows set of users to be defined and controls managed, then also
associated with each process, file
Priv ilege escalation allows user to change to effective ID with more rights

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy