0% found this document useful (0 votes)
37 views21 pages

8051 Unit 5

Uploaded by

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

8051 Unit 5

Uploaded by

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

Embedded System

Embedded means something that is attached to another thing. An embedded system can be thought of as a computer
hardware system having software embedded in it. An embedded system can be an independent system or it can be a
part of a large system. An embedded system is a microcontroller or microprocessor based system which is designed to
perform a specific task. For example, a fire alarm is an embedded system; it will sense only smoke.
An embedded system has three components −
 It has hardware.
 It has application software.
 It has Real Time Operating system (RTOS) that supervises the application software and provide mechanism to
let the processor run a process as per scheduling by following a plan to control the latencies. RTOS defines the
way the system works. It sets the rules during the execution of application program. A small scale embedded
system may not have RTOS.
So we can define an embedded system as a Microcontroller based, software driven, reliable, real-time control system.

Characteristics of an Embedded System


 Single-functioned − An embedded system usually performs a specialized operation and does the same
repeatedly. For example: A pager always functions as a pager.
 Tightly constrained − All computing systems have constraints on design metrics, but those on an embedded
system can be especially tight. Design metrics is a measure of an implementation's features such as its cost,
size, power, and performance. It must be of a size to fit on a single chip, must perform fast enough to process
data in real time and consume minimum power to extend battery life.
 Reactive and Real time − Many embedded systems must continually react to changes in the system's
environment and must compute certain results in real time without any delay. Consider an example of a car
cruise controller; it continually monitors and reacts to speed and brake sensors. It must compute acceleration or
de-accelerations repeatedly within a limited time; a delayed computation can result in failure to control of the car.
 Microprocessors based − It must be microprocessor or microcontroller based.
 Memory − It must have a memory, as its software usually embeds in ROM. It does not need any secondary
memories in the computer.
 Connected − It must have connected peripherals to connect input and output devices.
 HW-SW systems − Software is used for more features and flexibility. Hardware is used for performance and
security.

Advantages

 Easily Customizable
 Low power consumption
 Low cost
 Enhanced performance
Disadvantages

 High development effort


 Larger time to market

Basic Structure of an Embedded System


The following illustration shows the basic structure of an embedded system −

 Sensor − It measures the physical quantity and converts it to an electrical signal which can be read by an
observer or by any electronic instrument like an A2D converter. A sensor stores the measured quantity to the
memory.
 A-D Converter − An analog-to-digital converter converts the analog signal sent by the sensor into a digital signal.
 Processor & ASICs − Processors process the data to measure the output and store it to the memory.
 D-A Converter − A digital-to-analog converter converts the digital data fed by the processor to analog data
 Actuator − An actuator compares the output given by the D-A Converter to the actual (expected) output stored in
it and stores the approved output.

Popular Embedded Operating Systems


There are various popular embedded operating systems. Some of them are as follows:

eCos

It stands for 'Embedded Configurable Operating System', and all of its components provide a wide range of
configuration options. The eCos operating system may support a wide range of popular embedded CPUs.

mbed OS

It is a free and open-source embedded operating system that offers a systematic and comprehensive environment for
intelligent hardware development.

VxWorks

Wind River Company firstly introduced it in 1983. It is supported with task synchronization, memory efficiency
management, and other features.

µC/OS-II:

It is introduced based on the μC/OS principle. μC/OS-II may handle 64 tasks and provide various functionalities such as
interrupt services, task scheduling, memory management, synchronization, and time management.
FreeRTOS

It is a lightweight operating system that supports the priority scheduling algorithm. It provides various functionalities like
memory management, message queue, task management, semaphore, time management, etc.

QNX

QNX was created in 1980 and is a commercial embedded real operating system that requires the POSIX specification to
compile.

µ Clinux

It stands for 'Micro-Control Linux', and it is the latest version of embedded Linux. It is capable of grab all features of the
Linux operating system.

