0% found this document useful (0 votes)
15 views7 pages

UNIT 3 Embedded Notes

Real-time operating systems (RTOS) are essential for applications requiring timely processing of external events, such as industrial control and flight systems, and can be categorized into hard, soft, firm, and deterministic types. While RTOS offers advantages like maximum resource utilization and error-free operation, they also have limitations such as complex algorithms and limited multitasking capabilities. Additionally, flash memory is a key component in embedded systems, providing non-volatile storage with high speed and capacity, but it has limitations like a finite lifespan and slower write speeds compared to other storage solutions.

Uploaded by

Drishti Rani
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)
15 views7 pages

UNIT 3 Embedded Notes

Real-time operating systems (RTOS) are essential for applications requiring timely processing of external events, such as industrial control and flight systems, and can be categorized into hard, soft, firm, and deterministic types. While RTOS offers advantages like maximum resource utilization and error-free operation, they also have limitations such as complex algorithms and limited multitasking capabilities. Additionally, flash memory is a key component in embedded systems, providing non-volatile storage with high speed and capacity, but it has limitations like a finite lifespan and slower write speeds compared to other storage solutions.

Uploaded by

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

UNIT 3


Real-time operating systems (RTOS) are used in environments where a large number of
events, mostly external to the computer system, must be accepted and processed in a short time
or within certain deadlines. such applications are industrial control, telephone switching
equipment, flight control, and real-time simulations. With an RTOS, the processing time is
measured in tenths of seconds. This system is time-bound and has a fixed deadline. The
processing in this type of system must occur within the specified constraints. Otherwise, This
will lead to system failure.
Examples of real-time operating systems are airline traffic control systems, Command Control
Systems, airline reservation systems, Heart pacemakers, Network Multimedia Systems, robots,
etc.

Types of RTOS

The real-time operating systems can be of 3 types –

1. Hard Real-Time Operating System: These operating systems guarantee that critical
tasks are completed within a range of time.
For example, a robot is hired to weld a car body. If the robot welds too early or too late, the
car cannot be sold, so it is a hard real-time system that requires complete car welding by the
robot hardly on time., scientific experiments, medical imaging systems, industrial control
systems, weapon systems, robots, air traffic control systems, etc.

2. Soft real-time operating system: This operating system provides some relaxation in the
time limit.
For example – Multimedia systems, digital audio systems, etc. Explicit, programmer-defined,
and controlled processes are encountered in real-time systems. A separate process is changed
by handling a single external event. The process is activated upon the occurrence of the related
event signaled by an interrupt.
Multitasking operation is accomplished by scheduling processes for execution independently
of each other. Each process is assigned a certain level of priority that corresponds to the relative
importance of the event that it services. The processor is allocated to the highest-priority
processes. This type of schedule, called, priority-based preemptive scheduling is used by real-
time systems.

3. Firm Real-time Operating System: RTOS of this type have to follow deadlines as well.
In spite of its small impact, missing a deadline can have unintended consequences,
including a reduction in the quality of the product. Example: Multimedia applications.

4. Deterministic Real-time operating System: Consistency is the main key in this type of
real-time operating system. It ensures that all the task and processes execute with
predictable timing all the time,which make it more suitable for applications in which timing
accuracy is very important. Examples: INTEGRITY, PikeOS.

Advantages:
The advantages of real-time operating systems are as follows-
 Maximum consumption: Maximum utilization of devices and systems. Thus more
output from all the resources.
 Task Shifting: Time assigned for shifting tasks in these systems is very less. For
example, in older systems, it takes about 10 microseconds. 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 that are in the queue.
 Real-Time Operating System In Embedded System: Since the size of programs is
small, RTOS can also be 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.

Disadvantages:
The disadvantages of real-time operating systems are as follows-
 Limited Tasks: Very few tasks run simultaneously, 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.
 Minimum Switching: RTOS performs minimal task switching.
Comparison of Regular and Real-Time operating systems:
Regular OS Real-Time OS (RTOS)

Complex Simple

Best effort Guaranteed response

