Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
5 views18 pages

Osy Unit 1

The document provides an overview of operating systems, detailing their services, components, and various types including batch, multiprogrammed, time-shared, multiprocessor, distributed, and real-time systems. It explains the functions of operating systems such as process management, memory management, file system management, and device management, along with their advantages and disadvantages. Additionally, it highlights the importance of operating systems in managing hardware resources and facilitating user interaction with applications.

Uploaded by

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

Osy Unit 1

The document provides an overview of operating systems, detailing their services, components, and various types including batch, multiprogrammed, time-shared, multiprocessor, distributed, and real-time systems. It explains the functions of operating systems such as process management, memory management, file system management, and device management, along with their advantages and disadvantages. Additionally, it highlights the importance of operating systems in managing hardware resources and facilitating user interaction with applications.

Uploaded by

guttesneha831
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Operating System 315319

UNIT I Operating System services and components


Marks: 14
COURSE LEVEL LEARNING OUTCOMES (COS)
CO1 - Explain the services and components of an Operating System

1.1 Operating System: concept, functions


1.2 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 1.3 Command line based Operating System: DOS, UNIX GUI based Operating System:
WINDOWS, LINUX, MaC OS
1.4 1.4 Different Services of Operating System, System Calls: Concept, types of system calls
1.5 1.5 Operating System Components: Process Management, Main Memory Management,
File Management, IO Management, Secondary Storage Management

1.1 Operating System: concept, functions :


 operating System Concept ;
- An OS is a program that manages the computer hardware. It is an interface between the
computer user and hardware.
- In simple terms, when you turn on your computer or phone, it's the OS that boots up first
and manages everything from running apps to connecting to the internet or printing
documents.
- A computer system can be divided roughly into four components: the hardware, the
operating system, the application programs, and the users.

Figure 1.1 : Computer System Components

1
Operating System 315319

1. The hardware - is physical components of computer system. The central


processing unit (CPU), the memory, and the input/output (I/O) devices - provides
the basic computing resources.

2. The operating system – is a program designed to run other programs on a


computer. It is considered as a backbone of computer system which manages both
hardware and software resources. It also controls and coordinates the use of the
hardware among the various application programs for the various users.

3. The application programs – is any program designed to perform a specific


function for the user. The application programs such as word processors,
spreadsheets, compilers, and web browsers—define the ways in which these
resources are used to solve the computing problems of the users.
4. End user – End user are the actual user of the applications, such users can
perform task.

 Operating System Functions :

1. Process Management
- A process is a program in execution.
- The OS is responsible for: Creating and deleting processes, Scheduling
processes (deciding which one runs when), Multitasking (running multiple
processes at once), Handling synchronization and inter-process
communication (IPC).

- Example: While browsing the internet, your antivirus, music player, and
system updates may all be running simultaneously. The OS manages all
these processes efficiently.

2. Memory Management
- Controls how RAM is used and shared.
- Key responsibilities: Allocating and deallocating memory to programs,
Managing virtual memory (using disk space as extra RAM),Memory
protection between different applications.

- Example: When you open Photoshop and a browser, each gets its own
memory block managed by the OS.

3. File System Management


- Manages the creation, deletion, reading, and writing of files.
- Organizes files into directories/folders.
- Maintains information about file location, size, permissions, etc.
- Example: Saving a document in a specific folder on your computer.

2
Operating System 315319

4. Device Management
- Controls all input/output (I/O) devices like keyboard, mouse, printer, USB
drives.
- Uses device drivers to communicate with hardware, Manages I/O
operations through: Buffering (temporary storage), Spooling (managing
print jobs), Interrupt handling.
- Example: When you print a document, the OS sends data to the printer
while letting you continue working.

5. User Interface (UI)


- The OS provides a way for users to interact with the system: Graphical
User Interface (GUI) – like Windows, macOS, Command-Line Interface
(CLI) – like Linux terminal or Command Prompt.
- Example: Clicking icons vs typing commands.

6. Security and Access Control


- Protects data and system resources from unauthorized access.
- Security and access control Provides User authentication (login
credentials),File permissions, Encryption and firewalls.
- Example: Only authorized users can change system settings or access
sensitive files.