Embedded Operating System Uses

The embedded operating system is commonly used in various areas, including car navigation systems, multimedia players,
airplane navigation systems, and medical equipment.

Car navigation system

The car navigation system is a small computer system with a touch screen that enables the driver to navigate numerous
menus such as audio playback, radio, GPS and route mapping, fuel level, hands-free calls, and tire pressure monitoring
systems. All of these tasks are performed by the computer to improve the driving experience.

Parking Metering

Smart city parking meters use the embedded system to manage the user input and track time and costs. Depending on
the design, these devices contain a variety of built-in functions. For example, some sensors detect vehicle entry and exit,
while others require the driver to enter the parking space or vehicle license. A user interface offers the driver options,
including defining the expected return time and paying appropriately.

Medical Equipment

Medical equipment automatically monitors bio constants, administers drugs. If the bio constants exceed or fall below a
threshold value, it alerts the staff. As a result, it may help doctors treat the patients, monitor health issues, and save their
lives.

The navigation system of a plane

The navigation system of a plane is a good instance of a real-time operating system. The main computer of an airplane is
connected to most control systems such as the wing, engine, pressure controls, and safety. As a result, it is specifically built
to work inside a plane and help with takeoff, landing, and emergency operations.

Advantages and disadvantages of Embedded Operating System


There are various advantages and disadvantages of an embedded operating system. Some of them are as follows:

Advantages
There are various advantages of an embedded operating system. Some of them are as follows:

1. It is small in size and faster to load.


2. It is low cost.
3. It is easy to manage.
4. It provides better stability.
5. It provides higher reliability.
6. It provides some interconnections.
7. It has low power consumption.
8. It helps to increase the product quality.

Disadvantages

There are various disadvantages of an embedded operating system. Some of them are as follows:

1. It isn't easy to maintain.


2. The troubleshooting is harder.
3. It has limited resources for memory.
4. It isn't easy to take a back of embedded files.
5. You can't change, improve, or upgrade an embedded system once it's been developed.
6. If any problem occurs, you need to reset the setting.
7. Its hardware is limited.

Types of Interfacing Devices and Applications with Microcontroller

Every electrical and electronics project designed to develop electronic gadgets that are frequently used in our
day-to-day life utilizes microcontrollers with appropriate interfacing devices. There are different types of
applications that are designed using microcontroller based projects. In maximum number of applications, the
microcontroller is connected with some external devices called as interfacing devices for performing some
specific tasks. For example, consider security system with a user changeable password project, in which an
interfacing device, keypad is interfaced with microcontroller to enter the password.

Interfacing Devices
Interfacing can be defined as transferring data between microcontrollers and interfacing peripherals such as
sensors, keypads, microprocessors, analog to digital converters or ADC, LCD displays, motors, external
memories, even with other microcontrollers, some other interfacing peripheral devices and so on or input
devices and output devices. These devices that are interfacing with 8051 microcontroller are used for
performing special tasks or functions are called as interfacing devices.
Interfacing is a technique that has been developed and being used to solve many composite problems in circuit
designing with appropriate features, reliability, availability, cost, power consumption, size, weight, and so on.
To facilitate multiple features with simple circuits, microcontroller is interfaced with devices such as ADC,
keypad, LCD display and so on.

Analog to Digital Converter (ADC)


A to D converter is an electronic integrated circuit used for converting the analog signals into a digital or binary
form. Generally, analog to digital converters takes an input voltage from 0 to 10V, -5V to +5V, etc. and thereby
converts this analog input into digital output. Most of the environmental parameters such as temperature, sound,
pressure, light, etc. are measurable in analog form only. If we consider a temperature monitoring system, then
obtaining, examining and handling temperature data from the temperature sensors is unable with the digital
measuring system. Therefore, this system requires an intermediate device for converting the temperature from
analog to digital data, such that for communicating with the digital system containing microcontrollers and
microprocessors.

