Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 23

OS Definition:

In the Computer System (comprises of Hardware and software), Hardware can


only understand machine code (in the form of 0 and 1) which doesn't make any
sense to a naive user.

We need a system which can act as an intermediary and manage all the
processes and resources present in the system.

An Operating System can be defined as an interface between user and


hardware. It is responsible for the execution of all the processes, Resource
Allocation, CPU management, File Management and many other tasks.

 A more common definition is that the operating system is the one program
running at all times on the computer (usually called the kernel), with all else
being application programs.
 An operating system is concerned with the allocation of resources and services,
such as memory, processors, devices, and information. The operating system
correspondingly includes programs to manage these resources, such as a
traffic controller, a scheduler, memory management module, I/O programs, and
a file system.
Functions of Operating system – Operating system performs three functions:
1. Convenience: An OS makes a computer more convenient to use.
2. Efficiency: An OS allows the computer system resources to be used in an
efficient manner.
3. Ability to Evolve: An OS should be constructed in such a way as to permit the
effective development, testing and introduction of new system functions at the
same time without interfering with service.

WHAT OPERATING SYSTEM DOES?


Following are some of important functions of an operating System.

 Memory Management
 Processor Management
 Device Management
 File Management
 Security
 Control over system performance
 Job accounting
 Error detecting aids
 Coordination between other software and users
Q3. What are the Characteristics of Operating System?
1. Operating System is a Collection of Programs those are Responsible for
the Execution of other Programs.
2. Operating System is that which Responsible is for Controlling all the
Input and Output Devices those are connected to the System.
3. Operating System is that which Responsible is for Running all the
Application Software’s.
4. Operating System is that which Provides Scheduling to the Various
Processes Means Allocates the Memory to various Process those Wants
to Execute.
5. Operating System is that which provides the Communication between
the user and the System.
6. Operating System is Stored into the BIOS Means in the Basic Input and
Output System means when a user Starts his System then this will Read
all the instructions those are Necessary for Executing the System Means
for Running the Operating System, Operating System Must be Loaded
into the Computer For this, this will use the Floppy or Hard Disks Which
Stores the Operating System.
Q4. What does a modern operating system do?
 Provides Abstractions Hardware has low-level physical resources with
complicated, idiosyncratic interfaces. OS provides abstractions that
present clean interfaces. Goal: make computer easier to use.
o Examples: Processes, Unbounded Memory, Files, Synchronization
and Communication Mechanisms.
 Provides Standard Interface Goal: portability. Unix runs on many very
different computer systems. To a first approximation can port programs
across systems with little effort.
 Mediates Resource Usage Goal: allow multiple users to share resources
fairly, efficiently, safely and securely. Examples:
o Multiple processes share one processor. (preemptable resource)
o Multiple programs share one physical memory (preemptable
resource).
o Multiple users and files share one disk. (non-preemptable
resource)
o Multiple programs share a given amount of disk and network
bandwidth (preemptable resource).
 Q1. What is meant by Real Time Operating System?
 A real-time operating system (RTOS) is an operating system (OS)
intended to serve real-time application process data as it comes in,
typically without buffering delays. Processing time requirements
(including any OS delay) are measured in tenths of seconds or shorter.
 Q2. What is meant by Multi Programming?
 Multiprogramming is a rudimentary form of parallel processing in
which several programs are run at the same time on a uniprocessor.

Types of Operating Systems


An Operating System performs all the basic tasks like managing file,process, and
memory. Thus operating system acts as manager of all the resources, i.e. resource
manager. Thus operating system becomes an interface between user and machine.
Types of Operating Systems: Some of the widely used operating systems are as
follows-
1. Batch Operating System –
This type of operating system does not interact with the computer directly. There is
an operator which takes similar jobs having same requirement and group them into
batches. It is the responsibility of operator to sort the jobs with similar needs.

Advantages of Batch Operating System:


 It is very difficult to guess or know the time required by any job to complete.
Processors of the batch systems know how long the job would be when it is in queue
 Multiple users can share the batch systems
 The idle time for batch system is very less
 It is easy to manage large work repeatedly in batch systems
Disadvantages of Batch Operating System:
 The computer operators should be well known with batch systems
 Batch systems are hard to debug
 It is sometime costly
 The other jobs will have to wait for an unknown time if any job fails
