0% found this document useful (0 votes)
56 views20 pages

Operating System Services and Components

The document provides an overview of operating systems, detailing their functions, components, and various types such as batch, multiprogrammed, time-sharing, and real-time systems. It explains key concepts like process management, memory management, file management, and I/O system management, as well as the characteristics, advantages, and disadvantages of operating systems. Additionally, it discusses the differences between multiprogramming and multitasking, and outlines the role of mobile operating systems.

Uploaded by

ketankotane552
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views20 pages

Operating System Services and Components

The document provides an overview of operating systems, detailing their functions, components, and various types such as batch, multiprogrammed, time-sharing, and real-time systems. It explains key concepts like process management, memory management, file management, and I/O system management, as well as the characteristics, advantages, and disadvantages of operating systems. Additionally, it discusses the differences between multiprogramming and multitasking, and outlines the role of mobile operating systems.

Uploaded by

ketankotane552
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

OSY (315319)

Unit - I Operating System Services and Components

CO1 - Explain the services and components of an Operating System


Theory Learning Outcomes (TLO's)aligned to CO's
TLO 1.1 Describe functions of an Operating System.
TLO 1.2 Explain different services of Operating System.
TLO 1.3 Explain use of system call of Operating System.
TLO 1.4 Explain activities of Operating System in Concern with their components.

Learning content mapped with Theory Learning Outcomes (TLO's) and CO's.
1.1 Operating System: concept, functions
1.2 Different types of Operating System: Batch Operating System, Multi-programmed, Time Shared Operating System,
Multiprocessor System, Distributed System, Real Time System, Mobile OS (Android OS)
1.3 Command line-based Operating System: DOS, UNIX GUI based Operating System: WINDOWS, LINUX, MaC OS
1.4 Different Services of Operating System, System Calls: Concept, types of system calls
1.5 Operating System Components: Process Management, Main Memory Management, File Management, IO
Management, Secondary Storage Management

Operating System Software


• Microsoft windows
• Linux
• Unix
• Ubuntu
• Windows 7,10,8
• Windows xp
• Various Linux O.S
• Debian
• Gentoo
• Ubuntu
• Linux mint

What is operating system?


An operating system (OS) is system software that manages computer hardware and software resources and
provides common services for computer programs.
Operating System is collection of set of programs which manage all the resources of the computer system
A O.s that acts as an intermediary between a user of a computer and the computer hardware.

Characteristics of O.S.
[Link]

1
OSY (315319)

[Link] management
[Link]
4. Interact with different software
[Link] management
[Link] Management
Advantages:
1. Os provides a GUI interface for the user in the form of menu icons and buttons .
2. Os also allow us to sharing the resources with other users
3. It helps user to understand the functions of a computer
4. It is very easy to use.
5. It can be easily updated
Disadvantages
[Link] the o.s is corrupted than it will be affected entire system and the computer system will not work .
[Link] same task run at a time. 1000-10 task will be run
List any four functions or operations of operating system.
Process Management
A process is a program in execution. A process needs certain resources, including CPU time, memory,
files, and I/O devices, to accomplish its task.
Managing the programs that are running. The operating system is responsible for the following activities in
connection with process management.
✦Process creation and deletion.
✦process suspension and resumption.
✦Provision of mechanisms for:
•process synchronization
•process communication
Main-Memory Management
Memory is a large array of words or bytes, each with its own address. It is a repository of quickly
accessible data shared by the CPU and I/O devices.
Main memory is a volatile storage device. It loses its contents in the case of system failure.
Managing and mentioning the memory between processes and data
The operating system is responsible for the following activities in connections with memory management:
♦Keep track of which parts of memory are currently being used and by whom.
♦Decide which processes to load when memory space becomes available.
♦Allocate and de-allocate memory space as needed.
File Management
A file is a collection of related information defined by its creator. Commonly, files represent programs
(Both source and object forms) and data.
The operating system is responsible for the following activities in connections with file management:
✦File creation and deletion.
✦Directory creation and deletion.
✦Support of primitives for manipulating files and directories.
✦Mapping files onto secondary storage.
✦File backup on stable (nonvolatile) storage media.
I/O System Management
Managing the input and output
The I/O system consists of:
✦A buffer-caching system
✦A general device-driver interface
✦Drivers for specific hardware devices

2
OSY (315319)

Secondary-Storage Management
Since main memory (primary storage) is volatile and too small to accommodate all data and programs
permanently, the computer system must provide secondary storage to back up main memory.
Managing the permanent Storage of data on disks or other media.
Most modern computer systems use disks as the principle on-line storage medium, for both programs and data.
The operating system is responsible for the following activities in connection with disk management:
✦Free space management
✦Storage allocation
✦Disk scheduling
Networking (Distributed Systems)
♦A distributed system is a collection processor that do not share memory or a clock. Each processor has
its own local memory.
♦The processors in the system are connected through a communication network.
♦Communication takes place using a protocol.
♦A distributed system provides user access to various system resources.
♦Access to a shared resource allows:
✦Computation speed-up
6. Security and Protection – Securing the system against possible unauthorized access to data or any other
entity. Protecting the parts of the system against damage.

List and draw a neat labelled diagram of four components of a computer system.

A computer system can be divided into four components:


1) The hardware.
2) The operating system
3) Application programs
4) The users