ADC Interfacing with 8051 Microcontroller

SCADA for remote industrial plant is a practical application in which,analog to digital converter or ADC
interfacing with 8051 microcontroller is used. To continuously monitor the multiple operations of the remote
industrial plant, supervisory control and data acquisition (SCADA) is the best technology for achieving control
over various operations of industry remotely, thus increases efficiency and saves lot of manpower.

ADC Interfacing with 8051 Microcontroller Project Kit by Edgefxkits.com

In this project temperature sensors are interfaced with microcontroller that is connected to a PC. Temperature
sensors connected are interfaced to microcontroller with the help of analog to digital converter. As, the signal
generated from sensors is analog, so these analog signals are converted into digital and then fed to the
microcontroller. For serial communication RS232 is a standard. RS232 interface is used for obtaining
communication between the computer and circuit such to transfer data between circuit and computer.

ADC Interfacing with 8051 Microcontroller Block Diagram by Edgefxkits.com

If the temperature exceeds the preset value, then microcontroller activates relay that will turn off the heaters and
an AV alarm will be generated if the system fails. Here the heaters are represented with lamps for
demonstration purpose.

Keypad or Keyboard
In general keypads or keyboards are used as input devices for computers. But, among various types of
interfacing devices, keypad is also one type of frequently used interfacing peripheral devices. In general, keypad
or keyboard consists of rows and columns, are called as matrix keypads (m rows*n columns keypads). These
are interfaced with microcontroller for entering values or names whenever it is required for the circuit.

Keypad or Keyboard

Application of Keypad as Interfacing Device


Security system with a user changeable password is a practical application in which keypad is used as one of the
interfacing devices. Password based door lock system is used for security to house or organization or office or
company. In this system, opening or closing the door can be operated only by entering the right password. For
entering password,keyboard interfacing or keypad interfacing with 8051 microcontroller is used.
Application of Keypad as Interfacing Device Project Kit by Edgefxkits.com

Thus,the system will avoid the unauthorized persons to operate the door. Even, if any unauthorized attempt
made to operate the door can be altered with an alarm system, here indicated by the lamp. In this project we can
improve the security of the system by using many interfacing devices can be used such as keypad, relay,
EEPROM, GSM modem.

The Keypad is used for entering the password, authorized person can change the password using an external
interfacing peripheral devices such as EEPROM. And further microcontroller interfacing GSM modem can be
used for sending an alert SMS to authorized person regarding unauthorized attempt if any, made to operate the
door with the wrong password.
LCD Display
An LCD display or liquid crystal display is one of the most frequently used interfacing devices that consist of
liquid crystals. It can be considered as a combination of solid and liquid (directly liquid is not used, but in fact
water liquid crystals are used). These LCD displays utilizes liquid crystals for producing visible images. LCD
displays are display screen super thin technology that is being used in cell phones, televisions, portable video
games, laptops, computer monitors, portable video games.

LCD Display
Application of LCD Interfacing with Microcontroller
The RFID based attendance system is a practical application of LCD display interfacing with 8051
microcontroller. This system is a modern way of taking students attendance in the classroom and it will avoid
conventional time consuming manual attendance system.

Application of LCD Interfacing with Microcontroller Project Kit by Edgefxkits.com

In this project, every student data is stored in a card that is used as identification for taking attendance of
students. If a student places his/her card in front of the RFID card reader, then this data is read and verified by
comparing it with previously stored data of the 8051 microcontroller. Based on the verification of data
matching, it displays a message on the LCD display. LCD displays interfaced with microcontroller that is used
for displaying a confirmation message, whether the student is present or absent.
If student’s attendance information is required, then by pressing the status button that is interfaced to the
microcontroller attendance can be retrieved. Thus, this system saves a lot of time as the data is stored in the
database. By interfacing the GSM system with this project, it can be used to send SMS alerts to the parents of
the students regarding the attendance.
Application of LCD Interfacing with Microcontroller Block Diagram by Edgefxkits.com