Examples of Batch based Operating System: Payroll System, Bank Statements
etc.
2. Time-Sharing Operating Systems –
Each task is given some time to execute, so that all the tasks work smoothly. Each
user gets time of CPU as they use single system. These systems are also known as
Multitasking Systems. The task can be from single user or from different users also.
The time that each task gets to execute is called quantum. After this time interval is
over OS switches over to next task.

Advantages of Time-Sharing OS:


 Each task gets an equal opportunity
 Less chances of duplication of software
 CPU idle time can be reduced
Disadvantages of Time-Sharing OS:
 Reliability problem
 One must have to take care of security a\

 nd integrity of user programs and data
 Data communication problem
Examples of Time-Sharing OSs are: Multics, Unix etc.
3. Distributed Operating System –
These types of operating system is a recent advancement in the world of computer
technology and are being widely accepted all-over the world and, that too, with a
great pace. Various autonomous interconnected computers communicate each other
using a shared communication network. Independent systems possess their own
memory unit and CPU. These are referred as loosely coupled systems or
distributed systems. These system’s processors differ in size and function. The
major benefit of working with these types of operating system is that it is always
possible that one user can access the files or software which are not actually present
on his system but on some other system connected within this network i.e., remote
access is enabled within the devices connected in that network.

Advantages of Distributed Operating System:


 Failure of one will not affect the other network communication, as all systems are
independent from each other
 Electronic mail increases the data exchange speed
 Since resources are being shared, computation is highly fast and durable
 Load on host computer reduces
 These systems are easily scalable as many systems can be easily added to the
network
 Delay in data processing reduces
Disadvantages of Distributed Operating System:
 Failure of the main network will stop the entire communication
 To establish distributed systems the language which are used are not well defined yet
 These types of systems are not readily available as they are very expensive. Not only
that the underlying software is highly complex and not understood well yet
Examples of Distributed Operating System are- LOCUS etc.
4. Network Operating System –
These systems run on a server and provide the capability to manage data, users,
groups, security, applications, and other networking functions. These type of
operating systems allow shared access of files, printers, security, applications, and
other networking functions over a small private network. One more important aspect
of Network Operating Systems is that all the users are well aware of the underlying
configuration, of all other users within the network, their individual connections etc.
and that’s why these computers are popularly known as tightly coupled systems.

Advantages of Network Operating System:


 Highly stable centralized servers
 Security concerns are handled through servers
 New technologies and hardware up-gradation are easily integrated to the system
 Server access are possible remotely from different locations and types of systems
Disadvantages of Network Operating System:
 Servers are costly
 User has to depend on central location for most operations
 Maintenance and updates are required regularly
Examples of Network Operating System are: Microsoft Windows Server 2003,
Microsoft Windows Server 2008, UNIX, Linux, Mac OS X, Novell NetWare, and BSD
etc.
5. Real-Time Operating System –
These types of OSs serves the real-time systems. The time interval required to
process and respond to inputs is very small. This time interval is called response
time.
Real-time systems are used when there are time requirements are very strict like
missile systems, air traffic control systems, robots etc.
Two types of Real-Time Operating System which are as
follows:
 Hard Real-Time Systems:
These OSs are meant for the applications where time constraints
are very strict and even the shortest possible delay is not
acceptable. These systems are built for saving life like automatic
parachutes or air bags which are required to be readily available in
case of any accident. Virtual memory is almost never found in these
systems.
 Soft Real-Time Systems:
These OSs are for applications where for time-constraint is less
strict.
Advantages of RTOS:
 Maximum Consumption: Maximum utilization of devices and system,thus more
output from all the resources
 Task Shifting: Time assigned for shifting tasks in these systems are very less. For
example in older systems it takes about 10 micro seconds in shifting one task to
another and in latest systems it takes 3 micro seconds.
 Focus on Application: Focus on running applications and less importance to
applications which are in queue.
 Real time operating system in embedded system: Since size of programs are small,
RTOS can also be used in embedded systems like in transport and others.
 Error Free: These types of systems are error free.
 Memory Allocation: Memory allocation is best managed in these type of systems.
Disadvantages of RTOS:
 Limited Tasks: Very few tasks run at the same time and their concentration is very
less on few applications to avoid errors.
 Use heavy system resources: Sometimes the system resources are not so good and
they are expensive as well.
 Complex Algorithms: The algorithms are very complex and difficult for the designer to