Computer System Components


1. Hardware – provides basic computing resources (CPU, memory, I/O devices).
2. Operating system – controls and coordinates the use of the hardware among the various application
programs for the various users.

3
OSY (315319)

3. Applications programs – Define the ways in which the system resources are used to solve the computing
problems of the users (compilers, database systems, video games, business programs).
4. Users (people, machines, other computers).
Operating System views system point of view
Resource allocator – manages and allocates resources.
Control program – controls the execution of user programs and operations of I/O devices.
Kernel – The one program running at all times (all else being application programs).
Components of OS: OS has two parts.
(1) Kernel. (2) Shell.
(1) Kernel is an active part of an OS i.e.; it is the part of OS running at all times. It is a program which
can interact with the hardware. Ex: Device driver, dll files, system files etc.

(2) Shell is called as the command interpreter. It is a set of programs used to interact with the application
programs. It is responsible for execution of instructions given to OS (called commands).

Operating systems can be explored from two viewpoints: the user and the system.
User View: From the user’s point view, the OS is designed for one user to monopolize its resources, to
maximize the work that the user is performing and for ease of use.
System View: From the computer's point of view, an operating system is a control program that manages the
execution of user programs to prevent errors and improper use of the computer. It is concerned with the
operation and control of I/O devices.
List different types of operating systems
Different types of operating systems:
• Mainframe systems
• Multiprocessor systems
• Distributed systems
• Real time systems
[Link] Systems
Reduce setup time by batching similar jobs Automatic job sequencing – automatically transfers control from one
job to another. First rudimentary
operating system. Resident monitor
initial control in monitor
control transfers to job
when job completes control transfers pack to monitor
Explain [Link] operating system.
A batch operating system normally reads a stream of separate jobs (from a card reader. For example), each with
its own control cards that predefine to prevent errors and improper use of the computer. The batch os will work to
submit similar kinds of job together. In this os user do not interact directly with our computer system.
 A batch system is one in which jobs are bundled together with the instruction necessary to allow them to be
processed without intervention. Often jobs of a similar nature can be bundled together to further increase
economy.
 Common input devices were card readers and tape drives. The basic physical layout of the memory of batch job
computer is shown in fig.
 The OS was simple, its major task was to transfer control from one job to the next. The job was submitted to the
computer operator in form of punch cards. At some later time the output appeared.

4
OSY (315319)

Advantages –it is useful when we working with large files which can take more time to execute
Disadvantage :-once the job is submitted the user did not have any interaction with it.

Example of batch os :bank statements


.

Explain 3. Multiprogramming operating system.

 In this the operating system picks up and begins to execute one of the jobs from memory.
 Once this job needs an I/O operation operating system switches to another job (CPU and OS always busy).
 Jobs in the memory are always less than the number of jobs on disk (Job Pool).
 If several jobs are ready to run at the same time, then the system chooses which one to run through the process