Microcontroller in Robotics
A robot microcontroller is basically the brain of the robot. It is used to collect the information from various input
devices such as sensors, switches and others. Then it executes a program and in accordance with it controls the
output devices such as motors, lights and others.

What is a Real-Time Operating System (RTOS)?


Real-time operating system (RTOS) is an operating system intended to serve real time application that
process data as it comes in, mostly without buffer delay. The full form of RTOS is Real time operating
system.

In a RTOS, Processing time requirement are calculated in tenths of seconds increments of time. It is time-
bound system that can be defined as fixed time constraints. In this type of system, processing must be
done inside the specified constraints. Otherwise, the system will fail.

Why use an RTOS?


Here are important reasons for using RTOS:

 It offers priority-based scheduling, which allows you to separate analytical processing from non-
critical processing.
 The Real time OS provides API (Application Programming Interface) functions that allow cleaner
and smaller application code.
 Abstracting timing dependencies and the task-based design results in fewer interdependencies
between modules.
 RTOS offers modular task-based development, which allows modular task-based testing.
 The task-based API encourages modular development as a task, will typically have a clearly
defined role. It allows designers/teams to work independently on their parts of the project.
 An RTOS is event-driven with no time wastage on processing time for the event which is not occur.
Components of RTOS

Components of Real Time Operating System

Here, are important Component of RTOS

The Scheduler: This component of RTOS tells that in which order, the tasks can be executed which is
generally based on the priority.

Symmetric Multiprocessing (SMP): It is a number of multiple different tasks that can be handled by the
RTOS so that parallel processing can be done.

Function Library: It is an important element of RTOS that acts as an interface that helps you to connect
kernel and application code. This application allows you to send the requests to the Kernel using a
function library so that the application can give the desired results.

Memory Management: this element is needed in the system to allocate memory to every program, which
is the most important element of the RTOS.

Fast dispatch latency: It is an interval between the termination of the task that can be identified by the
OS and the actual time taken by the thread, which is in the ready queue, that has started processing.
User-defined data objects and classes: RTOS system makes use of programming languages like C or
C++, which should be organized according to their operation.

Types of RTOS
Three types of RTOS systems are:

Hard Real Time :


In Hard RTOS, the deadline is handled very strictly which means that given task must start executing on
specified scheduled time, and must be completed within the assigned time duration.

Example: Medical critical care system, Aircraft systems, etc.

Firm Real time:


These type of RTOS also need to follow the deadlines. However, missing a deadline may not have big
impact but could cause undesired affects, like a huge reduction in quality of a product.

Example: Various types of Multimedia applications.

Soft Real Time:


Soft Real time RTOS, accepts some delays by the Operating system. In this type of RTOS, there is a
deadline assigned for a specific job, but a delay for a small amount of time is acceptable. So, deadlines
are handled softly by this type of RTOS.

Example: Online Transaction system and Livestock price quotation System.

Terms used in RTOS


Here, are essential terms used in RTOS:

 Task – A set of related tasks that are jointly able to provide some system functionality.
 Job – A job is a small piece of work that can be assigned to a processor, and that may or may not
require resources.
 Release time of a job – It’s a time of a job at which job becomes ready for execution.
 Execution time of a job: It is time taken by job to finish its execution.
 Deadline of a job: It’s time by which a job should finish its execution.
 Processors: They are also known as active resources. They are important for the execution of a
job.
 Maximum time: It is the allowable response time of a job is called its relative deadline.
 Response time of a job: It is a length of time from the release time of a job when the instant
finishes.
 Absolute deadline: This is the relative deadline, which also includes its release time.

Features of RTOS
Here are important features of RTOS:

 Occupy very less memory


 Consume fewer resources
 Response times are highly predictable
 Unpredictable environment
 The Kernel saves the state of the interrupted task and then determines which task it should run