Fairness Strict Timing constraints

Average Bandwidth Minimum and maximum limits

Unknown components Components are known

Unpredictable behavior Predictable behavior

Plug and play RTOS is upgradeable

What is Kernel | Relevance of Kernel in RTOS Architecture


The core component of an operating system is called Kernel. Micro-Kernel Architecture is
implemented in Real Time Operating System with configurable functionalities.
Abstraction Layer is provided by the Kernel which offers six main types of common services
to the Application software. They are:
 Task Management
The application is divided into small, schedulable, and sequential program units known as
‘Thread‘ or ‘Task‘. This is done to achieve concurrency in Real Time Application. Task
Management by Kernel includes Real Time Task Creation, termination, changing priorities etc.
Task creation involves creating a Task Control Block (TCB) which has information about Task
id, priority, Task states i.e. if the task is in (idle, running, ready, terminated) state etc.
 Task Scheduling
It records the state of each task and determines the task of highest priority, to be executed. The
task which is already running is suspended and the processor executes the high priority task.
 Task Synchronization
It is necessary for the information to be transmitted safely from one Task or Thread to another
Task. Task Synchronization enables the tasks to mutually share the resources like buffers, I/O
devices etc.
 Memory management
It allocates the memory for each program. There are two types of Memory Management for
RTOS. They are:
Stack Management
Heap Management
Time Management
To schedule the tasks that need to be executed during specified duration, there is need for a
periodical interrupt. Hence hardware Timer is programmed to interrupt the processor. Time
interrupt is called System Tick.
 Interrupt Handling
CPU is informed about any asynchronous event through an Interrupt. It is a hardware
mechanism which handles an event by providing functions like defining Interrupt Handler,
creation and deletion of Interrupt service routine etc.
 Device I/O Management
Device I/O Management helps in providing uniform framework ( API – Application
Programmers Interface). It also helps in accessing specific hardware device drivers i.e. it
locates the right device for I/O request.

Real Time Scheduling (Separate PDF file is given)

Interrupt Service Routines Interrupt routine in RTOS environment and handling of


interrupt service calls

https://prezi.com/p/oqfzyoqtfko0/interrupt-handling-in-rtos/

Watchdog Timer
Watchdog timer is a piece of hardware in micro-controller. Watchdog timer is used to generates
system reset if system gets stuck somewhere i.e. if system goes into endless loop of execution
watchdog timer will reset the system to come out of endless loop. Watchdog is safety
mechanism in embedded system which makes your system reliable, but it depends on how you
make use of watchdog timer.

How does watchdog works :


Watchdog is basically a counter, which starts from counting zero and reaches to a certain
value. If counter reaches to certain value then watchdog hardware will generates a watchdog
reset. To avoid system reset, software needs to kick the watchdog i.e. need to reset the counter
to zero. In case software stuck into endless loop it system will not able to kick the watchdog
hence counter reaches to certain value and resets the system.
Watchdog is initially loaded with certain value. This value is calculated based on timeout time
of watchdog (Further section it is been shown how to calculate counter value based on timeout
value). Before timeout time, system should reset the counter.
e.g. If your system if performing 3 tasks periodically and to perform 3 tasks is takes 500 ms.
Then timeout time is considered as 600 ms (considering worst case scenario), counter value is
calculated with respect to 600 ms and loaded into watchdog.
Following figures shows watchdog hardware. Input to watchdog hardware is clock. Based on
every clock tick watchdog internal counter increments. Then there is comparator which
compares count value with loaded count value (timeout value) and if count matches watchdog
hardware generates and reset signal.
Flash Memory
 memory is secondary memory and so it is not volatile which means it persists the data
Flash
even if there is not an electrical supply provided. This flash memory works on the principle of
EEPROM. EEPROM stands for Electrical Erasable Programmable Read-Only Memory. ROM
operation can only one time write and many times read and we can’t erase it. But Flash Memory
can be erased multiple times and update the data or program integrated into it. So it gives
flexibility to the updation of the program but ROM has no such type of feature.