of CPU Scheduling.
 In Non-multiprogrammed system, there are moments when CPU sits idle and does not do any work.
 In Multiprogramming system, CPU will never be idle and keeps on processing.
Time Sharing Systems are very similar to Multiprogramming batch systems. In fact time sharing systems are an
extension of multiprogramming systems.
In Time sharing systems the prime focus is on minimizing the response time, while in multiprogramming the
prime focus is to maximize the CPU usage.
Example download software, transfer data, google chrome etc

Explain [Link] sharing or multitasking operating system.


 A time sharing system allows many users to share the computer resources simultaneously.
 The time sharing os works with time sharing concepts.
 Here the cpu will provide a same time peroied to each and every process to complete its task as soon as possible
wheather is it a long process or short processs.
 Since each action or command in a time shared system tends to be short, only a little CPU time is needed for each
user.

5
OSY (315319)

 As the system switches rapidly from one user to the next, each user is given the impression that the entire
computer system is dedicated to his use, even though it is being shared among many users.
 The time sharing systems were developed to provide an interactive use of the computer system.

Example:-

In above figure the user 5 is active but user 1, user 2, user 3, and user 4 are in waiting state where as user 6 is in
ready status. As soon as the time slice of user 5 is completed, the control moves on to the next ready user i.e. user
6. In this state user 2, user 3, user 4, and user 5 are in waiting state and user 1 is in ready state. The process
continues in the same way and so on.
Example Linux, Unix

Advantages of Time Sharing System

 Each user can get CPU time.


 Efficient CPU utilization.
 Time sharing systems were developed to provide interactive use of a computer system at a reasonable cost.
 A time shared operating system uses CPU scheduling and multi programming to provide each user with a small
portion of a time-Shared Computer
 If the process of a task is completed then the time between the other tasks increases.
 Consider p1 will take 2sec to execute other remaining time will share to all other process to increase the process
time of other.

Disadvantages of Time Sharing System:

 The time-shared systems are more complex than the multi-programming systems.
Explain 5 .Multiprocessor Operating System
Multiprocessor Operating System refers to the use of two or more central processing units (CPU) within a
single computer system. These multiple CPUs are in a close communication sharing the computer bus, memory
and other peripheral devices. The basic organization of multiprocessing system is shown in fig.

Example windows xp ,nt ect

6
OSY (315319)

Describe 6. Distributed Operating system.

Distributed systems use multiple central processors to serve multiple real-time applications and multiple users.
Data processing jobs are distributed among the processors accordingly. The processors communicate with one
another through various communication lines (such as high-speed buses or telephone lines). These are referred as
loosely coupled systems or distributed systems. Processors in a distributed system may vary in size and
function. These processors are referred as sites, nodes, computers, and so on. The advantages of distributed
systems are as follows –
 With resource sharing facility, a user at one site may be able to use the resources available at another.
 Speedup the exchange of data with one another via electronic mail.
 If one site fails in a distributed system, the remaining sites can potentially continue operating.
 Better service to the customers.
 Reduction of the load on the host computer.
 Reduction of delays in data processing.

When many computers are interconnected to each other through a network for the purpose of sharing therir task
then it is called dos.
Advantages .if node is overused the dos shares all load to other node of network
Disadv, if the network is spread communication of all computers is broken

Describe [Link] time operating system in brief.


Rtos is very useful where we required a quick response for eg hospital report.
In this oscpu provides maximum efforts to its task with quick response quick response
Real time systems are used in environment where a large number of events, mostly external to the computer
system, must be accepted and processes in a short time or within certain deadlines. Such applications include real-
time simulations, flight control, industrial control, military applications etc.
A primary objective of real-time systems is to provide quick event response time and thus meet the scheduling
deadlines. User convenience and resource utilization are of secondary concern to real time system designers. In
Real time systems, processor is allocated to the highest priority process among those that are ready to execute.
Higher priority processes preempt execution of the lower priority processes. This form is called as ‘priority –
based preemptive scheduling’.
The primary functions of the real time operating system are to:
1. Manage the processor and other system resources to meet the requirements of an application.
2. Synchronize with and respond to the system events.
3. Move the data efficiently among processes and to perform coordination among these processes.
Advantages quick response.
Disadvantage : these os is very costly
Types of real time system:
1. Hard real time:-