next.
 The Kernel restores the state of the task and passes control of the CPU for that task.

Factors for selecting an RTOS


Here, are essential factors that you need to consider for selecting RTOS:

 Performance: Performance is the most important factor required to be considered while selecting
for a RTOS.
 Middleware: if there is no middleware support in Real time operating system, then the issue of
time-taken integration of processes occurs.
 Error-free: RTOS systems are error-free. Therefore, there is no chance of getting an error while
performing the task.
 Embedded system usage: Programs of RTOS are of small size. So we widely use RTOS for
embedded systems.
 Maximum Consumption: we can achieve maximum Consumption with the help of RTOS.
 Task shifting: Shifting time of the tasks is very less.
 Unique features: A good RTS should be capable, and it has some extra features like how it
operates to execute a command, efficient protection of the memory of the system, etc.
 24/7 performance: RTOS is ideal for those applications which require to run 24/7.

Difference between in GPOS and RTOS


Here are important differences between GPOS and RTOS:

General-Purpose Operating System


Real-Time Operating System (RTOS)
(GPOS)

It used for desktop PC and laptop. It is only applied to the embedded application.

Process-based Scheduling. Time-based scheduling used like round-robin scheduling.

Interrupt latency is not considered as Interrupt lag is minimal, which is measured in a few
important as in RTOS. microseconds.

No priority inversion mechanism is present The priority inversion mechanism is current. So it can not
in the system. modify by the system.

Kernel’s operation may or may not be


Kernel’s operation can be preempted.
preempted.

Priority inversion remain unnoticed No predictability guarantees

Applications of Real Time Operating System


Real-time systems are used in:

 Airlines reservation system.


 Air traffic control system.
 Systems that provide immediate updating.
 Used in any system that provides up to date and minute information on stock prices.
 Defense application systems like RADAR.
 Networked Multimedia Systems
 Command Control Systems
 Internet Telephony
 Anti-lock Brake Systems
 Heart Pacemaker

Disadvantages of RTOS
Here, are drawbacks/cons of using RTOS system:

 RTOS system can run minimal tasks together, and it concentrates only on those applications which
contain an error so that it can avoid them.
 RTOS is the system that concentrates on a few tasks. Therefore, it is really hard for these systems
to do multi-tasking.
 Specific drivers are required for the RTOS so that it can offer fast response time to interrupt
signals, which helps to maintain its speed.
 Plenty of resources are used by RTOS, which makes this system expensive.
 The tasks which have a low priority need to wait for a long time as the RTOS maintains the
accuracy of the program, which are under execution.
 Minimum switching of tasks is done in Real time operating systems.
 It uses complex algorithms which is difficult to understand.
 RTOS uses lot of resources, which sometimes not suitable for the system.

Summary:
 RTOS is an operating system intended to serve real time application that process data as it comes
in, mostly without buffer delay.
 It offers priority-based scheduling, which allows you to separate analytical processing from non-
critical processing.
 Important components of RTOS system are: 1)The Scheduler, 2) Symmetric Multiprocessing, 3)
Function Library, 4) Memory Management, 5) Fast dispatch latency, and 6) User-defined data
objects and classes
 Three types of RTOS are 1) Hard time 2) Soft time ,and 3) Firm time
 RTOS system occupy very less memory and consume fewer resources
 Performance is the most important factor required to be considered while selecting for a RTOS.
 General-Purpose Operating System (GPOS) is used for desktop PC and laptop while Real-Time
Operating System (RTOS) only applied to the embedded application.
 Real-time systems are used in Airlines reservation system, Air traffic control system,etc.
 The biggest drawback of RTOS is that the system only concentrates on a few tasks.

Multitasking in Operating System (OS)


Definition – Multitasking operating system provides the interface for executing the multiple
program tasks by single user at a same time on the one computer system. For example, any
editing task can be performed while other programs are executing concurrently. Other example,
user can open Gmail and Power Point same time. Microsoft Windows 2000, IBM's OS/390,
and Linux are examples of operating systems that can do multitasking.