7. Resource Management
- Manages hardware resources like CPU, memory, storage, and I/O devices.
- Allocates resources efficiently among different users and tasks.
- Prevents resource conflicts and ensures fair usage.
- Example: If two apps need the printer, the OS queues the requests
properly.

8. Networking
- Manages network connections and data transfer.
- Supports communication between devices using protocols like TCP/IP.
- Enables file sharing, internet access, and remote login.
- Example: Downloading a file from the internet or connecting to a Wi-Fi
network.

9. Error Detection and Handling


- Continuously monitors the system for errors or failures.
- Takes corrective actions or reports errors to the user.
- Example: If an application crashes, the OS may close it safely and provide
a crash report.

1.2 Different types of Operating System

3
Operating System 315319

1.2.1 Batch operating systems


- In this system, the common input devices were card readers and tape
drives. The common output devices were line printers, tape drives, and
card punches.
- The user did not interact directly with the computer systems. Rather, the
user prepared a job —which consisted of the program, the data, and some
control information about the nature of the job. Then job submitted to the
computer operator.
- The job was usually in the form of punch cards. After some time, the
output appeared. The major task of O.S. was to transfer control
automatically from one job to the next. The operating system was always
resident in memory.

Figure: Batch operating System

- The programmers would leave their programs with the operator. To speed
up the processing, the operator would sort programs into batches with
similar requirements and, as the computer became available, he will run
each batch. The output from each job would be sent back to the
appropriate programmer.
- In this execution environment, the CPU is often idle, because the speeds of
the mechanical I/O devices are slower than those of electronic devices.
The improvements in technology introduces a disks resulted in faster I/O
devices.
CPU speeds increased to an even greater extent. The introduction of disk
technology allowed the operating system to keep all jobs on a disk, rather

4
Operating System 315319

than in a serial card reader. The operating system could perform job
scheduling, to use resources and perform tasks efficiently.
 Advantages :
1. Efficient Use of Resources
2. Reduced Setup Time
3. Good for Repetitive Tasks
4. Simple Job Scheduling
 Disadvantages :
1. CPU Utilization is less
2. I/O is slower than CPU, so CPU sits idle
3. Memory utilization is less
4. Difficult to debug program

1.2.2 Multi-programmed Operating System


- To overcome the problem of utilization of CPU and the main memory, the
concept of multiprogramming was introduced. A single user cannot keep
either the CPU or the I/O devices busy at all times. By organizing jobs,
multiprogramming increases CPU utilization so that the CPU always has
one job to execute.
- The idea is as follows: The operating system keeps several jobs in memory
simultaneously (Figure). This set of jobs is a subset of the jobs kept in the
job pool.
- The operating system picks and begins to execute one of the jobs in the
memory. In a non-multi programmed system, the CPU would sit idle. But
in a multiprogramming system, the operating system simply switches to,
and executes, another job. When that job needs to wait, the CPU is
switched to another job, and so on. When the first job finishes waiting then
it gets the CPU back. In this system, at least one job needs to execute, so
that the CPU is never idle. Multiprogramming is the first instance where
the operating system must make decisions for the users.
- Advantages:
1. High and Effective CPU utilization
2. CPU never sits idle so performance increases
- Disadvantages:
1. CPU scheduling is required
2. To accommodate many jobs in memory, memory management is
required.

5
Operating System 315319

Multiprogramming has no guarantee that a program will run in a timely manner. Usually on a
mainframe – the computer has a number of programs loaded into memory and the operating
system switches quickly between them, processing a little bit of each one in turn. The high
speed of the processor makes it seem like more than one program is being run at the same
time. On a PC it is usually called multitasking. If the machine has the capability of causing an
interrupt after a specified time interval, then the operating system will execute each program
for a given length of time, regain control, and then execute another program for a given
length of time, and so on. In the absence of this mechanism, the operating system has no
choice but to begin to execute a program with the expectation, but not the certainty, that the
program will eventually return control to the operating system. If the machine has the
capability of protecting memory, then a bug in one program is less likely to interfere with the
execution of other programs. In a system without memory protection, one program can
change the contents of storage assigned to other programs or even the storage assigned to the
operating system. The resulting system crashes are not only disruptive, they may be very
difficult to debug since it may not be obvious which of several programs is at fault. If
memory can hold several programs, then CPU can switch to another one whenever a program
is awaiting for an I/O to complete.