7
OSY (315319)

Hard real time means strict about adherence to each task deadline. When an event occurs, it should be serviced
within the predictable time at all times in a given hard real time system.
Example: -video transmission, each picture frame and audio must be transferred at fixed rate.
2. Soft real time: -
Soft real time means that only the precedence and sequence for the task operations are defined, interrupt latencies
and context switching latencies are small. There can be few deviations between expected latencies of the tasks
and observed time constraints and a few deadline misses are accepted.
Example: - Mobile phone, digital cameras and orchestra playing robots.

Difference multiprogramming and multitasking

BASIS FOR MULTIPROGRAMMING MULTITASKING


COMPARISON
Basic Enables multiple programs to utilize A supplementary form of the
CPU simultaneously. multiprogramming system also supports
user interaction.
Objective Improvement in CPU utilization. Minimize the response time.

Switching Occurs when the currently running Carried out each time after the time slice
process stops. of process is finished.

Complexity Simple Complex

Difference between Multi-programming OS and Time sharing OS

Multi-programming OS Time sharing OS


The process can be executed by a single In this process two or more users can uses a
processor processor on their own terminal
It has no fixed time slice It has fixed time slice
In case of multi-programming before finishing The execution power is taken off before
a task the execution power is not taken off finishing of execution

Example: Mac OS Example: Windows NT

Explain Mobile OS
A mobile operating system is the software platform on top of which other programs can run on mobile devices.
The operating system is responsible for determining the functions and features available on your device
The Android Operating System is a Linux-based OS developed by the Open Handset Alliance (OHA).
The Android mobile operating system is Google's open and free software stack that includes an operating
system, middleware and also key applications for use on mobile devices, including smartphones.

8
OSY (315319)

Android OS Architecture

Android operating system comprise of different software components arranges in stack.


Different components of android operating system are –

1. Linux kernel
2. Libraries
3. Android Run time
4. Application Framework
5. Applications

Linux kernel

1. Bottom layer of android operating system is Linux kernel.


2. Android is built on top of Linux 2.6 Kernel and few architectural changes made by Google.
3. Linux Kernel provides the basic system functionality such as process management, memory management and
device management
4. Linux kernel also provides array of device drivers which make our task easier while interfacing the android with
peripheral devices.
Libraries

1. On the top of Linux Kernel another layer called libraries is present.


2. It provides the different libraries useful for well-functioning of android operating system.
3. Libraries are java libraries build specific for android operating system.
Android Runtime

[Link] is third component of the android architecture and placed in second layer from bottom
[Link] provides most important part of android called Dalvik Virtual Machine.
[Link] Virtual Machine is similar to JVM but only difference is that it is designed and optimized for Android.
[Link] Virtual machine uses core functions of Linux such as memory management and multithreading and
enables each android app to run its own process.
Application framework

9
OSY (315319)

1. It is 2nd topmost component in android operating system stack


2. Android applications directly interacts with application framework.
3. Application framework manages the basic functions of android device such as resource management, voice call
management etc.
Applications
Applications created by third party users or developer will be installed on application layer.

Services and components of operating system


Operating System Services

Following are the five services provided by operating systems to the convenience of the users.
1. Program Execution
The purpose of computer system is to allow the users to execute programs in an efficient manner. The operating
system provides an environment where the user can conveniently run these programs. The user does not have to
worry about the memory allocation or de-allocation or any other thing because these things are taken care of by
the operating system.
To run a program, the program is required to be loaded into the RAM first and then to assign CPU time for its
execution. Operating system performs this function for the convenience of the user. It also performs other
important tasks like allocation and de-allocation of memory, CPU scheduling etc.
2. I/O Operations
Each program requires an input and after processing the input submitted by user it produces output. This involves
the use of I/O devices. The operating system hides the user from all these details of underlying hardware for the
I/O. So the operating system makes the users convenient to run programs by providing I/O functions. The I/O
service cannot be provided by user-level programs and it must be provided by the operating system.
3. File System Manipulation
While working on the computer, generally a user is required to manipulate various types of files like as opening a
file, saving a file and deleting a file from the storage disk. This is an important task that is also performed by the
operating system.
Thus operating system makes it easier for the user programs to accomplish their task by providing the file system
manipulation service. This service is performed by the 'Secondary Storage Management' a part of the operating
system.
4. Communication