Types of Multitasking Operating System


True Multitasking
True multitasking is the capable for executing and process multiple tasks concurrently without
taking delay instead of switching tasks from one processor to other processor. It can perform
couple of tasks in parallel with underlying the H/W or S/W.

Preemptive Multitasking
Preemptive multitasking is special task that is assigned to computer operating system, in which
it takes decision that how much time spent by one task before assigning other task for using the
operating system. Operating system has control for completing this entire process, so it is known
as “Preemptive”.
Cooperative Multitasking
Cooperative multitasking is known as “Non-Preemptive Multitasking”. Main goal of Cooperative
multitasking is to run currently task, and to release the CPU to allow another task run. This task is
performed by calling taskYIELD().Context-switch is executed when this function is called.

Advantages of Multitasking Operating System


Time Shareable
In which, all tasks are allocated specific piece of time, so they do not need for waiting time for
CPU.
Manage Several Users
This operating system is more comfort for handling the multiple users concurrently, and several
programs can run smoothly without degradation of system’s performance.
Secured Memory
Multitasking operating system has well defined memory management, because this operating
system does not provide any types of permissions of unwanted programs to wasting the memory.
Great Virtual Memory
Multitasking operating system contains the best virtual memory system. Due to virtual memory,
any program do not need long waiting g time for completion their tasks, if this problem is occurred
then those programs are transferred to virtual memory.
Background Processing
Multitasking operating system creates the better environment to execute the background
programs. These background programs are not transparent for normal users, but these programs
help to run other programs smoothly such as firewall, antivirus software, and more.
Good Reliability
Multitasking operating system provides the several flexibilities for multiple users, and they are
more satisfied to them. On which, every users can operate single or multiple programs with
smoothly.
Use Multiple Programs
Users can operate multiple programs such as internet browser, PowerPoint, MS Excel, games,
and other utilities concurrently.
Optimize Computer Resources
Multitasking operating system is able to handle smoothly multiple computers’ resources such as
RAM, input/output devices, CPU, hard disk, and more.

Disadvantages of Multitasking Operating System


Memory Boundation
Computer can get slow performance, due to run multiple programs at a same time because main
memory gets more load while loading multiple programs. CPU is not able to provide separate
time for every program, and its response time gets increase. Main reason of occurring this
problem is that it uses to less capacity RAM. So, for getting solution can be increased the RAM
capacity.
Processor Boundation
Computer can run programs slowly due to slow speed of their processors, and its response time
can increase while handling multiple programs. Need better processing power, to overcome this
problem.
CPU Heat up
Multiple processors become busier at a time for executing any task in multitasking nature, So
CPU produces more heat.
Examples of Multitasking Operating System
There are some examples of multi tasking OS like as –
 Windows XP
 Windows Vista
 Windows 7
 Windows 8
 Windows 10
 Windows 2000
 IBM’s OS/390
 Linux
 UNIX

Round robin scheduling is a pre-emptive algorithm commonly used in operating systems to schedule
processes.

In round robin scheduling, the CPU is assigned to each process in a queue turn by turn for a time period.
Once the time is over, the process is moved to the end of the queue and the CPU is shifted to the next
process in the queue. In this manner, processes are handled from a cyclic queue until the burst time of a
process has passed.

Example

You will be able to understand round robin scheduling better through the example given below. First, we
need a list of processes, including their arrival and burst times. The quantum time per process will be 3, so
every process will execute for 3 seconds each.
Each box represents 1 second of CPU allocation time

Time = 0

At time=0time=0, the processes P1 and P2 enter the queue according to their arrival time and wait to be
executed. Since P1 arrives first, it is taken out of the waiting queue and executed for 3 seconds.
P1

Each box represents 1 second of CPU allocation time

Time = 2

At time=2time=2, P3 and P4 enter the waiting queue.