1.2.3 Time Shared Operating System


Time-sharing is a technique which enables many people, located at various terminals, to use
a particular computer system at the same time. Time-sharing or multitasking is a logical
extension of multiprogramming. Processor's time is shared among multiple users
simultaneously is termed as time-sharing.
The main difference between Multiprogrammed Batch Systems and Time-Sharing Systems is
that in case of Multiprogrammed batch systems, the objective is to maximize processor use,
whereas in Time-Sharing Systems, the objective is to minimize response time.

Multiple jobs are executed by the CPU by switching between them, but the switches occur so
frequently. Thus, the user can receive an immediate response. For example, in a transaction
processing, the processor executes each user program in a short burst or quantum of
computation. That is, if n users are present, then each user can get a time quantum. When the
user submits the command, the response time is in few seconds at most.

6
Operating System 315319

A time-shared operating system uses CPU scheduling and multiprogramming to provide each
user with a small portion of a time. Time-sharing operating systems are even more complex
than multiprogrammed operating systems.
 Advantages
1. Provides the advantage of quick response.
2. Avoids duplication of software.
3. Reduces CPU idle time.
 Disadvantages
1. Problem of reliability.
2. Question of security and integrity of user programs and data.
3. Problem of data communication.

1.2.4 Multiprocessor System


Most systems have single-processor systems; that is, they have only one main CPU.
However, multiprocessor systems (also known as parallel systems or tightly coupled systems)
have more than one processor in close communication, sharing the computer bus, the clock,
and sometimes memory and peripheral devices.
Multiprocessor systems have three main advantages.
1. Increased throughput. By increasing the number of processors, we
hope to get more work done in less time.
2. Economy of scale. Multiprocessor systems can save more money than
multiple single-processor systems, because they can share peripherals,
mass storage, and power supplies.
3. Increased reliability. If functions can be distributed properly among
several processors, then the failure of one processor will not halt the
system, only slow it down.
There are 2 types of Multiprocessor system :
1. Symmetric multiprocessing (SMP)
In which each processor runs an identical copy of the operating system, and these copies
communicate with one another as needed. SMP means that all processors are peers; no
master-slave relationship exists between processors. Each processor concurrently runs a copy
of the operating system. Figure illustrates a typical SMP architecture.

Figure: Symmetric Multiprocessing Architecture


2 Asymmetric multiprocessing

7
Operating System 315319

In which each processor is assigned a specific task. This scheme defines a master-slave
relationship. A master processor controls the system; the other processors either look to the
master for instruction or have predefined tasks.

 Advantages:
1. Less time duration required for the large process.
2. Increase throughput. i.e. more work done in less time.
3. Economy of scale.
4. Increased reliability.
 Disadvantages:
1. If one processor fails then it will affect in speed.
2. These systems are expensive.
2.1.1 Distributed System
A distributed system consists of multiple autonomous computers that communicate through a
computer networks. The word distributed referred to computer networks where individual
computers were physically distributed within some geographical area. It is a collection of
processors that do not share memory. Each processor has its own memory and processor
communicate with each other through communication lines like LAN, WAN etc. A
distributed system may have a common goal, such as solving a large computational problem.
In distributed computing, a problem is divided into many tasks, each of which is solved by
one computer. In this system, each computer may have its own user with individual needs.
The purpose of the distributed system is to coordinate the use of shared resources or provide
communication services to the users.

Following are the four major reasons for building a distributed system: Resource Sharing,
computation speed up, Reliability and communication.

1. Resource Sharing: If a number of different sites are connected to one


other, then a user at one site may be able to use the resources available
at another site.

2. Computation speed up: If particular site is overloaded with jobs, then


some of its job can be moved to other sites so load can be shared.
Computations can be divided into sub-computations and these sub-
computations can be distributed among the various sites and these sub-
computations can be run concurrently and thus it provides computation
speed up.

3. Reliability: If one site fails in a distributed system, the remaining sites


can be continues operating. This gives the system better reliability.

4. Communication: When several sites are connected to one another by


a communication network, the user at different sites can exchange their
information to each other.
8
Operating System 315319

 Advantages