write on.
 Device driver and interrupt signals: It needs specific device drivers and interrupt
signals to response earliest to interrupts.
 Thread Priority: It is not good to set thread priority as these systems are very less
prone to switching tasks.
Examples of Real-Time Operating Systems are: Scientific experiments, medical
imaging systems, industrial control systems, weapon systems, robots, air traffic
control systems, etc.

Multiprocessor Systems
Most computer systems are single processor systems i.e they only have one
processor. However, multiprocessor or parallel systems are increasing in importance
nowadays. These systems have multiple processors working in parallel that share
the computer clock, memory, bus, peripheral devices etc. An image demonstrating
the multiprocessor architecture is:
Types of Multiprocessors
There are mainly two types of multiprocessors i.e. symmetric and asymmetric
multiprocessors. Details about them are as follows:
Symmetric Multiprocessors
In these types of systems, each processor contains a similar copy of the operating
system and they all communicate with each other. All the processors are in a peer to
peer relationship i.e. no master - slave relationship exists between them.
An example of the symmetric multiprocessing system is the Encore version of Unix
for the Multimax Computer.
Asymmetric Multiprocessors
In asymmetric systems, each processor is given a predefined task. There is a master
processor that gives instruction to all the other processors. Asymmetric
multiprocessor system contains a master slave relationship.
Asymmetric multiprocessor was the only type of multiprocessor available before
symmetric multiprocessors were created. Now also, this is the cheaper option.
Advantages of Multiprocessor Systems
There are multiple advantages to multiprocessor systems. Some of these are:
More reliable Systems

In a multiprocessor system, even if one processor fails, the system will not halt. This
ability to continue working despite hardware failure is known as graceful degradation.
For example: If there are 5 processors in a multiprocessor system and one of them
fails, then also 4 processors are still working. So the system only becomes slower
and does not ground to a halt.
Enhanced Throughput

If multiple processors are working in tandem, then the throughput of the system
increases i.e. number of processes getting executed per unit of time increase. If
there are N processors then the throughput increases by an amount just under N.
More Economic Systems

Multiprocessor systems are cheaper than single processor systems in the long run
because they share the data storage, peripheral devices, power supplies etc. If there
are multiple processes that share data, it is better to schedule them on
multiprocessor systems with shared data than have different computer systems with
multiple copies of the data.
Disadvantages of Multiprocessor Systems
There are some disadvantages as well to multiprocessor systems. Some of these
are:
Increased Expense
Even though multiprocessor systems are cheaper in the long run than using multiple
computer systems, still they are quite expensive. It is much cheaper to buy a simple
single processor system than a multiprocessor system.
Complicated Operating System Required

There are multiple processors in a multiprocessor system that share peripherals,


memory etc. So, it is much more complicated to schedule processes and impart
resources to processes.than in single processor systems. Hence, a more complex
and complicated operating system is required in multiprocessor systems.
Large Main Memory Required

All the processors in the multiprocessor system share the memory. So a much larger
pool of memory is required as compared to single processor systems.

Concepts/components of os:
 Memory Management
 Processor Management
 Device Management
 File Management
 Security
 Control over system performance
 Job accounting
 Error detecting aids
 Coordination between other software and users
Memory Management
Memory management refers to management of Primary Memory or Main
Memory. Main memory is a large array of words or bytes where each word or
byte has its own address.
Main memory provides a fast storage that can be access directly by the CPU.
So for a program to be executed, it must in the main memory. Operating
System does the following activities for memory management.
 Keeps tracks of primary memory i.e. what part of it are in use by whom,
what part are not in use.
 In multiprogramming, OS decides which process will get memory when
and how much.
 Allocates the memory when the process requests it to do so.
 De-allocates the memory when the process no longer needs it or has
been terminated.
Processor Management
In multiprogramming environment, OS decides which process gets the
processor when and how much time. This function is called process scheduling.
Operating System does the following activities for processor management.
 Keeps tracks of processor and status of process. Program responsible for
this task is known as traffic controller.
 Allocates the processor(CPU) to a process.
 De-allocates processor when processor is no longer required.
Device Management
OS manages device communication via their respective drivers. Operating
System does the following activities for device management.
 Keeps tracks of all devices. Program responsible for this task is known as
the I/O controller.
 Decides which process gets the device when and for how much time.
 Allocates the device in the efficient way.
 De-allocates devices.
