Embedded_Systems_----_(Chapter_4_Layers_of_an_Embedded_System_)
Embedded_Systems_----_(Chapter_4_Layers_of_an_Embedded_System_)
Layers of an
Embedded System
Learning Outcomes
o Basic notion about layering
o To get insight about middleware
o To study the basics of all the layers
o Recap
o Quiz
4.1 INTRODUCTION
Those who have studied Computer Networking would be very familiar with the
concept of layering. The famous ISO-OSI layering is the reference model for
most of the networks. Similarly, each and every Embedded System that we
have seen as examples in the first chapter follow a basic structure, whose
pictorial depiction is given in Fig. 4.1.
Application Layer
Application Software Layer
(Optional)
Hardware Layer
Copyright © 2011. New Age International Ltd. All rights reserved.
(Optional)
As one can see from the above diagram, an embedded system will be generally
composed of 3 layers,
Kothari, D., Shriram, K., & Sundaram (2011). Embedded systems. New Age International Ltd.
Created from univerzulu on 2024-12-04 16:37:42.
Layers of an Embedded System 55
Kothari, D., Shriram, K., & Sundaram (2011). Embedded systems. New Age International Ltd.
Created from univerzulu on 2024-12-04 16:37:42.
56 Embedded Systems
The major hardware components of most boards can be classified into five
major categories:
1. Central Processing Unit (CPU) – the master processor
2. Memory – where the system’s software is stored
3. Input Device(s) – input slave processors and relative electrical
components
4. Output Device(s) – output slave processors and relative electrical
components
5. Data Pathway/Bus – interconnects the other components, providing
a “highway” for data to travel on from one component to another,
including any wires, bus bridges, and/or bus controllers.
These five categories are based upon the major elements defined by the von
Neumann model , a tool that can be used to understand any electronic device’s
hardware architecture. The von Neumann model is a result of the published
work of John von Neumann in 1945, which defined the requirements of a general-
purpose electronic computer. Since embedded systems are a type of computer
system, this model can be applied as a means of understanding embedded systems
hardware.
The way the buses connect the above mentioned components can be seen
in the following figure.
Kothari, D., Shriram, K., & Sundaram (2011). Embedded systems. New Age International Ltd.
Created from univerzulu on 2024-12-04 16:37:42.
Layers of an Embedded System 57
As depicted, the input is fed to the embedded board first, which is then
stored at the memory unit that will be accessed by the processor for performing
manipulations. Then the processor stores the result again in the memory that
will be finally given out to the output device for display!
The specifications of the hardware components such as the processor input
and output devices are given in Fig. 4.4.
Kothari, D., Shriram, K., & Sundaram (2011). Embedded systems. New Age International Ltd.
Created from univerzulu on 2024-12-04 16:37:42.
58 Embedded Systems
How does an OS for an embedded system differ from the other systems?
Embedded OSes vary in what components they possess; all OSes have a kernel
at the very least. The kernel is a component that contains the main
functionality of the OS,
• Process Management.
• Interrupt and error detection management.
• The multiple interrupts and/or traps generated by the various
processes need to be managed efficiently so that they are handled
correctly and the processes that triggered them are properly
tracked.
• Memory Management.
• I/O System Management.
Figure 4.6 shows the structure of an embedded OS.
Embedded OS
Middleware (Optional)
KERNEL
Process Management Memory Management
A special form of OS is an RTOS (Real Time OS) that deals with the tasks
which have stringent time requirements. A part of RTOS called Scheduler keeps
Kothari, D., Shriram, K., & Sundaram (2011). Embedded systems. New Age International Ltd.
Created from univerzulu on 2024-12-04 16:37:42.
Layers of an Embedded System 59
track of state of each task and decides which one should go to the running state.
Unlike UNIX or Windows the scheduler in RTOS are 100% simpleminded about
which task should get the processor. They simply look at the priorities you assign
to the tasks, and among the tasks that are not in the blocked state, the one with
highest priority runs, and rest of them will wait in Ready State. If a high priority
task hogs the microprocessor for a long time while lower priority tasks are
waiting in ready state, the low priority task has to wait. Scheduler assumes that
you knew what you were doing when you set the priorities.
• One of the main strengths in using middleware is that it allows for the
reduction of the complexity of the applications by centralizing software
infrastructure that would traditionally be redundantly found in the application
layer.
Kothari, D., Shriram, K., & Sundaram (2011). Embedded systems. New Age International Ltd.
Created from univerzulu on 2024-12-04 16:37:42.
60 Embedded Systems
It is the software within the application layer that inherently defines what type
of device an embedded system is, because the functionality of an application
represents at the highest level the purpose of that embedded system and does
most of the interaction with users or administrators of that device, if any
exists. Embedded applications can be divided according to whether they are
market specific (implemented in only a specific type of device, such as video-
Kothari, D., Shriram, K., & Sundaram (2011). Embedded systems. New Age International Ltd.
Created from univerzulu on 2024-12-04 16:37:42.
Layers of an Embedded System 61
POINTS TO REMEMBER
1. Any embedded system would be composed of a hardware layer, system
software layer and an application software layer.
2. Hardware components include a processor, I/O devices, and the buses.
3. A system software layer is responsible for process, I/O, memory
management.
4. Middleware layer.
5. Usually the software that mediates between application software and
the kernel or device driver software.
6. Application layer is dependent on the underlying system software layer.
Review Questions
1. Why is layering required and how has layering been done in Embedded
Systems?
2. Refer an immediate example for layering approach in networking. (it’s
simple)
4.3 QUIZ
1. How many layers are there in an embedded system design?
(a) 2 (b) 3
(c) 4 (d) 5
2. Which layer of embedded system accommodates operating system?
(a) Hardware Layer (b) SSL (c) Application Layer.
Kothari, D., Shriram, K., & Sundaram (2011). Embedded systems. New Age International Ltd.
Created from univerzulu on 2024-12-04 16:37:42.