1. With resource sharing facility, a user at one site may be able to use the
resources available at another.
2. Speedup the exchange of data with one another via electronic mail.
3. If one site fails in a distributed system, the remaining sites can
potentially continue operating.
4. Better service to the customers.
5. Reduction of the load on the host computer.
6. Reduction of delays in data processing.
 Disadvantages
1. Complexity
2. Increased Network Traffic
3. Security Risks
4. Lack of Centralized Control

2.1.2 Real Time System


A real-time operating system (RTOS) is an operating system (OS) intended to serve
real-time applications that process data as it comes without buffer delays.
A real-time system has well defined fixed time constraints. Processing must be done
within the defined constraints. Otherwise the system will fail. Real time Operating Systems
are very fast and quick respondent systems.
For example, scientific experiments, medical imaging systems, industrial control
systems, weapon systems, robots, air traffic control systems, etc.
Types of real time system:
1. hard (or immediate real-time system )
- A hard real-time system guarantees that critical tasks be
completed on time. In a hard time real system, the completion of an
operation after its deadline is considered useless.
- This may cause a critical failure of the complete system. In
hard real-time systems, secondary storage is limited or missing and the
data is stored in ROM. In these systems, virtual memory is almost never
found.
- Example: video transmission, each picture frame and audio
must be transferred at fixed rate.
- 2. Soft real time
- A soft real-time system will tolerate such lateness, and may
respond with decreased service quality. A soft real-time system, where a
critical real-time task gets priority over other tasks, and retains that priority
until it completes.
- Soft real-time systems, have more limited utility than hard real-
time systems. Given their lack of deadline support, they are risky to use for
industrial control and robotics.
- They are useful, in several areas, including multimedia, virtual
reality, and advanced scientific projects such as undersea exploration and
9
Operating System 315319

planetary rovers. These systems need advanced operating-system features


that cannot be supported by hard real-time systems.

 Applications:
1. Flight Control System
2. Simulations
3. Industrial control
4. Military applications
2.1.3 Mobile OS (Android OS)
- Android is a mobile operating system developed by Google. It is based on
a modified version of the Linux kernel and other open source software,
and is designed primarily for touchscreen mobile devices such as
smartphones and tablets. In addition, Google has developed Android TV
for televisions, Android Auto for cars, and Wear OS for wrist watches,
each with a specialized user interface. Variants of Android are also used
on game consoles, digital cameras, PCs and other electronics.
- The Android OS was originally created by Android, Inc., which was
bought by Google in 2005. Each time the OHA releases an Android
version, it names the release after a dessert. Android 1.5 is known as
Cupcake, 1.6 as Donut, 2.0/2.1 as Eclair, 2.2 as Froyo and 2.3 is dubbed
Gingerbread. Once a version is released, so is its source code.
- The Android OS is designed for phones. Its many features include:
• Integrated browser, based on the open source WebKit engine
• Optimized 2D and 3D graphics, multimedia and GSM connectivity
• Bluetooth • EDGE • 3G
• WiFi • SQLite • Camera
• GPS • Compass • Accelerometer
- Software developers who want to create applications for the Android OS
can download the Android Software Development Kit (SDK) for a specific
version. The SDK includes a debugger, libraries, an emulator, some
documentation, sample code and tutorials. For faster development,
interested parties can use graphical integrated development environments
(IDEs) such as Eclipse to write applications in Java. In the 4th quarter of
2010, smart phones running Android OS garnered the top spot for most
shipments. The Android OS can be found in phones from different
manufacturers, including the Samsung Nexus S, HTC Evo Shift 4G and
Motorola Atrix 4G. A couple of new mobile OSs are now based on
Android, including Open Mobile System (OMS) and Tapas.

2.2 Command line based Operating System: DOS, UNIX


- CLI is an older method for interacting with applications and operating
systems and is used to perform specific tasks required by users. CLI is a
text-based interface, A command prompt is used in a text-based or
"command-line" interface, such as a Unix terminal or a DOS shell.

10
Operating System 315319

- A user can type commands at the command prompt, such as cd /, which


means "change directory to the root folder." CLI allows a user to perform
tasks by entering commands. Its working mechanism is very easy, but it is
not user friendly. Users enter the specific command, press “Enter”, and
then wait for a response.
- After receiving the command, the CLI processes it accordingly and shows
the output/result on the same screen; command line interpreter is used for
this purpose. MS-DOS is the best example of CLI.