10
OSY (315319)

Operating system performs the communication among various types of processes in the form of shared memory.
In multitasking environment, the processes need to communicate with each other and to exchange
their information. These processes are created under a hierarchical structure where the main process is known as
parent process and the sub processes are known as child processes.
5. Error Detection
Operating system also deals with hardware problems. To avoid hardware problems the operating system
constantly monitors the system for detecting the errors and fixing these errors (if found). The main function of
operating system is to detect the errors like bad sectors on hard disk, memory overflow and errors related to I/O
devices. After detecting the errors, operating system takes an appropriate action for consistent computing.
This service of error detection and error correction cannot be handled by user programs because it involves
monitoring the entire computing process. These tasks are too critical to be handed over to the user programs. A
user program, if given these privileges; can interfere with the corresponding operation of the operating systems.
6. Resource allocation
In the multitasking environment, when multiple jobs are running at a time, it is the responsibility of an operating
system to allocate the required resources (like as CPU, main memory, tape drive or secondary storage etc.) to
each process for its better utilization. For this purpose various types of algorithms are implemented such as
process scheduling, CPU scheduling, disk scheduling etc.
7. Accounting
Operating system keeps an account of all the resources accessed by each process or user. In multitasking,
accounting enhances the system performance with the allocation of resources to each process ensuring the
satisfaction to each process.
8. Protection System
If a computer system has multiple users and allows the concurrent execution of multiple processes, then the
various processes must be protected from one another's activities.
9. Accounting
This service of the operating system keeps track of which users are using how much and what kinds of computer
resources have been used for accounting or simply to accumulate usage statistics.
10. Protection and Security
Protection includes in ensuring all access to system resources in a controlled manner. For making a system secure,
the user needs to authenticate him or her to the system before using (usually via login ID and password).
System Calls Implementation

 System calls provide an interface between a user program and Operating System.
 These are set of functions methods. Most system calls are written in assembly language and are machine
dependent.
 Numerous higher level languages such as ‘C’ also permit to make system calls directly.
 When program in user mode requires access to hardware resources, it must ask the kernel to provide access to that
resources .this is done by system call.
 Hardware resources like CPU, memory and i/o devices
 When program makes a system call the mode is switched from user mode to kernel mode this is call context
switch.

11
OSY (315319)

 Kernel mode:-when cpu is in kernel mode the code or program being executed can access any memory address
and hardware resources hence kernel mode is powerful mode.
 User mode :when cpu is in user mode the pgms don’t have direct access to memory and hardware resources

The system call interface layer includes entrance point in kernel code. All system resources are managed and
controlled by the kernel. Any request from user or application that occupies access to any system resource must
be tackled by kernel code. The user process must not be given entire access to kernel code for security cause.
Many opening into kernel code called system calls are provided to the user so that the user processes can raise the
execution of kernel code.
System calls permit processes and users to Operating System resources.

1. Each system call associated with a particular number.


2. System call interface maintains a table indexed according to these numbers.
3. The system call interface invokes intended system call in operating system kernel& returns status of the system
call and any return values.
4. The caller needs to know nothing about how the system call is implemented. Just needs to obey API and
understand what OS will do as a result call.
5. Most details of operating system interface hidden from programmers by API. It is managed by run-time support
library.
 System calls provide the interface between a running program and the operating system.
 For example – open input file, create output file, print message to console, terminate with error or normally
 Generally available as routines written in C and C++
 Certain low-level tasks (direct hardware access) may be written in assembly-language
Example of System Calls.

12
OSY (315319)

Types of System Calls

A) Process Control
Processes need to be controlled as in a running process must be able to halt its execution either normally or
abnormally. Also one process may need to run some other process to complete its own execution. So all these
system calls come under this category.
1. end, abort
2. load, execute
3. create process, terminate process
4. get process attributes, set process attributes
5. wait for time, wait event, signal event
6. allocate and free memory
B) File Management
System calls which deal with operations related to files fall under this type.
1. create file, delete file
2. open, close
3. read, write, reposition
4. get file attributes, set file attributes