P1P1P1

Each box represents 1 second of CPU allocation time

Time = 3

At time=3time=3, P1 stops executing and its burst time is over. Hence, it is not added back to the waiting
queue. P2 is removed from the waiting queue and executed for the next 3 seconds.
P1P1P1P2

Each box represents 1 second of CPU allocation time


Time = 6

At time=6time=6, P2 is done executing and its burst time is over. Hence, it isn’t added back to the
waiting queue. We remove the next process, P3, from the waiting queue and execute it for the next 3
seconds.
P1P1P1P2P2P2P3

Each box represents 1 second of CPU allocation time

Time = 9

At time=9time=9, P3 stops executing and is added back to the waiting queue because its burst time is not
over. Then, we remove the next process, P4, from the waiting queue and execute it for the next 3 seconds.
P1P1P1P2P2P2P3P3P3P4

Each box represents 1 second of CPU allocation time

Time = 12

At time=12time=12, P4 stops executing and is added back to the waiting queue because its burst time is
not over yet. Then, we remove process P3 from the waiting queue and execute it. As P3 has a burst time of
4 and has completed an execution of 3 seconds already, it is only executed for the next 1 second.
P1P1P1P2P2P2P3P3P3P4P4P4P3

Each box represents 1 second of CPU allocation time

Time = 13

At time=13time=13, P3 is done executing and its burst time is over. Hence, it is not added back to the
waiting queue. Then, process P4 is executed for the next 1 second only, as it was previously executed for 3
of its 4-second burst time.
P1P1P1P2P2P2P3P3P3P4P4P4P3P4

Each box represents 1 second of CPU allocation time

Time = 14

At time=14time=14, the execution of all the processes is complete.

Average waiting time

To deduce the average waiting time, we calculate the waiting time for each process and divide it by the
total number of processes.

P1 waiting time: 0
P2 waiting time: 0
P3 waiting time: 9
P4 waiting time: 10

Average waiting time: (9+10) / 4= 4.75


Advantages and disadvantages

The following is a table of all the advantages and disadvantages of using the round robin scheduling
algorithm.

Advantages Disadvantages
There is no issue of starvation as each process gets an equal Processes have to wait a longer duration for their
chance and time to be executed turn
Each of the processes gets equal time Context switching takes time
No process is given priority over the other Due to a longer waiting time and context switching,
the throughput is low

What is Preemptive Scheduling?


Preemptive Scheduling is a CPU scheduling technique that works by dividing time slots of CPU to a given process. The
time slot given might be able to complete the whole process or might not be able to it. When the burst time of the process
is greater than CPU cycle, it is placed back into the ready queue and will execute in the next chance. This scheduling is
used when the process switch to ready state.

Algorithms that are backed by preemptive Scheduling are round-robin (RR), priority, SRTF (shortest remaining time first).

When a high-priority process comes in the ready queue, it doesn't have to wait for the running process to finish its burst
time. However, the running process is interrupted in the middle of its execution and placed in the ready queue until the
high-priority process uses the resources. As a result, each process gets some CPU time in the ready queue. It improves the
overhead of switching a process from running to ready state and vice versa, increasing preemptive scheduling flexibility. It
may or may not include SJF and Priority scheduling.

For example:

Let us take the example of Preemptive Scheduling. We have taken P0, P1, P2, and P3 are the four processes.

Process Arrival Time CPU Burst time (in millisec.)

P0 3 2

P1 2 4

P2 0 6

P3 1 4
o Firstly, the process P2 comes at time 0. So, the CPU is assigned to process P2.
o When process P2 was running, process P3 arrived at time 1, and the remaining time for process P2 (5 ms) is
greater than the time needed by process P3 (4 ms). So, the processor is assigned to P3.
o When process P3 was running, process P1 came at time 2, and the remaining time for process P3 (3 ms) is less
than the time needed by processes P1 (4 ms) and P2 (5 ms). As a result, P3 continues the execution.
o When process P3 continues the process, process P0 arrives at time 3. P3's remaining time (2 ms) is equal
to P0's necessary time (2 ms). So, process P3 continues the execution.
o When process P3 finishes, the CPU is assigned to P0, which has a shorter burst time than the other processes.
o After process P0 completes, the CPU is assigned to process P1 and then to process P2.