GUI based Operating System: WINDOWS, LINUX, MaC OS


- A graphical user interface (GUI) is an interface through which a user
interacts with electronic devices such as computers, hand-held devices and
other appliances.
- This interface uses icons, menus and other visual indicator (graphics)
representations to display information and related user controls, unlike
text-based interfaces, where data and commands are in text.
- GUI representations are manipulated by a pointing device such as a mouse,
trackball, stylus, or a finger on a touch screen.

 Difference Between CLI and GUI

Parameters CLI GUI


Interaction User interacts with User interacts with
computer using computer using Graphics
commands. like images, icons.
Peripherals used Only keyboard Keyboard, mouse or any
other pointing device.
Speed CLI is of high speed. GUI is of low speed.
Usage Usage is difficult, requires Usage is easy.
expertise.
Navigation Navigation is difficult. Navigation is easy.
Memory Low memory High memory requirement
requirement requirement..
Flexibility Little flexible user Highly flexible user
interface. interface.
Customize GUI is highly CLI appearance is not
customizable. easily changeable
Applications DOS, UNIX LINUX, Windows
2.3 Different Services of Operating System
An operating system provides an environment for the execution of programs. It provides
Certain services to programs and to the users of those programs. The specific services
provided, of course, differ from one Operating system to another. These operating-

11
Operating System 315319

system services are provided for the convenience of the programmer, to make the
programming task easier.
Operating system services provides functions that are helpful for user as well as they
ensure the efficient operation of the system itself.
For User:
1. User interface. Almost all operating systems have a user interface (UI). This interface
can take several forms. One is a command-line interface (CLI), which uses text
commands and a method for entering them. Another is a batch interface, in which
commands and directives to control those commands are entered into files, and those
files are executed. Most commonly, a graphical user interface (GUI) is used. Here, the
interface is a window system with a pointing device to direct I/O, choose from menus,
and make selections and a keyboard to enter text. Some systems provide two or all three
of these variations.
2. Program execution. The system must be able to load a program into memory and to run
that program. The program must be able to end its execution, either normally or
abnormally (indicating error).
3. I/O operations. A running program may require I/O, which may involve a file or an I/O
device. For efficiency and protection, users usually cannot control I/O devices directly.
Therefore, the operating system must provide a means to do I/O.
4. File-system manipulation. Programs need to read and write files and directories. They
also need to create and delete them by name, search for a given file, and list file
information. Some programs include permissions management to allow or deny access
to files or directories based on file ownership. Programs may need to read and write data
from and to the files and directories. Operating system manages the secondary storage.
User gives a command for reading or writing to a file. Operating system makes it easier
for user programs to accomplish their task such as opening a file, saving a file and
deleting a file from the storage disk. It also provides services for file permission
management to allow or deny access to files or directories based on file ownership.
5. Communications Many time, one process needs to exchange information with another
process. Such communication may occur between processes that are executing on the
same computer or different computer systems tied together by a computer network.
Communications may be implemented via shared memory or message passing, in which
packets of information are moved between processes by the operating system.
6. Error detection. The operating system needs to be constantly aware of possible errors.
Errors may occur in the CPU and memory hardware (such as a memory error or a power
failure), in I/O devices and in the user program. For each type of error, the operating
system should take the appropriate action to ensure correct and consistent computing.
Debugging facilities can enhance the user's and programmer's abilities to use the system
efficiently.

For System view:


7. Resource allocation. When there are multiple users or multiple jobs running at the same
time, resources must be allocated to each of them. Many different types of resources are
managed by the operating system. For instance, in determining how best to use the CPU,

12
Operating System 315319

operating systems have CPU-scheduling routines. There may also be routines to allocate
printers, modems, USB storage drives, and other peripheral devices.
8. Accounting. We want to keep track of which users use how much and what kinds of
computer resources. This record keeping may be used for accounting or simply for
accumulating usage statistics.
9. Protection and security.
Protection involves ensuring that all access to system resources is controlled. Security of
the system from outsiders is also important. Such security starts with requiring each user
to authenticate himself or herself to the system, usually by means of a password, to gain
access to system resources.