13
OSY (315319)

C) Device Management
A process may need several resources for its execution. So system calls used for asking permission from the
kernel to use those resources are included in this type.
1. request device, release device
2. read, write, reposition
3. get device attributes, set device attributes
4. logically attach or detach devices
D) Information Maintenance
We need to keep all the information up to date so these system calls help us to do that.
1. get time or date, set time or date
2. get system data, set system data
3. get process, file, or device attributes
4. set process, file, or device attributes
E) Communication
Processes need to communicate with each other for many reasons like if they need certain resource which is held
by any other process. These system calls assist in doing so.
1. create, delete communication connection
2. send, receive messages
3. transfer status information
4. attach or detach remote devices
Operating System Component
Process Management
The operating system manages many kinds of activities ranging from user programs to system programs like
printer spooler, name servers, file server etc. Each of these activities is encapsulated in a process. A process
includes the complete execution context (code, data, PC, registers, OS resources in use etc.).
It is important to note that a process is not a program. A process is only ONE instant of a program in execution.
There are many processes can be running the same program. The five major activities of an operating system in
regard to process management are
 Creation and deletion of user and system processes.
 Suspension and resumption of processes.
 A mechanism for process synchronization.
 A mechanism for process communication.
 A mechanism for deadlock handling.

Main-Memory Management
Primary-Memory or Main-Memory is a large array of words or bytes. Each word or byte has its own address.
Main-memory provides storage that can be access directly by the CPU. That is to say for a program to be
executed, it must in the main memory.
The major activities of an operating in regard to memory-management are:
 Keep track of which part of memory are currently being used and by whom.
 Decide which process are loaded into memory when memory space becomes available.
 Allocate and deallocate memory space as needed.
File Management
A file is a collected of related information defined by its creator. Computer can store files on the disk (secondary
storage), which provide long term storage. Some examples of storage media are magnetic tape, magnetic disk and
optical disk. Each of these media has its own properties like speed, capacity, data transfer rate and access
methods.
A file systems normally organized into directories to ease their use. These directories may contain files and other
directions.

14
OSY (315319)

The five main major activities of an operating system in regard to file management are
1. The creation and deletion of files.
2. The creation and deletion of directions.
3. The support of primitives for manipulating files and directions.
4. The mapping of files onto secondary storage.
5. The back up of files on stable storage media.

I/O System Management


I/O subsystem hides the peculiarities of specific hardware devices from the user. Only the device driver knows the
peculiarities of the specific device to whom it is assigned.

Secondary-Storage Management
Generally speaking, systems have several levels of storage, including primary storage, secondary storage and
cache storage. Instructions and data must be placed in primary storage or cache to be referenced by a running
program. Because main memory is too small to accommodate all data and programs, and its data are lost when
power is lost, the computer system must provide secondary storage to back up main memory. Secondary storage
consists of tapes, disks, and other media designed to hold information that will eventually be accessed in primary
storage (primary, secondary, cache) is ordinarily divided into bytes or words consisting of a fixed number of
bytes. Each location in storage has an address; the set of all addresses available to a program is called an address
space.
The three major activities of an operating system in regard to secondary storage management are:
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.
Networking
A distributed systems is a collection of processors that do not share memory, peripheral devices, or a clock. The
processors communicate with one another through communication lines called network. The communication-
network design must consider routing and connection strategies, and the problems of contention and security.

Protection System
If a computer systems has multiple users and allows the concurrent execution of multiple processes, then the
various processes must be protected from one another's activities. Protection refers to mechanism for controlling
the access of programs, processes, or users to the resources defined by a computer systems.

Command Interpreter System