Advantages and disadvantages of Preemptive Scheduling

There are various advantages and disadvantages of Preemptive scheduling. The advantages and disadvantages of non-
preemptive scheduling are as follows:

Advantages

1. It is a more robust method because a process may not monopolize the processor.
2. Each event causes an interruption in the execution of ongoing tasks.
3. It improves the average response time.
4. It is more beneficial when you use this method in a multi-programming environment.
5. The operating system ensures that all running processes use the same amount of CPU.

Disadvantages

1. It requires the use of limited computational resources.


2. It takes more time suspending the executing process, switching the context, and dispatching the new incoming
process.
3. If several high-priority processes arrive at the same time, the low-priority process would have to wait longer.

What is Non-Preemptive Scheduling?


Non-preemptive Scheduling is a CPU scheduling technique the process takes the resource (CPU time) and holds it till
the process gets terminated or is pushed to the waiting state. No process is interrupted until it is completed, and after that
processor switches to another process.

Algorithms that are based on non-preemptive Scheduling are non-preemptive priority, and shortest Job first.
When a non-preemptive process with a high CPU burst time is running, the other process would have to wait for a long
time, and that increases the process average waiting time in the ready queue. However, there is no overhead in
transferring processes from the ready queue to the CPU under non-preemptive scheduling. The scheduling is strict
because the execution process is not even preempted for a higher priority process.

For example:

Let's take the above preemptive scheduling example and solve it in a non-preemptive manner.

o The process P2 comes at 0, so the processor is assigned to process P2 and takes (6 ms) to execute.
o All of the processes, P0, P1, and P3, arrive in the ready queue in between. But all processes wait till
process P2 finishes its CPU burst time.
o After that, the process that comes after process P2, i.e., P3, is assigned to the CPU until it finishes its burst time.
o When process P1 completes its execution, the CPU is given to process P0.

Advantages and disadvantages of Non-preemptive Scheduling

There are various advantages and disadvantages of non-preemptive scheduling. The advantages and disadvantages of
non-preemptive scheduling are as follows:

Advantages

1. It provides a low scheduling overhead.


2. It is a very simple method.
3. It uses less computational resources.
4. It offers high throughput.

Disadvantages

1. It has a poor response time for the process.


2. A machine can freeze up due to bugs.

What Does Windows CE Mean?


Windows CE is an operating system developed by Microsoft and designed for small footprint devices or
embedded systems. Windows CE is different from the Windows operating systems for desktops but they
share similar application programming interfaces for a considerable number of classes. Some of the
devices that run Windows CE include industrial controllers, point of sale terminals, cameras, Internet
appliances, cable set-top boxes and communications hubs.
Techopedia Explains Windows CE
A typical Windows CE-powered device can have less than a megabyte of memory, no disk storage and can
also be placed directly into ROM.

Using Microsoft Platform Builder, developers can build customized Windows CE operating systems as well
as components for embedded systems. Platform Builder is an integrated development environment that
comes with development tools for designing, creating, building, testing and debugging. Most parts of
Windows CE are offered in source code form, enabling hardware vendors to alter it in order to fit the
specific needs of their device.

Developers who create Windows CE-based OS designs perform the following:

 Create BSP or board support packages specifically designed for the target device.
 Create an OS design, based on either a standard or customized board support package (BSP), that
is used for creating a run-time image.
 Create customized device drivers for the BSP using projects and catalog items.
 Build the runtime image and download to the standard development board for debugging and
testing.
 Export a software development kit for application developers.

You might also like