2.4 System Calls:


System call provides an interface to the services made available by an operating system.
Systems execute thousands of system calls per second. This system calls are procedures
written using C, C++ and assembly language instructions. Each operating system has its
own name for each system call.
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 and
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 (Application Programming Interface) 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.

Types of System Calls


System calls can be grouped into five major categories: process control, file
manipulation, device manipulation, information maintenance, and communications.

1. Process Control
 end, abort
 load, execute
 create process, terminate process
 get process attributes, set process attributes
 wait for time
 wait event, signal event
 allocate and free memory

- A running program needs to be able to halt its execution either normally (end) or
abnormally (abort). If a system call is made to terminate the currently running program
abnormally, a dump of memory is taken and an error message generated. The dump is
written to disk and may be examined by a debugger, to determine the cause of the error.

13
Operating System 315319

Under either normal or abnormal circumstances, the operating system must transfer
control to the command interpreter. The command interpreter then reads the next
command.

- A process or job executing one program may want to load and execute another program.
This feature allows the command interpreter to execute a program as directed by, a user
thus, we have effectively created a mechanism for one program to call another program.
If both programs execute concurrently, we have created a new job or process to be
multiprogrammed. For this purpose, a system call exist like create process or submit job.
- If we create a new job or process, we should be able to control its execution. This control
requires the ability to determine and reset the attributes of a job or process, including the
job's priority, its maximum allowable execution time, and so on. For this purpose, the
system call get process attributes and set process attributes is used. If we want to
terminate a job or process that we created, use terminate process system call.

- After creating new jobs or processes, we may need to wait for them to finish their
execution. We may want to wait for a certain amount of time, use wait time system call;
If we want to wait for a specific event to occur, use wait event system call. The jobs or
processes should then signal when that event has occurred, use signal event system call.

2. File Management
 create file, delete file
 open, close
 read, write, reposition
 get file attributes, set file attributes
- The following system calls are common when dealing with files. We first need system
calls, to create and delete files. System call requires the name of the file and its
attributes. Once the file is created, we need to open it and to use it. We may also read,
write, or reposition i.e. rewrite or skip to the end of the file. Finally, we need to close the
file.

- We may need these same sets of operations for directories. In addition, for r files or
directories, we need to be able to determine the various attributes and to reset them if
necessary. File attributes include the file name, a file type, protection codes, accounting
information, and so on. For this function, the system calls are get file attribute and set
file attribute.

3. Device Management
 request device, release device
 read, write, reposition
 get device attributes, set device attributes
 logically attach or detach devices

14
Operating System 315319

- A process may need several resources to execute—main memory, disk drives, access to
files, and so on. If the resources are available, they can be granted, and control can be
returned to the user process. Otherwise, the process will have to wait until sufficient
resources are available.
- The various resources i.e. devices controlled by the operating system. Some of these
devices are physical devices (for example, tapes), or virtual devices (for example, files).
If there are multiple users of the system, the system may first request the device to use.
After we are finished with the device, we release it. Once the device has been requested,
we can read, write, and reposition the device.

4. Information Maintenance:
 get time or date, set time or date
 get system data, set system
 data set process, file, or device attributes
 set process, file, or device attributes
- Many system calls exist simply for the purpose of transferring information between the
user program and the operating system. For example, most systems have a system call to
return the current time and date. Other system calls may return information about the
system, such as the number of current users, the version number of the operating system,
the amount of free memory or disk space, and so on.
- In addition, the operating system keeps information about all its processes, and system
calls are used to access this information. Generally, calls are also used to reset the
process information (get process attributes and set process attributes).

5. Communication
 create, delete communication connection
 send, receive messages
 transfer status information
 attach or detach remote devices
- There are two common models of interprocess communication: the message-passing
model and the shared-memory model.
- In the message-passing model, the communicating processes exchange messages with
one another to transfer information. Messages can be exchanged between the processes
either directly or indirectly through a common mailbox. Before communication can take
place, a connection must be established. Each computer in a network has a host name by
which it is commonly known. A host also has a network identifier, such as an IP address.
Similarly, each process has a process name, and this name is translated into an identifier
by which the operating system can refer to the process. The get host id and get processID
system calls do this translation. These identifiers are then passed to the specific open
connection and close connection system calls. The recipient process must give its
permission for communication with an accept connection system call. Most processes
that will be receiving connections execute a wait for connection system call. Messages