File Management
A file system is normally organized into directories for easy navigation and
usage. These directories may contain files and other directions. Operating
System does the following activities for file management.
 Keeps track of information, location, uses, status etc. The collective
facilities are often known as file system.
 Decides who gets the resources.
 Allocates the resources.
 De-allocates the resources.
Other Important Activities
Following are some of the important activities that Operating System does.
 Security -- By means of password and similar other techniques,
preventing unauthorized access to programs and data.
 Control over system performance -- Recording delays between request
for a service and response from the system.
 Job accounting -- Keeping track of time and resources used by various
jobs and users.
 Error detecting aids -- Production of dumps, traces, error messages and
other debugging and error detecting aids.
 Coordination between other softwares and users -- Coordination and
assignment of compilers, interpreters, assemblers and other software to
the various users of the computer systems.

Services provided by os:


An Operating System provides services to both the users and to the programs.
 It provides programs an environment to execute.
 It provides users the services to execute the programs in a convenient manner.
Following are a few common services provided by an operating system −

 Program execution
 I/O operations
 File System manipulation
 Communication
 Error Detection
 Resource Allocation
 Protection

Program execution
Operating systems handle many kinds of activities from user programs to system
programs like printer spooler, name servers, file server, etc. Each of these activities
is encapsulated as a process.
A process includes the complete execution context (code to execute, data to
manipulate, registers, OS resources in use). Following are the major activities of an
operating system with respect to program management −

 Loads a program into memory.


 Executes the program.
 Handles program's execution.
 Provides a mechanism for process synchronization.
 Provides a mechanism for process communication.
 Provides a mechanism for deadlock handling.

I/O Operation
An I/O subsystem comprises of I/O devices and their corresponding driver software.
Drivers hide the peculiarities of specific hardware devices from the users.
An Operating System manages the communication between user and device
drivers.

 I/O operation means read or write operation with any file or any specific I/O device.
 Operating system provides the access to the required I/O device when required.

File system manipulation


A file represents a collection of related information. Computers can store files on the
disk (secondary storage), for long-term storage purpose. Examples of storage
media include magnetic tape, magnetic disk and optical disk drives like CD, DVD.
Each of these media has its own properties like speed, capacity, data transfer rate
and data access methods.
A file system is normally organized into directories for easy navigation and usage.
These directories may contain files and other directions. Following are the major
activities of an operating system with respect to file management −
 Program needs to read a file or write a file.
 The operating system gives the permission to the program for operation on file.
 Permission varies from read-only, read-write, denied and so on.
 Operating System provides an interface to the user to create/delete files.
 Operating System provides an interface to the user to create/delete directories.
 Operating System provides an interface to create the backup of file system.

Communication
In case of distributed systems which are a collection of processors that do not share
memory, peripheral devices, or a clock, the operating system manages
communications between all the processes. Multiple processes communicate with
one another through communication lines in the network.
The OS handles routing and connection strategies, and the problems of contention
and security. Following are the major activities of an operating system with respect
to communication −

 Two processes often require data to be transferred between them


 Both the processes can be on one computer or on different computers, but are
connected through a computer network.
 Communication may be implemented by two methods, either by Shared Memory or
by Message Passing.

Error handling
Errors can occur anytime and anywhere. An error may occur in CPU, in I/O devices
or in the memory hardware. Following are the major activities of an operating
system with respect to error handling −

 The OS constantly checks for possible errors.


 The OS takes an appropriate action to ensure correct and consistent computing.

Resource Management
In case of multi-user or multi-tasking environment, resources such as main memory,
CPU cycles and files storage are to be allocated to each user or job. Following are
the major activities of an operating system with respect to resource management −

 The OS manages all kinds of resources using schedulers.


 CPU scheduling algorithms are used for better utilization of CPU.

Protection
Considering a computer system having multiple users and concurrent execution of
multiple processes, the various processes must be protected from each other's
activities.
Protection refers to a mechanism or a way to control the access of programs,
processes, or users to the resources defined by a computer system. Following are
the major activities of an operating system with respect to protection −

 The OS ensures that all access to system resources is controlled.


 The OS ensures that external I/O devices are protected from invalid access attempts.
 The OS provides authentication features for each user by means of passwords.

What is meant by client-server systems?


