0% found this document useful (0 votes)
7 views60 pages

Module 1 Rtos

The document provides an overview of operating systems, detailing their components, types, and functions. It explains various operating systems including batch, time-sharing, distributed, network, and real-time systems, along with their advantages and disadvantages. Additionally, it covers the role of the kernel in managing system operations and communication between applications and hardware.

Uploaded by

Aman Ang Aman
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)
7 views60 pages

Module 1 Rtos

The document provides an overview of operating systems, detailing their components, types, and functions. It explains various operating systems including batch, time-sharing, distributed, network, and real-time systems, along with their advantages and disadvantages. Additionally, it covers the role of the kernel in managing system operations and communication between applications and hardware.

Uploaded by

Aman Ang Aman
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

ECT426:REAL TIME

OPERATING
SYSTEMS
MODULE 1
1
SEMESTER:8 (2019
SCHEME) ACADEMIC
YEAR:2022-2023
BATCH:2019-2023
2 CONTEN
T
3 OPERATING
SYSTEMS
An operating system is a program that manages a computer’s
hardware.
It provides a basis for application programs
acts as an intermediary between the computer user and the
computer
hardware.
Mainframe operating systems are designed primarily to optimize
utilization of hardware.
Personal computer (PC) operating systems support complex games,
business applications, and everything in between.
Operating systems for mobile computers provide an environment in
which a user can easily interface with the computer to execute
programs
4 COMPONENTS OF A COMPUTER
SYSTEM
5 COMPONENTS OF A COMPUTER
SYSTEM
A computer system can be divided roughly into four components:
▪ the hardware, the operating system, the application programs, and
the
users
The hardware—the central processing unit (CPU), the memory, and the
input/output (I/O) devices—provides the basic computing resources for
the system.
The application programs—such as word processors, spreadsheets,
compilers, and Web browsers—define the ways in which these
resources are used to solve users’ computing problems.
The operating system controlsthe hardware and coordinates its use
among the various application programs for the various users
6 TYPES OF OPERATING
SYSTEMS
Widely used operating systems are as
follows:
1. Batch Operating System
2. Time-Sharing Operating
Systems
3. Distributed Operating System
4. Network Operating System
5. Real-Time Operating System
7 BATCH OPERATING
SYSTEM
8 BATCH OPERATING
SYSTEM
This type of operating system does not interact with the computer
directly.
There is an operator which takes similar jobs having the same
requirement and group them into batches

It is the responsibility of the operator to sort jobs with similar needs.

Examples of Batch based Operating System: Payroll System, Bank


Statements, etc.
9 BATCH OPERATING
SYSTEM
Advantages of Batch Operating System:
• It is very difficult to guess or know the time required for 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 the batch system is very less
• It is easy to manage large work repeatedly in batch systems
1 BATCH OPERATING
0
SYSTEM
Disadvantages of Batch Operating System:
• The computer operators should be well known with batch
systems
• Batch systems are hard to debug
• It is sometimes costly
• The other jobs will have to wait for an unknown time if any job
fails
1 TIME-SHARING OPERATING
1
SYSTEMS
1 TIME-SHARING OPERATING
2
SYSTEMS
Each task is given some time to execute so that all the tasks work
smoothly.

Each user gets the time of CPU as they use a single system.

These systems are also known as Multitasking Systems.

The task can be from a single user or different users also.

The time that each task gets to execute is called quantum.

After this time interval is over OS switches over to the next task.

Examples of Time-Sharing OSs are: Multics, Unix, etc.


1 TIME-SHARING OPERATING
3
SYSTEMS
Advantages of Time-Sharing OS:
• Each task gets an equal opportunity
• Fewer 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 the security and integrity of user
programs and data
• Data communication problem
1 DISTRIBUTED OPERATING
4
SYSTEM
1 DISTRIBUTED OPERATING
5
SYSTEM
These types of the operating system is a recent advancement in the
world of computer technology and are being widely accepted all over
the world

Various autonomous interconnected computers communicate with


each other using a shared communication network

. Independent systems possess their own memory unit and CPU.


These are referred to as loosely coupled systems or distributed
systems.
1 DISTRIBUTED OPERATING
6
SYSTEM
These system’s processors differ in size and function.
The major benefit of working with these types of the 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 some other system
connected within this network
i.e., remote access is enabled within the devices connected in that
network.
Examples of Distributed Operating System are- LOCUS, etc.
1 DISTRIBUTED OPERATING
7
SYSTEM
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


1 DISTRIBUTED OPERATING
8
SYSTEM
Disadvantages of Distributed Operating System:

• Failure of the main network will stop the entire communication