A command interpreter is an interface of the operating system with the user. The user gives commands with are
executed by operating system (usually by turning them into system calls). The main function of a command
interpreter is to get and execute the next user specified command. Command-Interpreter is usually not part of the
kernel, since multiple command interpreters (shell, in UNIX terminology) may be support by an operating system,
and they do not really need to run in kernel mode. There are two main advantages to separating the command
interpreter from the kernel.
1. If we want to change the way the command interpreter looks, i.e., I want to change the interface of command
interpreter, I am able to do that if the command interpreter is separate from the kernel. I cannot change the code of
the kernel so I cannot modify the interface.
2. If the command interpreter is a part of the kernel it is possible for a malicious process to gain access to certain
part of the kernel that it showed not have to avoid this ugly scenario it is advantageous to have the command
interpreter separate from kernel.

15
OSY (315319)

Question Answers:
Q1) What is process management? State for functions to be performed by OS for process management.
A Program does nothing unless its instructions are executed by a CPU. A program in execution is called a
process.
There may exist more than one process in the system which may require the same resource at the same time.
Therefore, the operating system has to manage all the processes and the resources in a convenient and efficient
way.
Some resources may need to be executed by one process at one time to maintain the consistency otherwise the
system can become inconsistent and deadlock may occur.
The operating system is responsible for the following activities in connection with Process Management
1. Scheduling processes and threads on the CPUs.
2. Creating and deleting both user and system processes.
3. Suspending and resuming processes.
4. Providing mechanisms for process synchronization.
5. Providing mechanisms for process communication.

Q2) List any four OS services and describe it.

2. Program Execution
The purpose of computer system is to allow the users to execute programs in an efficient manner. The operating
system provides an environment where the user can conveniently run these programs. The user does not have to
worry about the memory allocation or de-allocation or any other thing because these things are taken care of by
the operating system.
To run a program, the program is required to be loaded into the RAM first and then to assign CPU time for its
execution. Operating system performs this function for the convenience of the user. It also performs other
important tasks like allocation and de-allocation of memory, CPU scheduling etc.
2. I/O Operations
Each program requires an input and after processing the input submitted by user it produces output. This involves
the use of I/O devices. The operating system hides the user from all these details of underlying hardware for the
I/O. So the operating system makes the users convenient to run programs by providing I/O functions. The I/O
service cannot be provided by user-level programs and it must be provided by the operating system.
3. File System Manipulation
While working on the computer, generally a user is required to manipulate various types of files like as opening a
file, saving a file and deleting a file from the storage disk. This is an important task that is also performed by the
operating system.

16
OSY (315319)

Thus operating system makes it easier for the user programs to accomplish their task by providing the file system
manipulation service. This service is performed by the 'Secondary Storage Management' a part of the operating
system.
4. Communication
Operating system performs the communication among various types of processes in the form of shared memory.
In multitasking environment, the processes need to communicate with each other and to exchange
their information. These processes are created under a hierarchical structure where the main process is known as
parent process and the sub processes are known as child processes.
5. Error Detection
Operating system also deals with hardware problems. To avoid hardware problems the operating system
constantly monitors the system for detecting the errors and fixing these errors (if found). The main function of
operating system is to detect the errors like bad sectors on hard disk, memory overflow and errors related to I/O
devices. After detecting the errors, operating system takes an appropriate action for consistent computing.
This service of error detection and error correction cannot be handled by user programs because it involves
monitoring the entire computing process. These tasks are too critical to be handed over to the user programs. A
user program, if given these privileges; can interfere with the corresponding operation of the operating systems.
6. Resource allocation
In the multitasking environment, when multiple jobs are running at a time, it is the responsibility of an operating
system to allocate the required resources (like as CPU, main memory, tape drive or secondary storage etc.) to
each process for its better utilization. For this purpose various types of algorithms are implemented such as
process scheduling, CPU scheduling, disk scheduling etc.
7. Accounting
Operating system keeps an account of all the resources accessed by each process or user. In multitasking,
accounting enhances the system performance with the allocation of resources to each process ensuring the
satisfaction to each process.
8. Protection System
If a computer system has multiple users and allows the concurrent execution of multiple processes, then the
various processes must be protected from one another's activities.
9. Accounting
This service of the operating system keeps track of which users are using how much and what kinds of computer
resources have been used for accounting or simply to accumulate usage statistics.
10. Protection and Security
Protection includes in ensuring all access to system resources in a controlled manner. For making a system secure,
the user needs to authenticate him or her to the system before using (usually via login ID and password).

