Professional Documents
Culture Documents
OPERATING SYSTEMS
Course Code: 70439
Mr N Srikanth Prasad
Assistant Professor
Department of Electronics and Communication Engineering
Malla Reddy Engineering College(A)
nsp.mrec@gmail.com
+91-93 9104 9134
1
Prerequisites
• Computer Programming
• Digital Electronics
• Microprocessors and Microcontrollers
2
Learning Objectives
To understand a typical embedded system and its constituents
To learn the selection process of processor and memory for the
embedded systems
To learn communication buses and protocols used in the
embedded and real-time systems
To understand real-time operating system (RTOS) and the
types of RTOS
To learn various approaches to real-time scheduling
To learn software development process and tools for RTOS
applications
3
Course Outcomes
On completion of the course, students will be able to –
CO1:Recognize and classify embedded and real-time systems
CO2:Explain communication bus protocols used for embedded
and real-time systems
CO3:Classify and exemplify scheduling algorithms
CO4:Apply software development process to a given RTOS
application
CO5:Design a given RTOS based application
CO6:Ability to use commercial tools to develop RTOS based
applications
4
Course Description
• Module – I : Introduction to Embedded Systems
• Module - II : Typical Embedded System
• Module - III : Embedded Firmware
• Module – IV : Operating System Concepts
5
TEXT BOOKS:
T1: Introduction to Embedded Systems - Shibu K.V, McGraw Hill.
T2: Qing Li, Elsevier, “Real Time Concepts for Embedded
Systems”, 2011.
REFERENCE BOOKS:
R1: Rajkamal, “Embedded Systems, Architecture,Programming
and Design”, TMH, 2007.
R2: Richard Stevens,“Advanced UNIX Programming”.
6
Module - I: Introduction to Embedded Systems
7
What is an Embedded System?
An embedded system is an electronic/electro-mechanical system designed to perform a specific
function and a combination of both hardware and firmware (software).
Every embedded system is unique and the hardware as well as the firmware is highly specialized to
the application domain.
Embedded systems are becoming an inevitable part of any product or equipment in all fields
including household appliances, telecommunications, medical equipment, industrial control,
consumer products, etc.
8
Embedded Systems vs General Computing Systems
Criteria General Purpose Computing System Embedded System
Contents A system which is a combination A system which is a combination of special
of a generic hardware and a General purpose hardware and embedded OS for
Purpose Operating System for executing executing a specific set of applications.
a variety of applications.
OS It contains a general purpose operating It may or contain an operating system for
system (GPOS). not functioning.
Alterations Applications are alterable The firmware of the embedded system
(programmable) by the user. (It is is pre-programmed and it is non-alterable by
possible for the end user to re-install the the end-user.
OS and also add or remove user
applications.)
Key factor Performance is the key deciding factor in Application specific requirements (like
the selection of the system. Faster is performance, power requirements, memory
better. usage, etc.) are key deciding factors.
9
Classification of Embedded System
10
Based On Generation
First generation(1G):
Built around 8bit microprocessor & microcontroller.
Simple in hardware circuit & firmware developed.
Examples: Digital telephone keypads.
Second generation(2G):
Built around 16-bit µp & 8-bit µc.
They are more complex & powerful than 1G µp & µc.
Examples: SCADA systems
Third generation(3G):
Built around 32-bit µp & 16-bit µc.
Concepts like Digital Signal Processors(DSPs), Application Specific Integrated
Circuits(ASICs) evolved.
Examples: Robotics, Media, etc.
11
Fourth generation:
Built around 64-bit µp & 32-bit µc.
The concept of System on Chips (SoC), Multicore Processors evolved.
Highly complex & very powerful.
Examples: Smart Phones.
12
Based on Complexity & Performance
Small-scale:
Simple in application need
Performance not time-critical.
Built around low performance & low cost 8 or 16 bit µp/µc.
Example: an electronic toy
Medium-scale:
Slightly complex in hardware & firmware requirement.
Built around medium performance & low cost 16 or 32 bit µp/µc.
Usually contain operating system.
Examples: Industrial machines.
Large-scale:
Highly complex hardware & firmware.
Built around 32 or 64 bit RISC µp/µc or PLDs or Multicore Processors.
Response is time-critical. Examples: Mission critical applications. 13
Based on Deterministic Behaviour
14
Based on Triggering
15
Major Application Areas of ES
The application areas and the products in the embedded domain are countless. A
16
Major Application Areas of ES (Cont’d)
VI. Computer peripherals: Printers, scanners, fax machines, etc.
VII.Computer Networking systems: Network routers, switches,
hubs, firewalls, etc.
VIII.Healthcare: Different kinds of scanners, EEG, ECG machines
etc.
IX. Measurement & Instrumentation: Digital multi meters,
digital CROs, logic analyzers PLC systems, etc.
X. Banking & Retail: Automatic Teller Machines (ATM) and
currency counters, point of sales (POS).
XI. Card Readers: Barcode, smart card readers, hand held
devices, etc.
17
Design Methodologies
• A procedure for designing a system.
• Understanding your methodology helps you
ensure you didn’t skip anything.
• Compilers, software engineering tools,
computer-aided design (CAD) tools, etc., can
be used to:
– help automate methodology steps;
– keep track of the methodology itself.
18
Design Goals
• Performance.
– Overall speed, deadlines.
• Functionality and user interface.
• Manufacturing cost.
• Power consumption.
• Other requirements (physical size, etc.)
19
Levels of Abstraction
requirements
specification
architecture
component
design
system
integration
20
Top-Down vs. Bottom-Up
• Top-down design:
– start from most abstract description;
– work to most detailed.
• Bottom-up design:
– work from small components to big system.
• Real design uses both techniques.
21
Stepwise Refinement
• At each level of abstraction, we must:
– analyze the design to determine characteristics of
the current state of the design;
– refine the design to add detail.
22
Requirements
• Plain language description of what the user
wants and expects to get.
• May be developed in several ways:
– talking directly to customers;
– talking to marketing representatives;
– providing prototypes to users for comment.
23
Functional vs. Non-Functional Requirements
• Functional requirements:
– output as a function of input.
• Non-functional requirements:
– time required to compute output;
– size, weight, etc.;
– power consumption;
– reliability;
– etc.
24
Our Requirements Form
name
purpose
inputs
outputs
functions
performance
manufacturing cost
power
physical size/weight
25
Example: GPS moving map Requirements
• Moving map
obtains position I-78
from GPS, paints
Scotch Road
map from local
database.
lat: 40 13 lon: 32 19
26
GPS Moving MAP needs
• Functionality: For automotive use. Show major
roads and landmarks.
• User interface: At least 400 x 600 pixel screen.
Three buttons max. Pop-up menu.
• Performance: Map should scroll smoothly. No
more than 1 sec power-up. Lock onto GPS within
15 seconds.
• Cost: $120 street price = approx. $30 cost of
goods sold.
27
GPS moving map needs, cont’d.
• Physical size/weight: Should fit in hand.
• Power consumption: Should run for 8 hours
on four AA batteries.
28
GPS moving map requirements form
29
Specification
• A more precise description of the system:
– should not imply a particular architecture;
– provides input to the architecture design process.
• May include functional and non-functional
elements.
• May be executable or may be in mathematical
form for proofs.
30
GPS specification
• Should include:
– What is received from GPS;
– map data;
– user interface;
– operations required to satisfy user requests;
– background operations needed to keep the system
running.
31
Architecture design
• What major components go satisfying the
specification?
• Hardware components:
– CPUs, peripherals, etc.
• Software components:
– major programs and their operations.
• Must take into account functional and non-
functional specifications.
32
GPS moving map block diagram
user
database interface
33
GPS moving map hardware architecture
GPS
receiver
memory
panel I/O
34
GPS moving map software architecture
user
timer
interface
35
Designing hardware and software
components
• Must spend time architecting the system
before you start coding.
• Some components are ready-made, some can
be modified from existing designs, others
must be designed from scratch.
36
System Integration
• Put together the components.
– Many bugs appear only at this stage.
• Have a plan for integrating components to
uncover bugs quickly, test as much
functionality as early as possible.
37
Purpose of Embedded Systems
Embedded systems are used in various domains like consumer electronics,
home automation, telecommunications, automotive industry, healthcare, control &
instrumentation, retail and banking applications, etc. Within the domain itself,
according to the application usage context, they may have different functionalities.
Each embedded system is designed to serve the purpose of any one or a
combination of the following tasks:
Data collection/Storage/Representation
Data Communication
Data (signal) processing
Monitoring
Control
Application specific user interface
38
Data Collection/Storage/Representation
Embedded systems designed for the purpose of data collection
performs acquisition of data from the external world.
Data collection is usually done for storage, analysis, manipulation and
transmission.
The term “data” refers all kinds of information, such as text, voice,
image, video, electrical signals and any other measurable quantities.
Data can be either analog (continuous) or digital (discrete).
Embedded systems with analog data capturing techniques collect
data directly in the form of analog signal whereas embedded
systems with digital data collection mechanism converts the analog
signal to the digital signal using analog to digital (A/D) converters
and then collects the binary equivalent of the analog data.
39
Data Collection/Storage/Representation (Cont’d)
Analog and digital CROs without storage memory are typical examples
of this. Any measuring equipment used in the medical domain for
monitoring without storage functionality also comes under this
category.
A digital camera is a typical example of an embedded system with data
collection/storage/representation of data. Images are captured and the
captured image may be stored within the memory of the camera.
The captured image can also be presented to the user through a graphic
LCD unit.
41
Data Communication
Embedded data communication systems are deployed in applications from
complex satellite communication systems to simple home networking
systems.
The data collected by an embedded terminal may require transferring of the
same to some other system located remotely.
The transmission is achieved either by a wire-line medium or by a wire-less
medium.
Wire-line medium was the most common choice in all olden days embedded
systems.
As technology is changing, wireless medium is becoming the standard
for data communication in embedded systems. It offers cheaper connectivity
solutions and make the communication link free from the hassle of wire
bundles.
42
Data Communication (Cont’d)
The data collecting embedded terminal itself can incorporate data
communication units like Wireless modules (Bluetooth, ZigBee, Wi-Fi,
EDGE, GPRS, etc.) or wire-line modules (RS-232C, USB, TCP/IP, PS2,etc).
Certain embedded systems act as a dedicated transmission unit between
the sending and receiving terminals, offering sophisticated functionalities like
43
Data (Signal) Processing
The data (voice, image, video, electrical signals and other measurable
quantities) collected by embedded systems may be used for various kinds of
data processing.
Embedded systems with signal processing functionalities are employed in
applications demanding signal
processing like speech coding, synthesis, audio video codec, transmission
applications, etc.
A digital hearing aid is a typical example of an embedded system employing
data processing. Digital hearing aid improves the hearing capacity of hearing
impaired persons.
44
Monitoring
Almost all embedded products coming under the medical domain are with
monitoring functions only.
They are used for determining the state of some variables using input
sensors. They cannot impose control over variables.
A very good example is the electro cardiogram (ECG) machine for monitoring
the heartbeat of a patient. The machine is intended to do the monitoring of the
heartbeat of a patient but it cannot impose control over the heartbeat. The sensors
used in ECG are the different electrodes connected to the patient’s body.
Other examples with monitoring function are measuring instruments like digital
CRO, digital multimeters, logic analyzers., etc. used in control &
instrumentation applications. They are used for knowing (monitoring) the
status of some variables like current, voltage, etc. They cannot control the
variables in turn.
45
Control
Embedded systems with control functionalities impose control over some
variables according to the changes in input variables.
A system with control functionality contains both sensors and actuators.
Sensors are connected to the input port for capturing the changes in
environmental variable or measuring variable.
The actuators connected to the output port are controlled according to the
changes in the input variable to
• put an impact on the controlling variable to bring the controlled variable to the
specified range.
Air conditioner system used in our home to control the room temperature
to a specified limit is a typical example for embedded system for control
purpose. An air conditioner contains a room temperature sensing element
(sensor) which may be thermistor and a handheld unit for setting up
(feeding) the desired temperature.
46
Control (Cont’d)
The handheld unit may be connected to the central embedded unit
residing inside the air conditioner through a wireless link or through a
wired link.
The air compressor unit acts as the actuator. The compressor is
controlled according to the current room temperature and the desired
temperature set by the end user.
The input variable is the current room temperature and the controlled
variable is also the room temperature. The controlling variable is cool
air flow by the compressor unit.
If the controlled variable and input variable are not at the same
value, the controlling variable tries to equalize them through taking
actions on the cool air flow.
47
Applications specific user interface
Buttons, switches, keypad, lights, speakers, display units, etc. are
application-specific user interfaces.
Mobile phone is an example of application specific user interface. In
mobile phone, the user interface is provided through the keypad,
graphic LCD module, system speaker, vibration alert, etc.
48
Characteristics and Quality Attributes of
Embedded Systems
• CHARACTERISTICS OF EMBEDDED SYSTEM
Following are some of the characteristics of an embedded system
that make it different from a general purpose computer:
1. Application and Domain Specific
2. Reactive and Real Time
3. Operation in Harsh Environment
4. Distributed
5. Small Size and Weight
6. Power Concerns
49
Application and Domain Specific
50
Reactive and Real Time
51
Operation in Harsh Environment
52
Distributed
53
Small Size and Weight
55
Characteristics and Quality Attributes of
Embedded Systems
• QUALITY ATTRIBUTES OF EMBEDDED
SYSTEMS
These are the attributes that together form the
deciding factor about the quality of an embedded
system.
There are two types of quality attributes are:
1. Operational Quality Attributes.
2. Non-Operational Quality Attributes.
56
Operational Quality Attributes
These are attributes related to operation or functioning
of an embedded system. The way an embedded system
operates affects its overall quality.
1. Response
2. Throughput
3. Reliability
4. Maintainability
5. Security
6. Safety
57
Response
Response is a measure of quickness of the system.
58
Throughput
59
Reliability
Mean Time between failures and Mean Time To Repair are terms
used in defining system reliability.
60
Maintainability
Maintainability deals with support and maintenance to the end user or a client in
case of technical issues and product failures or on the basis of a routine system
checkup
62
Safety
It deals with how easily one can test his/her design,
application and by which mean he/she can test it.
66
Portability
67
Time to Prototype and Market
68
Per Unit and Total Cost
When the product is introduced in the market, for the initial period
the sales and revenue will be low
During the maturing phase, the growth will be steady and revenue
reaches highest point and at retirement time there will be a drop in
sales volume.
69
Review Questions I
1. What is an embedded system? Explain the different applications of
embedded systems.
2. Difference between embedded systems and general computing
systems.
3. Describe the various purposes of embedded systems. Explain
any two in detail with illustrative examples.
4. Explain the characteristics of an embedded system.
5. Explain the Operational Quality Attributes of an embedded system
6. Explain the non quality attributes of an embedded system
70