• To establish distributed systems the language which is 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
1 NETWORK OPERATING
9
SYSTEM
2 NETWORK OPERATING
0
SYSTEM
These systems run on a server and provide the capability to manage
data, users, groups, security, applications, and other networking
functions.
These types of operating systems allow shared access of files, printers,
security, applications, and other networking functions over a small
private network.
One 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.
Examples of Network Operating System are: Microsoft Windows Server
2003, Microsoft Windows Server 2008, UNIX, Linux, Mac OS X, Novell
NetWare, and BSD, etc.
2 NETWORK OPERATING
1
SYSTEM
Advantages of Network Operating System:
• Highly stable centralized servers
• Security concerns are handled through servers
• New technologies and hardware up-gradation are easily integrated into
the system
• Server access is possible remotely from different locations and types of
systems
Disadvantages of Network Operating System:
• Servers are costly
• User has to depend on a central location for most operations
• Maintenance and updates are required regularly
2 REAL-TIME OPERATING
2
SYSTEM
2 REAL-TIME OPERATING
3
SYSTEM
These types of OSs serve 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 that are
very strict like missile systems, air traffic control systems, robots, etc.
Examples of Real-Time Operating Systems are: Scientific experiments,
medical imaging systems, industrial control systems, weapon systems,
robots, air traffic control systems, etc.
Two types of Real-Time Operating Systems are:
▪ Hard Real-Time Systems
▪ Soft Real-Time Systems
2 REAL-TIME OPERATING
4
SYSTEM
Hard RTOS Soft RTOS
These OSs are meant for applications These OSs are for applications where
where time constraints are very strict for
and even the shortest possible delay is time-constraint is less strict.
not acceptable.
These systems are built for saving life
like automatic parachutes or airbags
which are required to be readily
available in case of any accident.
Virtual memory is rarely found in these
systems.
2 REAL-TIME OPERATING
5
SYSTEM
Advantages of RTOS:
• Maximum Consumption: Maximum utilization of devices and system,
thus more output from all the resources
• Task Shifting: The time assigned for shifting tasks in these systems are
very less. For example, in older systems, it takes about 10
microseconds in shifting one task to another, and in the latest systems,
it takes 3 microseconds.
• Focus on Application: Focus on running applications and less importance
to applications which are in the queue.
• Real-time operating system in the embedded system: Since the 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 types
of systems.
2 REAL-TIME OPERATING
6
SYSTEM
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
interrupts signals to respond earliest to interrupts.
• Thread Priority: It is not good to set thread priority as these systems
are very less prone to switching tasks.
2 OBJECTIVES OF OPERATING
7
SYSTEM
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 without interfering with service.
2 FUNCTIONS OF AN OPERATING
8
SYSTEM
1. Memory Management
2. Processor Management
3. Device Management
4. File Management
5. Security
6. Control over system performance
7. Job accounting
8. Error detection & Response
9. Booting the computer
10. Coordination between other software and
users
2 FUNCTIONS OF AN OPERATING
9
SYSTEM
Memory Management:
Memory management refers to management of Primary Memory or
Main
Memory.
An Operating System does the following activities for memory
management:
▪ OS Keeps tracks of primary memory, i.e., what part of it are in use by
whom,
what part are not in use.
▪ In multi-programming, the OS decides which process will get memory
when and how much.
▪ OS allocates the memory when a process requests it to do so.
▪ It de-allocates the memory when a process no longer needs it or has
been
3 FUNCTIONS OF AN OPERATING
0
SYSTEM
Processor Management:
In multi-programming environment, the OS decides which process
gets the
processor when and for how much time.
This function is called process scheduling.
An Operating System does the following activities for
processor management:
▪ OS keeps tracks of processor and status of process.
▪ OS allocates the processor (CPU) to a process.
▪ It de-allocates processor when a process is no longer required.
3 FUNCTIONS OF AN OPERATING
1
SYSTEM
Device Management:
An Operating System manages device communication via their
respective
drivers.
It does the following activities for device management:
▪ Keeps tracks of all devices.
▪ The program responsible for this task is known as the I/O controller.
▪ Decides which process gets the device when and for how much time.
▪ OS allocates the device in the most efficient way.
▪ It de-allocates devices in most efficient way.
3 FUNCTIONS OF AN OPERATING
2
SYSTEM
File Management:
A file system is normally organized into directories for easy navigation
and
usage.
These directories may contain files and other directions.
An 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.
▪ OS Decides who gets the resources.
▪ It allocates the resources and also de-allocates the resources when not
in
need.
3 FUNCTIONS OF AN OPERATING
3
SYSTEM
Security: OS prevents unauthorized access to programs and data. For
shared or public systems, the OS controls access to the system as a
whole and to specific system resources.

Control over system performance: OS will collect usage statistics for