Q3)What is system call? List type of system calls with example.


System Calls: System calls are programming interface to the services provided by the operating system.

17
OSY (315319)

1. Each system call associated with a particular number.


2. System call interface maintains a table indexed according to these numbers.
3. The system call interface invokes intended system call in operating system kernel& returns status of the system
call and any return values.
4. The caller needs to know nothing about how the system call is implemented. Just needs to obey API and
understand what OS will do as a result call.
5. Most details of operating system interface hidden from programmers by API. It is managed by run-time support
library.

System calls-
System calls related to process control: End, Abort Load, Execute Create process, Terminate process Ready
process, Dispatch process Suspend, Resume Get Process attribute, set attribute Wait for time Wait event, signal
event
System calls Related to File management: Create file, delete file Open file , Close file Create directory Read,
write, Reposition Get file attribute , set file attribute Create a link Change the working directory
System calls Related to Device Management: Request a device, Release a device Read, Write, Reposition Get
device attribute, set device attribute
System calls Related to Information Maintenance: Get Time or Date, Set Time or Date Get System data,
Set system data Get process, file or device attributes Set process, file or Device attributes.

Q4) Explain how parameter passing is done while implementing system calls.
Three general methods exist for passing parameters to the OS:
1. Parameters can be passed in registers.
2. When there are more parameters than registers, parameters can be stored in a block and the block address can be
passed as a parameter to a register.
3. Parameters can also be pushed on or popped off the stack by the operating system.

18
OSY (315319)

Q5) What are the activities involved in secondary storage management?


The three major activities of an operating system in regard to secondary storage management
are:
a. Managing the free space available on the secondary-storage device.
b. Allocation of storage space when new files have to be written.
c. Scheduling the requests for memory access.

Q6) Describe activities of I/O system and secondary storage Management.


I/O System: Input / Output device management provides an environment for the better interaction between system
and the I / O devices such as printers, scanners, tape drives etc. To interact with I/O devices in an effective
manner, the operating system uses some special programs known as device driver. The device drivers take the
data that operating system has defined as a file and then translate them into streams of bits or a series of laser. A
device driver is a specific type of computer software that is developed to allow interaction with hardware devices.
Typically this continues an interface for communicating with the I/O device, through the specific computer bus or
communication subsystem that the hardware is connected with. The device driver is a specialized hardware
dependent computer program that enables another program, typically an operating system to interact transparently
with a hardware device, and usually provides the required interrupt handling necessary for the time dependent
hardware interfacing.
Activities:
 Providing interfaces to other system components.
 Managing devices
 Transferring data
 Detecting I/O completion
Secondary storage Management: The computer system provides secondary storage to back up main memory.
Secondary storage is required because main memory is too small to accommodate all data and programs, and the
data that it holds is lost when power is lost. Most modern computer systems use disks as the principal on-line
storage medium for programs and data. Most of the programs including compilers, assemblers, word processors,
editors, and formatters are stored on a disk until loaded into memory. Secondary storage consists of tapes drives,
disk drives, and other media.
Activities:
 Free space management
 Storage allocation
 Storage de-allocation
 Disk scheduling.
To read a piece of data that is stored at the end of the file, one has to read all of the data that comes before it-you
cannot jump directly to the desired data. This is similar to the way cassette tape players work. If one wants to

19
OSY (315319)

listen to the last song on a cassette tape, he has to either fast-forward over all of the songs that come before it or
listen to them. There is no way to jump directly to a specific song.

Q) Write use of following system calls.


1) fork ( )
2) exec ( )
3) abort ( )
4) end ()
1. fork () This system call is used to create a new process.
2. exec () This system call is used to replace the process’s memory space with a new program. It loads a binary
file into memory and starts its execution.
3. abort () This system call is used to halt process execution abnormally.
4. end () This system call is used to halt process execution normally.
Open () system call
For most file systems, a program initializes access to a file in a file system using the open system call.
This allocates resources associated to the file (the file descriptor), and returns a handle that the process will use to
refer to that file.

20

You might also like