Services and Component of Operating System1

You might also like

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

Unit 2

Mark 08
SERVICES AND COMPONENT OF OPERATING SYSTEM
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 SystemServices
Oneset ofoperating-system services provides functions that arehelpful tothe user
Communications– Processes may exchange information, on the same computer orbetween
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, inI/O devices, in user programForeach typeof error, OS should takethe
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
Manytypes 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 onlyas strongas 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 API
invoke the actual system calls .By using the API, certain benefits can be gained:
 Portability: as long a system supports an API, 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 these Numbers.
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 obey
API and understand what OS will do as a result call Most details of OS interface hidden from
programmer by API
Managed by run-time support library (set of functions built into libraries included with compiler)
API– SystemCall–OSRelationship-

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 AP It 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.
Similar 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 model so inter process communication, the message-passing
model and the shared memory model.
Message-passing uses a common mail box 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 program in execution. It is a unit of work within the system. Program is a
Passive entity, process is an active entity.
Process needs resources to
accomplish its task
CPU,
memory,
I/O, files
Initializati
On data
Process termination requires reclaim of any
reusable resource
Single-threaded process has one program counter specifying location of next
instruction to execute
Process executes instructions sequentially, one at a time,
until completion
Multi-threaded process has one program counter
Per thread
Typically system has many processes, some user, and some operating system running
concurrently on one or more CPUs
Concurrency by multiplexing the CPU among the processes/ threads

Process Management Activities


Theoperatingsystemisresponsibleforthefollowing activitiesinconnection with
processmanagement:
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 dead lock handling

Main Memory Management


All data in memory before and
after processing
All instructions in memory in or
der to execute
Memory management determines what is
in memorywhen
Optimizing CPU utilization and computer
response to users
Memory management activities
Keeping track of which parts of memory are currently being used and
by whom Deciding which processes (or parts the re of)and data to move
into and out of memory Allocating and de allocating memory space as
needed
Storage Management
OS provides uniform ,logical view of information storage
Abstracts physical properties to logical storage unit-file
Each medium is controlled by device(i.e., disk drive,tapedrive)
File-System management
Files usually organized into directories
Access control on most systems to determine who can access what
OS activities include
Creating and deleting files
and directories Primitives to
manipulate files and dirs.
Mapping file so into
secondary storage
Backup files on to stable(non-volatile)storage media.

Mass-Storage Management
Usually disks used to store data that does not fit in main memory or data that must b kept
for a ―long period of time Proper managements of central importance

MASS TORAGE activities Free-space management Storage allocation


Disk scheduling Some storage need not be fast

I/O System Management


One purpose of OS i s to hide peculiarities of hardware devices from the user
I/O subsystem 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 or
performance), spooling (the overlapping of output of one job within put 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 of the system against internal and external attacks
Huge range, including denial-of-service, worms, viruses, identity theft of service
Systems generally first distinguish among users, to determine who can do what
User identities (userIDs, securityIDs include name and associated number, one per user
UserID the nassociated with all files, processes of that user to determine access control
Group identifier (groupID)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

You might also like