various resources and monitor performance parameters such as response
time, Recording delays between request for a service and response from
the system.

Job accounting: OS Keeps track of time and resources used by various


jobs and [Link] any system, this information is useful in anticipating
the need for future enhancements and in tuning the system to improve
performance and can be used for job accounting purposes.
3 FUNCTIONS OF AN OPERATING
4
SYSTEM
Error detection & Response:
A variety of errors can occur while a computer system is running.
These include internal and external hardware errors, such as a memory
error, or a device failure or malfunction; and various software errors.
In each case, the OS must provide a response that clears the error
condition with the least impact on running applications.
The response may range from ending the program that caused the error,
to retrying the operation, to simply reporting the error to the
application, Production of dumps, traces, error messages, and other
debugging and error detecting aids.
3 FUNCTIONS OF AN OPERATING
5
SYSTEM
Booting the computer:

Booting is the process of starting or restarting the computer.

If computer is switched off completely and then turned on then it is


cold
booting.

If computer is restarted then it is warm booting.

Booting of the computer is done by OS.


Coordination between other software and users: An OS enables
coordination of hardware components, coordination and assignment of
compilers, interpreters, assemblers and other software to the various
users of the computer systems
3 KERNE
6
L
Kernel is central component of an operating system that manages operations
of computer and hardware. It basically manages operations of memory and
CPU time.

It is core component of an operating system.


Kernel acts as a bridge between applications and data processing performed
at hardware level using inter-process communication and system calls.

Kernel loads first into memory when an operating system is loaded and
remains into memory until operating system is shut down again.
3 KERNE
7
L
It is responsible for various tasks such as disk management, task management, and
memory management.
Kernel has a process table that keeps track of all active
processes
•Process table contains a per process region table whose entry points to entries in region
table.
Kernel loads an executable file into memory during ‘exec’ system call’.
It decides which process should be allocated to processor to execute and which process
should be kept in main memory to execute.
It basically acts as an interface between user applications and hardware.
The major aim of kernel is to manage communication between software i.e. user-level
applications and hardware i.e., CPU and disk memory.
3 KERNE
8
L
Objectives of Kernel

• To establish communication between user level application and


hardware.

• To decide state of incoming processes.

• To control disk management.

• To control memory management.

• To control task management.


3 TYPES OF
9
KERNEL

Monolithic
Kernel

Micro Kernel

Hybrid Kernel

Exo Kernel

Hybrid Kernel
4 TYPES OF
0
KERNEL
Monolithic Kernel
▪ It is one of types of kernel where all operating system services
operate in kernel space.
▪ It has dependencies between systems components. It has huge
lines of code which is complex.
Example:
Unix, Linux, Open VMS, XTS-400 etc.
Advantage:
It has good performance.
Disadvantage:
It has dependencies between system component and lines of code in
millions.
4 TYPES OF
1
Micro Kernel
KERNEL
▪ It is kernel types which has minimalist approach. It has virtual
memory and
thread scheduling.
▪ It is more stable with less services in kernel space. It puts rest in user
space.
Example :
Mach, L4, AmigaOS, Minix, K42 etc.
Advantages:
It is more stable.
Disadvantage :
There are lots of system calls and context switches.
4 TYPES OF
2
Hybrid Kernel KERNEL
▪ It is the combination of both monolithic kernel and microkernel.
▪ It has speed and design of monolithic kernel and modularity and
stability of microkernel.
Example :
Windows NT, Netware, BeOS etc.
Advantage :
It combines both monolithic kernel and microkernel.
Disadvantage :
It is still similar to monolithic kernel.
4 TYPES OF
3
Exo Kernel
KERNEL
It is the type of kernel which follows end-to-end principle. It has
fewest hardware abstractions as possible. It allocates physical
resources to applications.
Example :
Nemesis, ExOS etc.
Advantage :
It has fewest hardware abstractions.
Disadvantage :
There is more work for application developers.
4 TYPES OF
4
KERNEL
Nano Kernel
It is the type of kernel that offers hardware abstraction but without
system services.
Micro Kernel also does not have system services therefore the Micro
Kernel
and Nano Kernel have become analogous.
Example :
EROS etc.
Advantage :
It offers hardware abstractions without system services.
Disadvantage :
It is quite same as Micro kernel hence it is less used.
4 PROCES
5
S
A process is basically a program in execution. The execution of a process must progress
in a sequential fashion.
A process is defined as an entity which represents the basic unit of work to be
implemented in the system.
To put it in simple terms, we write our computer programs in a text file and when we
execute this program, it becomes a process which performs all the tasks mentioned in the
program.
When a program is loaded into the memory and it becomes a process, it can be divided into
four sections ─ stack, heap, text and data.
4 PROCES
6
S
The following image shows a simplified layout of a process inside main memory:
4 PROCES
7
S
4 PROCESS-STAT
8
ES
4 PROCESS-STAT
9
ES
∙ The process, from its creation to completion, passes through various states. The minimum
number of states is five.