The client–server model is a distributed application structure that
partitions tasks or workloads between the providers of a resource or service,
called servers, and service requesters, called clients.Often clients and servers
communicate over a computer network on separate hardware, but both client
and server may reside in the same system.
Q2. Explain the protection and security of operating system
Modern computer system supports many users & allows the concurrent
execution of multiple processes organization rely on computers to store
information.
• It is necessary that the information & devices must be protected from
unauthorized users or processors.
• The protection is a mechanism for controlling the access of program,
processes or users to the resources defined by a computer system.
• Protection mechanism are implemented in OS to support various security
policies.
• The goal of security system is to authenticate their access to any object.
• Protection can improve reliability by detecting latent errors at the interface
between component sub system.
• Protection domains are extensions of H/w supervisor mode ability.
Protection and security require the system to be able to distinguish
amongall its users. Most maintain a list of user names and associated user
Ids. These numerical IDs are unique, one per user.When a user logs in
system, the authentication stage determines the appropriate userID for the
user. That user ID is associated with all of the user's processes and threads.
When an ID needs to be user readable, it is translated back to the user name via the
user name list.

What is Special Purpose System?


Special-Purpose Systems - Distributed Systems
The discussion thus far has focused on general-purpose computer systems that we
are all familiar with. There are, however, different classes of computer systems
whose functions are more limited and whose objective is to deal with limited
computation domains.
1 Real-Time Embedded Systems:
 Embedded computers are the most prevalent form of computers in
existence..

 These devices are found everywhere, from car engines and manufacturing
robots to VCRs and microwave ovens.

 They tend to have very specific tasks. The systems they run on are usually
primitive, and so the operating systems provide limited features.

 Usually, they have little or no user interface, preferring to spend their time
monitoring and managing hardware devices, such as automobile engines
and robotic arms. These embedded systems vary considerably.

 Some are general-purpose computers, running standard operating


systems—such as UNIX—with special-purpose applications to implement the
functionality.

 Others are hardware devices with a special-purpose embedded operating


system providing just the functionality desired. Yet others are hardware
devices with application-specific integrated circuits (ASICs) that perform their
tasks without an operatingsystem.

 power of these devices, both as standalone units and as members of


networks and the Web, is sure to increase as well. Even now, entire houses
can be computerized, so that a central computer—either a general-purpose
computer or an embedded system—can control heating and lighting, alarm
systems, and even coffee makers.

 Embedded systems almost always run real-time operating systems. A real-


time system is used when rigid time requirements have been placed on the
operation of a processor or the flow of data; thus, it is often used as a control
device in a dedicated application.

 Sensors bring data to the computer. The computer must analyze the data
and possibly adjust controls to modify
the sensor inputs. Systems that control scientific experiments, medical
imaging systems, industrial control systems, and certain display systems are
real-time systems.