Features of Flash Memory


Non-volatile: There is no loss of date when there is no electricity supply.
Solid-state: It is SS technology so it is faster than HDD type storage.
Fast access times: It supports solid-state technology so it has faster access time.
Large storage capacity: Flash memory devices can store large amounts of data, from a few
GB (Gigabytes) to several TB(Terabytes).
Low power consumption: It is not based on header like HDD so no mechanical components
in flash memory so it uses less amount of electricity from read the data.
Flexibility towards Erase and write operations: Flash memory can be erased electrically
multiple times and read multiple times so flexibility towards read/write operation is more in
flash memory.

Working of Flash Memory:


These two are the main steps.
Writing the data into flash memory: Flash memory is made up of small-small memory cells
which are made up of floating-gate transistors. All memory cells are organized in the sequential
order called an array of memory cells. Data can be stored to the hardware in the form of 0 and
1 only. So to store the data into the flash memory we should give the electric supply to add the
pattern of 0 and 1 into the flash memory and once this pattern is embedded on to the chip then
corresponding data is also stored in the flash memory. If we want to erase the data from flash
memory then we have to do it by supplying electrical impulse to make all bits of memory cell
to 0.
Reading the data into flash memory: By reading the stored 0 and 1 into the cell we can get
our data stored in the flash memory. So to read the bit which can contain 0 or 1 we have to
apply voltage to the gate of transistor, and whatever the current flow in the circuit is measured
and by using that measurement we are good to go to identify the bit present in the cell.

NAND Flash NOR Flash

NAND flash memory is organized in a NOR flash memory is organized in a


series of memory cells parallel of memory cells

NAND flash memory has a higher NOR flash memory has a lower density than
density(store more data in a smaller space) NAND Flash

NAND flash memory has a faster read NOR flash memory has faster random
speed. access times than NAND flash memory,
NAND flash memory can survive less NOR flash memory can survive more
erase/write cycles before starting to degrade erase/write cycles before starting to degrade
than NOR than NAND

It is commonly used in high-density storage NOR flash memory is used in applications


applications. that require frequent read and write
operations.

Limitations of Flash Memory


 Limited lifespan: Writing onto the flash memory by electrical supply may damage the
hardware so it has some limitations to the lifespan of flash memory.
 Slower write speeds: Frequency of writing speed so less than RAM and to write the
data by using an electrical pulse every time may take more time than RAM.
 Limited storage capacity: Flash memory has a high storage density, but lesser than
some other memory devices such as HDDs or tape drives.
 Data corruption: When we are writing to the flash memory by using electrical pulse
and when power supply is cut off accidentally then loss of data will be there.

Benefits of Flash Memory


 Large storage capacity: Flash memory has high memory density so it is able to store
a high volume of data.
 High speed: Some flash memory has parallel architecture of memory cells so it has
faster speed to read and write operation.
 Persistent Data: Without supply of electricity it persist the data like HDDs.
 Low power consumption: Flash memory don’t have mechanical components like
HDD’s so it consume less amount of power than HDDs.

Applications of Flash Memory


 Used in SSDs: Flash memory is used in SSDs to increase the speed of read/write of
operations.
 Embedded systems: Flash memory is used in embedded systems. Examples: digital
cameras, camcorders, MP3 players etc.
 Smartphones and tablets: Flash memory is used in smartphones and tablets.
 USB drives: Flash memory is commonly used in USB drives.

Free RTOS
FreeRTOS is a market-leading real-time operating system (RTOS) for microcontrollers and
small microprocessors. Distributed freely under the MIT open source license, FreeRTOS
includes a kernel and a growing set of IoT libraries suitable for use across all industry sectors.
FreeRTOS is built with an emphasis on reliability and ease of use.
 FreeRTOS provides methods for multiple threads or tasks, mutexes, semaphores and
software timers.
 Thread priorities are supported.
 FreeRTOS applications can be statically allocated, but objects can also be dynamically
allocated with five schemes of memory management (allocation).
 A tickless mode is provided for low power applications.

You might also like