∙ The names of the states are not standardized although the process may be in one of the
following states during execution:

1. New 5. Completion or termination


2. Ready 6. Suspend ready
3. Running 7. Suspend wait
4. Block or wait
5 PROCESS-STAT
0 [Link]
ES
∙ A program which is going to be picked up by the OS into the main
memory
is called a new process.

2. Ready

∙ Whenever a process is created, it directly enters in the ready state, in


which,
it waits for the CPU to be assigned.
∙ The OS picks the new processes from the secondary memory and put
all of them in the main memory.

∙ The processes which are ready for the execution and reside in the main
memory are called ready state processes.

∙ There can be many processes present in the ready state.


5 PROCESS-STAT
1
ES
3. Running

∙ One of the processes from the ready be chosen by the OS


state will
depending upon the scheduling algorithm.
Hence, if we have only one CPU in our system,
∙ the number of running
processes for a particular time will always be
∙ If we have n processors in the system then we can have n processes
one.
running simultaneously.
5 PROCESS-STAT
2
4. Block or wait
ES
∙ From the Running state, a process can make the transition to the block
or wait state depending upon the scheduling algorithm or the intrinsic
behaviour of the process.

∙ When a process waits for a certain resource to be assigned or for the


input from the user then the OS move this process to the block or wait
state and assigns the CPU to the other processes.

5. Completion or termination
∙ When a process finishes its execution, it comes in the termination state.
All the context of the process (Process Control Block) will also be
deleted the process will be terminated by the Operating system.
5 PROCESS-STAT
3
ES
6. Suspend ready
∙ A process in the ready state, which is moved to secondary memory from
the main memory due to lack of the resources (mainly primary memory)
is called in the suspend ready state.

∙ If the main memory is full and a higher priority process comes for the
execution then the OS have to make the room for the process in the
main memory by throwing the lower priority process out into the
secondary memory.

∙ The suspend ready processes remain in the secondary memory until


the main memory gets available.
5 PROCESS-STAT
4
ES
7. Suspend wait
∙ Instead of removing the process from the ready queue, it's better to
remove the blocked process which is waiting for some resources in the
main memory.

∙ Since it is already waiting for some resource to get available hence it is


better if it waits in the secondary memory and make room for the higher
priority process.

∙ These processes complete their execution once the main memory gets
available and their wait is finished.
5 OPERATIONS ON THE
5
PROCESS
1. Creation
∙ Once the process is created, it will be ready and come into the ready
queue (main memory) and will be ready for the execution.

2. Scheduling

∙ Out of the many processes present in the ready queue, the Operating
system chooses one process and start executing it.

∙ Selecting the process which is to be executed next, is known as


scheduling.
5 OPERATIONS ON THE
6
PROCESS
3. Execution
∙ Once the process is scheduled for the execution, the processor starts
executing it. Process may come to the blocked or wait state during the
execution then in that case the processor starts executing the other
processes.

4. Deletion/killing
∙ Once the purpose of the process gets over then the OS will kill the
process. The Context of the process (PCB) will be deleted and the
process gets terminated by the Operating system.
5 PROCESS CONTROL BLOCK
7
(PCB)
While creating a process the operating system performs
several operations. To identify the processes, it assigns
a process identification number (PID) to each process.
As the operating system supports multi-programming, it
needs to keep track of all the processes.
For this task, the process control block (PCB) is used to
track the process’s execution status.
Each block of memory contains information about the
process state, program counter, stack pointer, status of
opened files, scheduling algorithms, etc.
A process control block (PCB) contains information about
the process, i.e. registers, quantum, priority, etc.
5 PROCESS CONTROL BLOCK
8
(PCB)
∙ The contents in PCB are:

1. Process state: The current state of the process.

2. Program counter: The address of the next instruction to be executed for this process.
[Link] registers: The registers vary in number and type, depending on the computer
architecture. They include accumulators, index registers, stack pointers, and general-purpose
registers, plus any condition-code (status register) information.
5 PROCESS CONTROL BLOCK
9
(PCB)
[Link]-scheduling information: This information includes a process priority, pointers to
scheduling queues, and any other scheduling parameters.

[Link]-management information: This information may include such information as the


value of the base and limit registers, the page tables, or the segment tables etc.

6. Accounting information: This information includes the amount of CPU and real time used,
time limits, account numbers, job or process numbers, and so on.
7.I/O status information: This information includes the list of I/O devices allocated to the
process, a list of open files, and so on.
6
0

You might also like