2 Multimedia Systems
Most operating systems are designed to handle conventional data such as text files,
programs, word-processing documents, and spreadsheets. However, a recent trend
in technology is the incorporation of multimedia data into computer systems.
Multimedia data consist of audio and video files as well as conventional files. These
data differ from conventional data in that multimedia data—such as frames of
video—must be delivered (streamed) according to certain time restrictions (for
example, 30 frames per second). Multimedia describes a wide range of applications
that are in popular use today. These include audio files such as MP3 DVD movies,
video conferencing, and short video clips of movie previews or news stories
downloaded over the Internet. Multimedia applications may also include live
webcasts (broadcasting over the World Wide Web) of speeches or sporting events
and even live webcams that allow a viewer in Manhattan to observe customers at a
cafe in Paris. Multimedia applications need not be either audio or video; rather, a
multimedia application often includes a combination of both. For example, a movie
may consist of separate audio and video tracks. Nor must multimedia applications
be delivered only to desktop personal computers. Increasingly, they are being
directed toward smaller devices, including PDAs and cellular telephones. For
example, a stock trader may have stock quotes delivered wirelessly and in real time
to his PDA.
3 Handheld Systems
Handheld systems include personal digital assistants (PDAs), such as Palm and
Pocket-PCs, and cellular telephones, many of which use special-purpose embedded
operating systems. Developers of handheld systems and applications face many
challenges, most of which are due to the limited size of such devices. For example,
a PDA is typically about 5 inches in height and 3 inches in width, and it weighs less
than one-half pound. Because of their size, most handheld devices have a small
amount of memory, slow processors, and small display screens. We will take a look
now at each of these limitations. The amount of physical memory in a handheld
depends upon the device, but typically is is somewhere between 512 KB and 128
MB. (Contrast this with a typical PC or workstation, which may have several
gigabytes of memory!) As a result, the operating system and applications must
manage memory efficiently. This includes returning all allocated memory back to the
memory manager when the memory is not being used. virtual memory allows
developers to write programs that behave as if the system has more memory than is
physically available. Currently, not many handheld devices use virtual memory
techniques, so program developers must work within the confines of limited physical
memory. A second issue of concern to developers of handheld devices is the speed
of the processor used in the devices. Processors for most handheld devices run at a
fraction of the speed of a processor in a PC. Faster processors require more power.
To include a faster processor in a handheld device would require a larger battery,
which would take up more space and would have to be replaced (or recharged)
more frequently. Most handheld devices use smaller, slower processors that
consume less power. Therefore, the operating system and applications must be
designed not to tax the processor.The last issue confronting program designers for
handheld devices is I/O. A lack of physical space limits input methods to small
keyboards, handwriting recognition, or small screen-based keyboards. The small
display screens limit output options. Whereas a monitor for a home computer may
measure up to 30 inches, the display for a handheld device is often no more than 3
inches square. Familiar tasks, such as reading e-mail and browsing web pages,
must be condensed into smaller displays. One approach for displaying the content in
web pages is web clipping, where only a small subset of a web page is delivered
and displayed on the handheld device. Some handheld devices use wireless
technology, such as BlueTooth or 802.11, allowing remote access to e-mail and web
browsing. Cellular telephones with connectivity to the Internet fall into this category.
However, for PDAs that do not provide wireless access, downloading data typically
requires the user to first download the data to a PC or workstation and then
download the data to the PDA. Some PDAs allow data to be directly copied from
one device to another using an infrared link. Generally, the limitations in the
functionality of PDAs are balanced by their convenience and portability. Their use
continues to expand as network
connections become more available and other options, such as digital cameras and
MP3 players, expand their utility.

What is meant by kernel level thread?


 To make concurrency cheaper, the execution aspect of process
is separated out into threads. As such, the OS now manages
threads and processes.
 All thread operations are implemented in the kernel and the OS
schedules all threads in the system.
 OS managed threads are called kernel-level threads or light
weight processes.

Operating System Structure

Here you will learn about the structure of operating systems. In other word, you will
see what operating systems looks like from the outside or the programmer's
interface.

Here we will take a look at five different structures of operating systems.


Here are the list of all those five designs or structures of the operating systems, we
will examine.

1. Monolithic Systems
2. Layered Systems
3. Virtual Machines
4. Exokernels
5. Client-Server Systems

Now let's describe briefly about all the above different-different structures of
operating systems.

Monolithic Systems

The operating system (OS) is written as a collection of procedures, each of which


can call any of the other ones, whenever it needs to.

When this technique is used, then each procedure in the system has a well-defined
interface in terms of parameter, and results, and each one is free to call any of the
other ones, if the latter provides some useful computation that the former needs.

Monolithic systems provides a basic structure for the operating system.

 a main program that invokes the requested service procedure


 a set of service procedures that carry out the system calls
 a set of utility procedures that help the service procedure

In Monolithic system model, there is one service procedure for each system call, that
takes care of it. The utility procedures do jobs that are needed by several service
procedures, such as fetching the data from the user programs.

This division of the procedures into the following three layers:

1. Main Procedure
2. Service Procedures
3. Utility Procedures

The figure given below shows all the layered provided above in monolithic system
model of operating system.
Layered Systems

This system has 6 layers as shown in the table given below.

Layer Function

5 The operator

4 User programs

3 I/O management

2 Operator-process communication

1 Memory and drum management

0 Processor allocation and multiprogramming

Here, are the description provided layer by layer.

 Layer 0 - This layer dealt with allocation of the processor, switching between
processes when interrupts occurred or timers expired
 Layer 1 - This layer did the memory management
 Layer 2 - This layer handled the communication between each process and the
operator console
 Layer 3 - This layer took care of managing the Input/Output devices and buffering
the information streams to and from them
 Layer 4 - On this layer, user programs were found
 Layer 5 - On this layer, the system operator process was located

Virtual Machines