15
Operating System 315319

are exchanges between sources and receiving machines by using read message and write
message system calls. The close connection call terminates the communication.
- In the shared-memory model, processes use shared memory create and shared memory
attach system calls to create and gain access to regions of memory owned by other
processes. They can then exchange information by reading and writing data in the shared
areas. The form of the data and the location are determined by the processes and are not
under the operating system's control. The processes are also responsible for ensuring that
they are not writing to the same location simultaneously. Message passing is useful when
smaller amounts of data need to be exchanged because conflicts needs be avoided. It is
easy to implement than shared memory for inter computer communication. Shared
memory allows maximum speed and convenience of communication.

2.5 Components of Operating System


1. Process Management,
2. Main Memory Management
3. File Management
4. IO Management
5. Secondary Storage Management
1. Process Management :
Process is current activity shown by a program counter. A process can be a Program
in execution. A process needs certain resources like CPU time, memory, files and I/O
devices to do its task. These resources are given to the process when it is created or
allocated to it when it is running. Process generally included a process stack. The
process is executed sequentially. The CPU executes instruction one at a time.
The operating system is responsible for the following activities in concern with
process management:

 Creating and deleting both user and system process


 Suspending and resuming processes
 Providing mechanism for process synchronization
 Providing mechanisms for process communication
 Providing mechanisms for deadlock handling.

2. Main memory Management:


Main memory is a collection of quickly accessible data shared by the CPU and I/O
devices. The central processor reads instructions and data from main memory during
the fetch cycle. To improve both the utilization of the CPU and the speed of the
computer’s response to its users, we must keep several programs in memory. Many
different memory management schemes are available.
The operating system is responsible for the following activities:
 Keeping track of which parts of memory are currently being used and by whom.
 Deciding which process is to be loaded into memory when memory space
becomes available.

16
Operating System 315319

 Allocating and defalcating memory space as needed.

3. File Management:
It is one of the most visible components of operating system. Computers can store
information on several different types of physical media, such as magnetic tape,
magnetic disk, optical disk etc. Each of these media has its own characteristics and
physical organization. Each media is controlled by a device such as a disk drive and
tape drive. They also have unique characteristics. These properties include access
speed, capacity, data transfer rate, and access method i.e. sequential or random. For
efficient and convenient use of computer system, the operating system provides a
uniform logical view of information storage. The operating system maps files onto
physical media and access these files via the storage devices. A file is a collection of
related information defined by its creator. Generally, file represents programs and data,
Data files may be alphabetic, numeric or alphanumeric. The operating system
implements the abstract concept of file by managing mass storage media. Files are
normally organized into directories for easy use. The operating system is responsible
for the following activities:

 Creating and deleting files


 Creating and deleting directories
 Supporting primitives for manipulating files and directories
 Mapping files onto secondary storage
 Backing up files on movable storage media

4. I/O management:
Operating system hides the peculiarities (odd behaviour) of specific hardware devices
from the user. In UNIX, the peculiarities of I/O devices are hidden from the bulk of the
operating system itself by the I/O subsystem. The I/O subsystem consist of
 A memory management component that includes buffering, caching and
spooling
 A general device driver interface
 Drivers for specific hardware device
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
use 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 o 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

17
Operating System 315319

usually provides the required interrupt handling necessary for the time dependent
hardware interfacing.
Providing interfaces to other system components.
 Managing devices
 Transferring data
 Detecting I/O completion
(spooling refers to a process of transferring data by placing it into a temporary
working area where another program may access it for processing by later time.) Only the
device drivers know the peculiarities of the specific device to which it is assigned.

5. Secondary storage management


The main purpose of computer system is to execute programs. During execution,
these programs with data must be in main memory, but these programs and data must
backup on secondary storage from main memory. Because main memory is too small
to store all data and programs and also data that it holds are lost when power is lost.
Most modern computers use disks, as a on-line storage media. Hence proper
management of disk storage is of central importance to a computer system.
The operating system is responsible for the following activities, in concern with
Secondary storage management:
 Free space management
 Storage allocation
 Storage De – allocation
 Disk Scheduling

18

You might also like