The system originally called CP/CMS, later renamed VM/370, was based on an
astute observation. That was a time sharing system, provides multiprogramming and
an extended machine with a more convenient interface than the bare hardware.

The heart of the system known as virtual machine monitor that runs on the bare
hardware and does the multiprogramming, providing several virtual machines to next
layer up as shown in the given figure.

These virtual machines aren't extended machines, with files and other nice features.
They are the exact copies of the bare hardware, including the kernel/user mode,
Input/Output, interrupts, and everything else the real machine has.

Exokernels

Exokernels is a program present at the bottom layer, running in the kernel mode.

The work of exokernel is just to allocate the resources to the virtual machines and
check attempts to use them to make sure no machine is trying to use some other's
resources.

Exokernels saves a layer of mapping which is the advantage of the exokernel


scheme.

Client-Server Model

In the client-server model, as shown in the figure given below, all the kernel does is
handle the communication between the clients and the servers.
By splitting the operating system (OS) up into parts, each of which only handles one
fact of the system, such as file service, terminal service, process service, or memory
service, each part becomes small and manageable.

The adaptability of the client-server model, to use in distributed system is the


advantage of this model.

System Call
When a program in user mode requires access to RAM or a hardware resource, it
must ask the kernel to provide access to that resource. This is done via something
called a system call.
When a program makes a system call, the mode is switched from user mode to
kernel mode. This is called a context switch.
Then the kernel provides the resource which the program requested. After that,
another context switch happens which results in change of mode from kernel mode
back to user mode.
A figure representing the execution of the system call is given as follows:
As can be seen from this diagram, the processes execute normally in the user mode
until a system call interrupts this. Then the system call is executed on a priority basis
in the kernel mode. After the execution of the system call, the control returns to the
user mode and execution of user processes can be resumed.

Generally, system calls are made by the user level programs in the following
situations:

 Creating, opening, closing and deleting files in the file system.

 Creating and managing new processes.

 Creating a connection in the network, sending and receiving packets.

 Requesting access to a hardware device, like a mouse or a printer.

Types of System Calls


There are mainly five types of system calls. These are explained in detail as follows:

Here are the types of system calls:


Process Control
These system calls deal with processes such as process creation, process
termination etc.
File Management
These system calls are responsible for file manipulation such as creating a file,
reading a file, writing into a file etc.
Device Management
These system calls are responsible for device manipulation such as reading from
device buffers, writing into device buffers etc.
Information Maintenance
These system calls handle information and its transfer between the operating system
and the user program.
Communication
These system calls are useful for interprocess communication. They also deal with
creating and deleting a communication connection.
Some of the examples of all the above types of system calls in Windows and Unix
are given as follows:
Types of System Calls Windows Linux

CreateProcess() fork()
Process Control ExitProcess() exit()
WaitForSingleObject() wait()

CreateFile() open()
ReadFile() read()
File Management
WriteFile() write()
CloseHandle() close()

SetConsoleMode() ioctl()
Device Management ReadConsole() read()
WriteConsole() write()

GetCurrentProcessID() getpid()
Information Maintenance SetTimer() alarm()
Sleep() sleep()

CreatePipe() pipe()
Communication CreateFileMapping() shmget()
MapViewOfFile() mmap()

There are many different system calls as shown above. Details of some of those
system calls are as follows:

wait()
In some systems, a process may wait for another process to complete its execution.
This happens when a parent process creates a child process and the execution of
the parent process is suspended until the child process executes. The suspending of
the parent process occurs with a wait() system call. When the child process
completes execution, the control is returned back to the parent process.

exec()
This system call runs an executable file in the context of an already running process.
It replaces the previous executable file. This is known as an overlay. The original
process identifier remains since a new process is not created but data, heap, stack
etc. of the process are replaced by the new process.

fork()
Processes use the fork() system call to create processes that are a copy of
themselves. This is one of the major methods of process creation in operating
systems. When a parent process creates a child process and the execution of the
parent process is suspended until the child process executes. When the child
process completes execution, the control is returned back to the parent process.

exit()
The exit() system call is used by a program to terminate its execution. In a
multithreaded environment, this means that the thread execution is complete. The
operating system reclaims resources that were used by the process after the exit()
system call.

kill()
The kill() system call is used by the operating system to send a termination signal to
a process that urges the process to exit.However, kill system call does not necessary
mean killing the process and can have various meanings.

You might also like