SlideShare a Scribd company logo
1 of 55
RMK COLLEGE OF ENGINEERING AND
TECHNOLOGY
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING
Ms. S. Rajalakshmi
EMBEDDED AND REAL TIME
SYSTEM
Unit- 5
PROCESSES AND
OPERATING
SYSTEMS
1. Introduction
2. Multiple tasks and multiple processes,
Multirate systems
3. Pre-emptive Real time operating systems
4. Priority based Scheduling
5. Interprocess Communication
mechanisms
6. Evaluating Operating system
performance
7. Power optimization strategies for
processes
8. Example Real Time Operating System
(POSIX – Windows CE)
9. Distributed embedded systems
10. MPSoCs and shared memory
multiprocessors
11. Design Example – Audio player
12. Design Example – Engine control unit
13. Design Example – Video accelerator
5. INTER PROCESS COMMUNICATION
Communication between various processes within the system .
Operating system provides mechanism for Inter process communication .
Two ways of communication
1. Blocking – Process waits until it receives a response
2. Non-blocking – Process continues its execution after
sending the message.
(i) Shared memory
(ii) Message passing.
(iii)Signals
(iv)Mailboxes
Techniques in Inter Process
Communication
(i) Shared memory
 Using bus-based system
 CPU and I/O device can communicate through a shared memory location
 Address of the shared location is known by the software on the CPU and they also loaded into the proper
register of the I/O device
Text Compressor
(ii) Message passing.
 Each communication devices have their own send/receive unit
 Message is stored on the senders/ receivers end points not in communication link
(iii) Signals
A signal is generated by a process and transmitted to
another process by the operating system.
(iv) Mailboxes
 Simple mechanism for asynchronous communication.
 Some architectures define mailbox registers with a fixed number of bits and can be used for small
messages.
 simple version of a mailbox holds only one message at a time.
 Mailbox contains the message and a mail ready flag. The flag is true when a message has been put into
the mailbox and cleared when the message is removed
6. EVALUATING OPERATING SYSTEM PERFORMANCE
Factors that affect the Operating system performance,
 The execution time of the scheduler can be affected by coding practice.
 The Choice of scheduling policy affects the time required by the scheduler to determine the next process
to run.
(i) Context Switching Time
(ii) Interrupt Latency
(iii) Critical Sections and Interrupt Latency
(iv) Interrupt priorities and interrupt latency
(i) Context Switching Time
Context switching time depends on several factors
 The amount of CPU context that must be saved
 Scheduler execution time
(ii) Interrupt Latency
Duration of time from the assertion of a device
interrupt to the completion of the device’s requested
operation
The RTOS can delay the execution of an interrupt
handler in two ways,
(i) Critical sections in the kernel will prevent the
RTOS from taking interrupts.
(ii) Higher-priority interrupt may delay a lower-
priority interrupt.
(iii) Critical Sections and Interrupt Latency
code segment where the shared variables can be accessed
(iv) Interrupt priorities and interrupt
latency
RTOS Performance evaluation tools
Windows CE,
ILTiming, an instrumentation routine in the kernel that
measures both interrupt service routine and interrupt
service thread latency
OSBench - measures the timing of operating system tasks
such as critical section access, signals, and so on
Kernel Tracker - provides a graphical user interface for RTOS
events
7. POWER OPTIMIZATION STRATEGIES FOR PROCESSES
Strategy for determining when to perform certain power management operations.
There are two modes; Power –up and power-down.
(i) Predictive Shutdown
Goal is to predict when the next request will be made and to start the system just before that time, saving the requestor the start-
up time
Technique 1
If the system does not receive inputs during an interval of
length Ton, it shuts down. A powered-down system waits
for a period Toff before returning to the power-on mode.
Technique 2
(ii) Advanced Configuration and Power Interface (ACPI)
Open industry standard for power management services.
Targeted initially to PCs but designed compatible with a wide variety of operating systems.
8. DISTRIBUTED EMBEDDED SYSTEMS
Processing Element (PE)
Unit which is responsible for the computation within the microprocessor system is termed as processing
element.
A PE may be an instruction set processor such as a DSP, CPU, or microcontroller, as well as a nonprogrammable
unit such as the ASICs or an I/O device.
Network
Group of two or more computer systems liked together
Categories of Multiprocessors
I. Shared memory systems
II. Message passing systems
(i) Network abstractions (ii) CAN Bus
Physical Layer
Data frame
CAN is a multi-master message broadcast system
When RTR = 0, request data
from the device specified by the
identifier.
When RTR = 1, write data to
the destination identifier.
CAN controller Architecture
Bus Arbitration
Carrier Sense Multiple Access with Arbitration on Message Priority (CSMA/AMP).
Electrical interface to the I2C bus
Bus transaction
 0 for writing from the master to the slave.
 1 for reading from the slave to the master.
Typical bus transactions on the I2C bus.
(iii) I2C bus (Inter-Integrated Circuit)
I2C is a synchronous, multi-master, multi-slave, packet switched
An I2C interface in a microcontroller
(iv) Ethernet
Bus Arbitration
Carrier Sense Multiple Access with Collision Detection (CSMA/CD).
Ethernet packet format
(v) Internet
(vi) Transmission Control Protocol (TCP)
9. MPSoCs and shared memory multiprocessors
Accelerators
One important category of processing element for embedded multiprocessors is the accelerator.
can provide large performance increases for applications with computational kernels that spend a great deal
of time in a small section of code
Accelerator System Design
Accelerator performance analysis
The speedup factor depends in part on
whether the system is,
 Single threaded and Multithreaded
 Blocking vs nonblocking
Accelerator execution time
taccel = tin + tx + tout
10. DESIGN EXAMPLE: AUDIO PLAYER
Audio players are also called as MP3 players.
The earliest portable MP3 players were based on compact disc mechanisms. Modern MP3 players use either
flash memory or disk drives to store music.
An MP3 player performs three basic functions,
 Audio storage
 Audio decompression
 User interface
1. Requirement
2. Specification
Classes in the audio player
State diagram for file display and selection.
State diagram for audio playback.
3. Architecture
Cirrus CS7410 is an audio controller designed for CD/MP3 players
The audio controller includes two processors,
•32-bit RISC processor
•16-bit DSP
The memory controller can be interfaced to
several different types of memory
•Flash memory
•DRAM
The audio interface unit puts out audio in
formats that can be used by A/D converters.
General- purpose I/O pins can be used to
decode buttons, run displays, etc.
Architecture of a Cirrus audio processor for CD/MP3 players.
4. Component design
The most challenging part of system integration and
debugging is ensuring that audio plays smoothly and
without interruption.
5. System testing
 The file system can either implement a known standard such as DOS FAT or can implement a new file system.
 While a nonstandard file system may be easier to implement on the device, it also requires software to create the file
system.
 The audio output system should be tested separately from the compression system. Testing of audio decompression
requires sample audio files
11. DESIGN EXAMPLE: ENGINE CONTROL UNIT
The throttle is the command input.
The engine measures throttle, RPM, intake air
volume, and other variables.
The engine controller computes injector pulse
width and spark.
1. Requirement
2. Specification
3. Architecture
Class diagram for the engine controller.
4. Component design and testing
Any testing performed on an actual engine must be
conducted using an engine controller that has been
designed to withstand the harsh environment of the engine
compartment.
5. System integration and testing
 The RTOS initialization phase is used to set up the task periods.
 Because some of the output variables depend on changes in state, these tasks should be tested with multiple input
variable sequences to ensure that both the basic and adjustment calculations are performed correctly.
12. DESIGN EXAMPLE: VIDEO ACCELERATOR
A video accelerator is a video card with integrated processor and memory to increase the overall
capabilities of video graphics
Concentrates on motion estimation accelerator
Motion estimation accelerator
Process of determining the motion vector that describe the
transformation from one 2D image to the another.
Concept of Block motion Estimation
1. Requirement
2. Specification
3. Architecture
Object diagram for the video accelerator
4. Component design
Testing video algorithms requires a large amount of data
As the design is only a motion estimation it is probably
easiest to use images, not video for test data.
Open source for JPEG encoders and decoders is available.
These programs can be modified to read JPEG images and
put out pixels in the format required by your accelerator
5. System testing
 Uses a standard FPGA accelerator board to implement the accelerator
 If designing own accelerator board, it is compulsory to design both the video accelerator design and the interface to the PCI
bus
 video accelerator architecture can be created and exercised in a hardware description language like VHDL or Verilog
13.(A) Example Real Time Operating System (Windows CE)
Windows CE is an operating system developed by Microsoft and designed for small footprint devices
or embedded systems.
supports devices such as smartphones, electronic instruments, etc.
designed to run on multiple hardware platforms and instruction set architectures.
WinCE Architecture
WinCE layer diagram
OAL (OEM Adaption Layer )Architecture
WinCE Memory space
User address space in Windows CE.
 The top 1 GB is reserved for system elements such as DLLs (Dynamic-link library),
memory mapped files, and shared system heap.
 The bottom 1 GB holds user elements such as code, data, stack, and heap.
WinCE interrupts
1. Interrupt service handler (ISH) - Kernel service that provides the first response to the interrupt.
2. Interrupt service routine (ISR) - ISH selects an interrupt service routine (ISR) to handle the interrupt.
The ISH runs in the kernel with interrupts turned off; as a result, it should be designed to do as little direct work as
possible.
3. Interrupt service thread (IST) - performs most of the work required to handle the interrupt.
The IST runs in the OAL and so can be interrupted by a higher-priority interrupt.
13.(B) Example Real Time Operating System (POSIX)
POSIX is a version of the Unix operating system created by a standards organization.
Unix was not originally designed as a real-time operating system; POSIX has been extended to support Realtime
requirements.
1. Processes in POSIX
(i) fork ( ) function
A process makes a copy of itself by calling the fork ( ) function.
That function causes the operating system to create a new process (the child process) which is a
nearly exact copy of the process that called fork ( ) (the parent process).
They both share the same code and the same data values with one exception, the return value
of fork ( ): the parent process is returned the process ID number of the child process, while the
child process gets a return value of 0.
childid = fork ( );
if (childid == 0) { /* must be the child */
/* do child process here */
}
(ii) execv ( ) function
used to overlay the child process with the appropriate code
childid = fork ( );
if (childid == 0) { /* must be the child */
execv(“mychild”, childargs);
exit(1);
}
The execv ( ) function takes as argument the name of the file that
holds the child’s code and the array of arguments.
It overlays the process with the new code and starts executing it
from the main ( ) function.
(iii) exit ( ) function
The exit() function is a C
function that is used to leave a
process
The parent process should use one of the POSIX wait functions before calling
exit() for itself.
The wait functions returns the child process’s status, they also make sure that the
child’s resources (namely memory) are free.
childid = fork ( );
if (childid == 0) { /* must be the child */
execv(“mychild”,childargs);
perror(“execl”);
exit(1);
}
else { /* is the parent */
parent_stuff(); /* execute parent functionality */
wait(&cstatus);
exit(0);
}
(iv) wait ( ) function
(v) parent_stuff ( )
The parent_stuff ( ) function performs the work of the
parent function.
2. Real time scheduling in POSIX
(i) sched_setscheduler() function
(ii) SCHED_FIFO policy
#include <sched.h>
int i, my_process_id;
struct sched_param my_sched_params;
…
i = sched_setscheduler(my_process_id,SCHED_FIFO,&sched_params);
Two other useful functions allow a process to determine the minimum and maximum priority values in
the system:
minval = sched_get_priority_min(SCHED_RR);
maxval = sched_get_priority_max(SCHED_RR);
(iii) sched_getparams ( )
The sched_getparams ( ) function returns the current parameter values for a process.
(iv) sched_setparams ( )
sched_setparams ( ) changes the parameter values
(v) sched_yield() function
Whenever a process changes its priority, it is put at the back of the
queue for that
priority level.
A process can also explicitly move itself to the end of its priority queue
with a call to the sched_yield() function.
3. POSIX Pipes
(i) pipe ( ) function
A parent process uses the
pipe ( ) function to create a
pipe to talk to a child.
It must do so before the
child itself is created.
if (pipe(pipe_ends) < 0) { /* create the pipe, check for errors */
perror(“pipe”);
break;
}
/* create the process */
childid = fork();
if (childid == 0) { /* the child reads from pipe_ends[1]*/
childargs[0] = pipe_ends[1];
/* pass the read end descriptor to the new incarnation of child */
execv(“mychild”,childargs);
perror(“execv”);
exit(1);
}
else { /* the parent writes to pipe_ends[0] */
}
4. POSIX message passing
POSIX also supports message queues under the _POSIX_MESSAGE_PASSING facility.
The advantage of a queue over a pipe is that, because queues have names, we don’t have to create the pipe
descriptor before creating the other process using it.
The name of a starts with a “/”,
(i) myq
The queue descriptor myq is used to enqueue and
dequeue messages.
(ii) MQ_PRIO_MAX
Messages can be prioritized, with a priority value
between 0 and MQ_PRIO_MAX (there are at least 32
priorities available).
(iii) mq_close ( )
When a process is done with a queue, it calls mq_close (
).
i = mq_close(myq);
THANK YOU

More Related Content

What's hot

Embedded firmware
Embedded firmwareEmbedded firmware
Embedded firmwareJoel P
 
Two cavity klystron
Two cavity klystronTwo cavity klystron
Two cavity klystronabhikalmegh
 
2.3 time division multiple access
2.3   time division multiple access2.3   time division multiple access
2.3 time division multiple accessJAIGANESH SEKAR
 
Communication Interface of The Embedded Systems
Communication Interface of The Embedded Systems Communication Interface of The Embedded Systems
Communication Interface of The Embedded Systems VijayKumar5738
 
Pipelining approach
Pipelining approachPipelining approach
Pipelining approachGopinathD17
 
DSP architecture
DSP architectureDSP architecture
DSP architecturejstripinis
 
Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051hello_priti
 
EDLC-EMBEDDED PRODUCT DEVELOPMENT LIFE CYCLE
EDLC-EMBEDDED PRODUCT DEVELOPMENT LIFE CYCLEEDLC-EMBEDDED PRODUCT DEVELOPMENT LIFE CYCLE
EDLC-EMBEDDED PRODUCT DEVELOPMENT LIFE CYCLESabeel Irshad
 
Embedded system design process
Embedded system design processEmbedded system design process
Embedded system design processRayees CK
 
8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil KawareProf. Swapnil V. Kaware
 
Sensor interfacing in 8051
Sensor interfacing in 8051Sensor interfacing in 8051
Sensor interfacing in 8051Irfan Ahmad
 

What's hot (20)

Embedded firmware
Embedded firmwareEmbedded firmware
Embedded firmware
 
Arm instruction set
Arm instruction setArm instruction set
Arm instruction set
 
Two cavity klystron
Two cavity klystronTwo cavity klystron
Two cavity klystron
 
E.s unit 4 and 5
E.s unit 4 and 5E.s unit 4 and 5
E.s unit 4 and 5
 
2.3 time division multiple access
2.3   time division multiple access2.3   time division multiple access
2.3 time division multiple access
 
Communication Interface of The Embedded Systems
Communication Interface of The Embedded Systems Communication Interface of The Embedded Systems
Communication Interface of The Embedded Systems
 
Pipelining approach
Pipelining approachPipelining approach
Pipelining approach
 
DSP architecture
DSP architectureDSP architecture
DSP architecture
 
Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051
 
ARM Processor
ARM ProcessorARM Processor
ARM Processor
 
TMS320C5x
TMS320C5xTMS320C5x
TMS320C5x
 
EDLC-EMBEDDED PRODUCT DEVELOPMENT LIFE CYCLE
EDLC-EMBEDDED PRODUCT DEVELOPMENT LIFE CYCLEEDLC-EMBEDDED PRODUCT DEVELOPMENT LIFE CYCLE
EDLC-EMBEDDED PRODUCT DEVELOPMENT LIFE CYCLE
 
8051 memory
8051 memory8051 memory
8051 memory
 
Embedded system design process
Embedded system design processEmbedded system design process
Embedded system design process
 
FPGA
FPGAFPGA
FPGA
 
Ec8791 arm 9 processor
Ec8791 arm 9 processorEc8791 arm 9 processor
Ec8791 arm 9 processor
 
Estimating program run time
Estimating program run timeEstimating program run time
Estimating program run time
 
Communication protocols
Communication protocolsCommunication protocols
Communication protocols
 
8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware8051 Microcontroller PPT's By Er. Swapnil Kaware
8051 Microcontroller PPT's By Er. Swapnil Kaware
 
Sensor interfacing in 8051
Sensor interfacing in 8051Sensor interfacing in 8051
Sensor interfacing in 8051
 

Similar to RMK College ECE Dept Embedded Systems Processes and OS

Introduction to embedded System.pptx
Introduction to embedded System.pptxIntroduction to embedded System.pptx
Introduction to embedded System.pptxPratik Gohel
 
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT I Core of Embedded Systems
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT I   Core of Embedded SystemsSYBSC IT SEM IV EMBEDDED SYSTEMS UNIT I   Core of Embedded Systems
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT I Core of Embedded SystemsArti Parab Academics
 
UNIT 1 SONCA.pptx
UNIT 1 SONCA.pptxUNIT 1 SONCA.pptx
UNIT 1 SONCA.pptxmohan134666
 
System_on_Chip_SOC.ppt
System_on_Chip_SOC.pptSystem_on_Chip_SOC.ppt
System_on_Chip_SOC.pptzahixdd
 
Avionics Paperdoc
Avionics PaperdocAvionics Paperdoc
Avionics PaperdocFalascoj
 
Microprocessor & microcontroller
Microprocessor & microcontroller Microprocessor & microcontroller
Microprocessor & microcontroller Nitesh Kumar
 
A NETWORK-BASED DAC OPTIMIZATION PROTOTYPE SOFTWARE 2 (1).pdf
A NETWORK-BASED DAC OPTIMIZATION PROTOTYPE SOFTWARE 2 (1).pdfA NETWORK-BASED DAC OPTIMIZATION PROTOTYPE SOFTWARE 2 (1).pdf
A NETWORK-BASED DAC OPTIMIZATION PROTOTYPE SOFTWARE 2 (1).pdfSaiReddy794166
 
Performance of State-of-the-Art Cryptography on ARM-based Microprocessors
Performance of State-of-the-Art Cryptography on ARM-based MicroprocessorsPerformance of State-of-the-Art Cryptography on ARM-based Microprocessors
Performance of State-of-the-Art Cryptography on ARM-based MicroprocessorsHannes Tschofenig
 
Embedded systems notes
Embedded systems notesEmbedded systems notes
Embedded systems notesShikha Sharma
 
Embedded os
Embedded osEmbedded os
Embedded oschian417
 
Project report on embedded system using 8051 microcontroller
Project  report on embedded system using 8051 microcontrollerProject  report on embedded system using 8051 microcontroller
Project report on embedded system using 8051 microcontrollerVandna Sambyal
 
UNIT I_Introduction.pptx
UNIT I_Introduction.pptxUNIT I_Introduction.pptx
UNIT I_Introduction.pptxssuser4ca1eb
 
microprocessormicrocontrollerbysanat-140107013112-phpapp02.pdf
microprocessormicrocontrollerbysanat-140107013112-phpapp02.pdfmicroprocessormicrocontrollerbysanat-140107013112-phpapp02.pdf
microprocessormicrocontrollerbysanat-140107013112-phpapp02.pdfMECHANICALENGINEERIN19
 

Similar to RMK College ECE Dept Embedded Systems Processes and OS (20)

EC8791-U5-PPT.pptx
EC8791-U5-PPT.pptxEC8791-U5-PPT.pptx
EC8791-U5-PPT.pptx
 
Introduction to embedded System.pptx
Introduction to embedded System.pptxIntroduction to embedded System.pptx
Introduction to embedded System.pptx
 
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT I Core of Embedded Systems
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT I   Core of Embedded SystemsSYBSC IT SEM IV EMBEDDED SYSTEMS UNIT I   Core of Embedded Systems
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT I Core of Embedded Systems
 
UNIT 1 SONCA.pptx
UNIT 1 SONCA.pptxUNIT 1 SONCA.pptx
UNIT 1 SONCA.pptx
 
System_on_Chip_SOC.ppt
System_on_Chip_SOC.pptSystem_on_Chip_SOC.ppt
System_on_Chip_SOC.ppt
 
Avionics Paperdoc
Avionics PaperdocAvionics Paperdoc
Avionics Paperdoc
 
Embedded system
Embedded systemEmbedded system
Embedded system
 
Embeddedsystem
EmbeddedsystemEmbeddedsystem
Embeddedsystem
 
Embedded systems
Embedded systemsEmbedded systems
Embedded systems
 
Microprocessor & microcontroller
Microprocessor & microcontroller Microprocessor & microcontroller
Microprocessor & microcontroller
 
A NETWORK-BASED DAC OPTIMIZATION PROTOTYPE SOFTWARE 2 (1).pdf
A NETWORK-BASED DAC OPTIMIZATION PROTOTYPE SOFTWARE 2 (1).pdfA NETWORK-BASED DAC OPTIMIZATION PROTOTYPE SOFTWARE 2 (1).pdf
A NETWORK-BASED DAC OPTIMIZATION PROTOTYPE SOFTWARE 2 (1).pdf
 
Performance of State-of-the-Art Cryptography on ARM-based Microprocessors
Performance of State-of-the-Art Cryptography on ARM-based MicroprocessorsPerformance of State-of-the-Art Cryptography on ARM-based Microprocessors
Performance of State-of-the-Art Cryptography on ARM-based Microprocessors
 
Embedded systems notes
Embedded systems notesEmbedded systems notes
Embedded systems notes
 
Embedded os
Embedded osEmbedded os
Embedded os
 
Project report on embedded system using 8051 microcontroller
Project  report on embedded system using 8051 microcontrollerProject  report on embedded system using 8051 microcontroller
Project report on embedded system using 8051 microcontroller
 
EE8691 – EMBEDDED SYSTEMS.pptx
EE8691 – EMBEDDED SYSTEMS.pptxEE8691 – EMBEDDED SYSTEMS.pptx
EE8691 – EMBEDDED SYSTEMS.pptx
 
UNIT I.pptx
UNIT I.pptxUNIT I.pptx
UNIT I.pptx
 
Ijetr042175
Ijetr042175Ijetr042175
Ijetr042175
 
UNIT I_Introduction.pptx
UNIT I_Introduction.pptxUNIT I_Introduction.pptx
UNIT I_Introduction.pptx
 
microprocessormicrocontrollerbysanat-140107013112-phpapp02.pdf
microprocessormicrocontrollerbysanat-140107013112-phpapp02.pdfmicroprocessormicrocontrollerbysanat-140107013112-phpapp02.pdf
microprocessormicrocontrollerbysanat-140107013112-phpapp02.pdf
 

More from RajalakshmiSermadurai

More from RajalakshmiSermadurai (13)

Ec8791 lpc2148 pwm
Ec8791 lpc2148 pwmEc8791 lpc2148 pwm
Ec8791 lpc2148 pwm
 
Ec8791 lpc2148 uart
Ec8791 lpc2148 uartEc8791 lpc2148 uart
Ec8791 lpc2148 uart
 
Ec8791 lpc2148
Ec8791 lpc2148Ec8791 lpc2148
Ec8791 lpc2148
 
Ec8791 lpc2148 timer unit
Ec8791 lpc2148 timer unitEc8791 lpc2148 timer unit
Ec8791 lpc2148 timer unit
 
EC8791 consumer electronics-platform level performance analysis
EC8791 consumer electronics-platform level performance analysisEC8791 consumer electronics-platform level performance analysis
EC8791 consumer electronics-platform level performance analysis
 
EC8791 designing with computing platform
EC8791 designing with computing platformEC8791 designing with computing platform
EC8791 designing with computing platform
 
EC8791 Design Methodologies
EC8791 Design MethodologiesEC8791 Design Methodologies
EC8791 Design Methodologies
 
EC8791 Requirement-Specifications-Quality assurance techniques
EC8791 Requirement-Specifications-Quality assurance techniquesEC8791 Requirement-Specifications-Quality assurance techniques
EC8791 Requirement-Specifications-Quality assurance techniques
 
EC8791 UML-model train controller
EC8791 UML-model train controllerEC8791 UML-model train controller
EC8791 UML-model train controller
 
Introduction and structure of a real time system
Introduction and structure of a real time systemIntroduction and structure of a real time system
Introduction and structure of a real time system
 
Embedded system design process
Embedded system design processEmbedded system design process
Embedded system design process
 
Embedded system introduction
Embedded system introductionEmbedded system introduction
Embedded system introduction
 
EC6703 unit-4
EC6703 unit-4EC6703 unit-4
EC6703 unit-4
 

Recently uploaded

IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixingviprabot1
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture designssuser87fa0c1
 

Recently uploaded (20)

IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Effects of rheological properties on mixing
Effects of rheological properties on mixingEffects of rheological properties on mixing
Effects of rheological properties on mixing
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
pipeline in computer architecture design
pipeline in computer architecture  designpipeline in computer architecture  design
pipeline in computer architecture design
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 

RMK College ECE Dept Embedded Systems Processes and OS

  • 1. RMK COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING Ms. S. Rajalakshmi EMBEDDED AND REAL TIME SYSTEM
  • 2. Unit- 5 PROCESSES AND OPERATING SYSTEMS 1. Introduction 2. Multiple tasks and multiple processes, Multirate systems 3. Pre-emptive Real time operating systems 4. Priority based Scheduling 5. Interprocess Communication mechanisms 6. Evaluating Operating system performance 7. Power optimization strategies for processes 8. Example Real Time Operating System (POSIX – Windows CE) 9. Distributed embedded systems 10. MPSoCs and shared memory multiprocessors 11. Design Example – Audio player 12. Design Example – Engine control unit 13. Design Example – Video accelerator
  • 3. 5. INTER PROCESS COMMUNICATION Communication between various processes within the system . Operating system provides mechanism for Inter process communication . Two ways of communication 1. Blocking – Process waits until it receives a response 2. Non-blocking – Process continues its execution after sending the message. (i) Shared memory (ii) Message passing. (iii)Signals (iv)Mailboxes Techniques in Inter Process Communication
  • 4. (i) Shared memory  Using bus-based system  CPU and I/O device can communicate through a shared memory location  Address of the shared location is known by the software on the CPU and they also loaded into the proper register of the I/O device Text Compressor
  • 5. (ii) Message passing.  Each communication devices have their own send/receive unit  Message is stored on the senders/ receivers end points not in communication link (iii) Signals A signal is generated by a process and transmitted to another process by the operating system.
  • 6. (iv) Mailboxes  Simple mechanism for asynchronous communication.  Some architectures define mailbox registers with a fixed number of bits and can be used for small messages.  simple version of a mailbox holds only one message at a time.  Mailbox contains the message and a mail ready flag. The flag is true when a message has been put into the mailbox and cleared when the message is removed
  • 7. 6. EVALUATING OPERATING SYSTEM PERFORMANCE Factors that affect the Operating system performance,  The execution time of the scheduler can be affected by coding practice.  The Choice of scheduling policy affects the time required by the scheduler to determine the next process to run. (i) Context Switching Time (ii) Interrupt Latency (iii) Critical Sections and Interrupt Latency (iv) Interrupt priorities and interrupt latency
  • 8. (i) Context Switching Time Context switching time depends on several factors  The amount of CPU context that must be saved  Scheduler execution time (ii) Interrupt Latency Duration of time from the assertion of a device interrupt to the completion of the device’s requested operation The RTOS can delay the execution of an interrupt handler in two ways, (i) Critical sections in the kernel will prevent the RTOS from taking interrupts. (ii) Higher-priority interrupt may delay a lower- priority interrupt.
  • 9. (iii) Critical Sections and Interrupt Latency code segment where the shared variables can be accessed (iv) Interrupt priorities and interrupt latency RTOS Performance evaluation tools Windows CE, ILTiming, an instrumentation routine in the kernel that measures both interrupt service routine and interrupt service thread latency OSBench - measures the timing of operating system tasks such as critical section access, signals, and so on Kernel Tracker - provides a graphical user interface for RTOS events
  • 10. 7. POWER OPTIMIZATION STRATEGIES FOR PROCESSES Strategy for determining when to perform certain power management operations. There are two modes; Power –up and power-down. (i) Predictive Shutdown Goal is to predict when the next request will be made and to start the system just before that time, saving the requestor the start- up time Technique 1 If the system does not receive inputs during an interval of length Ton, it shuts down. A powered-down system waits for a period Toff before returning to the power-on mode.
  • 12. (ii) Advanced Configuration and Power Interface (ACPI) Open industry standard for power management services. Targeted initially to PCs but designed compatible with a wide variety of operating systems.
  • 13. 8. DISTRIBUTED EMBEDDED SYSTEMS Processing Element (PE) Unit which is responsible for the computation within the microprocessor system is termed as processing element. A PE may be an instruction set processor such as a DSP, CPU, or microcontroller, as well as a nonprogrammable unit such as the ASICs or an I/O device. Network Group of two or more computer systems liked together
  • 14. Categories of Multiprocessors I. Shared memory systems II. Message passing systems
  • 15. (i) Network abstractions (ii) CAN Bus Physical Layer Data frame CAN is a multi-master message broadcast system When RTR = 0, request data from the device specified by the identifier. When RTR = 1, write data to the destination identifier.
  • 16. CAN controller Architecture Bus Arbitration Carrier Sense Multiple Access with Arbitration on Message Priority (CSMA/AMP).
  • 17. Electrical interface to the I2C bus Bus transaction  0 for writing from the master to the slave.  1 for reading from the slave to the master. Typical bus transactions on the I2C bus. (iii) I2C bus (Inter-Integrated Circuit) I2C is a synchronous, multi-master, multi-slave, packet switched
  • 18. An I2C interface in a microcontroller (iv) Ethernet
  • 19. Bus Arbitration Carrier Sense Multiple Access with Collision Detection (CSMA/CD). Ethernet packet format
  • 20. (v) Internet (vi) Transmission Control Protocol (TCP)
  • 21. 9. MPSoCs and shared memory multiprocessors Accelerators One important category of processing element for embedded multiprocessors is the accelerator. can provide large performance increases for applications with computational kernels that spend a great deal of time in a small section of code Accelerator System Design
  • 22. Accelerator performance analysis The speedup factor depends in part on whether the system is,  Single threaded and Multithreaded  Blocking vs nonblocking
  • 24. 10. DESIGN EXAMPLE: AUDIO PLAYER Audio players are also called as MP3 players. The earliest portable MP3 players were based on compact disc mechanisms. Modern MP3 players use either flash memory or disk drives to store music. An MP3 player performs three basic functions,  Audio storage  Audio decompression  User interface
  • 26. 2. Specification Classes in the audio player
  • 27. State diagram for file display and selection.
  • 28. State diagram for audio playback.
  • 29. 3. Architecture Cirrus CS7410 is an audio controller designed for CD/MP3 players The audio controller includes two processors, •32-bit RISC processor •16-bit DSP The memory controller can be interfaced to several different types of memory •Flash memory •DRAM The audio interface unit puts out audio in formats that can be used by A/D converters. General- purpose I/O pins can be used to decode buttons, run displays, etc. Architecture of a Cirrus audio processor for CD/MP3 players.
  • 30. 4. Component design The most challenging part of system integration and debugging is ensuring that audio plays smoothly and without interruption. 5. System testing  The file system can either implement a known standard such as DOS FAT or can implement a new file system.  While a nonstandard file system may be easier to implement on the device, it also requires software to create the file system.  The audio output system should be tested separately from the compression system. Testing of audio decompression requires sample audio files
  • 31. 11. DESIGN EXAMPLE: ENGINE CONTROL UNIT The throttle is the command input. The engine measures throttle, RPM, intake air volume, and other variables. The engine controller computes injector pulse width and spark.
  • 34. 3. Architecture Class diagram for the engine controller.
  • 35. 4. Component design and testing Any testing performed on an actual engine must be conducted using an engine controller that has been designed to withstand the harsh environment of the engine compartment. 5. System integration and testing  The RTOS initialization phase is used to set up the task periods.  Because some of the output variables depend on changes in state, these tasks should be tested with multiple input variable sequences to ensure that both the basic and adjustment calculations are performed correctly.
  • 36. 12. DESIGN EXAMPLE: VIDEO ACCELERATOR A video accelerator is a video card with integrated processor and memory to increase the overall capabilities of video graphics Concentrates on motion estimation accelerator Motion estimation accelerator Process of determining the motion vector that describe the transformation from one 2D image to the another.
  • 37. Concept of Block motion Estimation
  • 41. Object diagram for the video accelerator
  • 42. 4. Component design Testing video algorithms requires a large amount of data As the design is only a motion estimation it is probably easiest to use images, not video for test data. Open source for JPEG encoders and decoders is available. These programs can be modified to read JPEG images and put out pixels in the format required by your accelerator 5. System testing  Uses a standard FPGA accelerator board to implement the accelerator  If designing own accelerator board, it is compulsory to design both the video accelerator design and the interface to the PCI bus  video accelerator architecture can be created and exercised in a hardware description language like VHDL or Verilog
  • 43. 13.(A) Example Real Time Operating System (Windows CE) Windows CE is an operating system developed by Microsoft and designed for small footprint devices or embedded systems. supports devices such as smartphones, electronic instruments, etc. designed to run on multiple hardware platforms and instruction set architectures. WinCE Architecture WinCE layer diagram
  • 44. OAL (OEM Adaption Layer )Architecture
  • 45. WinCE Memory space User address space in Windows CE.  The top 1 GB is reserved for system elements such as DLLs (Dynamic-link library), memory mapped files, and shared system heap.  The bottom 1 GB holds user elements such as code, data, stack, and heap.
  • 46. WinCE interrupts 1. Interrupt service handler (ISH) - Kernel service that provides the first response to the interrupt. 2. Interrupt service routine (ISR) - ISH selects an interrupt service routine (ISR) to handle the interrupt. The ISH runs in the kernel with interrupts turned off; as a result, it should be designed to do as little direct work as possible. 3. Interrupt service thread (IST) - performs most of the work required to handle the interrupt. The IST runs in the OAL and so can be interrupted by a higher-priority interrupt.
  • 47.
  • 48. 13.(B) Example Real Time Operating System (POSIX) POSIX is a version of the Unix operating system created by a standards organization. Unix was not originally designed as a real-time operating system; POSIX has been extended to support Realtime requirements. 1. Processes in POSIX (i) fork ( ) function A process makes a copy of itself by calling the fork ( ) function. That function causes the operating system to create a new process (the child process) which is a nearly exact copy of the process that called fork ( ) (the parent process). They both share the same code and the same data values with one exception, the return value of fork ( ): the parent process is returned the process ID number of the child process, while the child process gets a return value of 0.
  • 49. childid = fork ( ); if (childid == 0) { /* must be the child */ /* do child process here */ } (ii) execv ( ) function used to overlay the child process with the appropriate code childid = fork ( ); if (childid == 0) { /* must be the child */ execv(“mychild”, childargs); exit(1); } The execv ( ) function takes as argument the name of the file that holds the child’s code and the array of arguments. It overlays the process with the new code and starts executing it from the main ( ) function.
  • 50. (iii) exit ( ) function The exit() function is a C function that is used to leave a process The parent process should use one of the POSIX wait functions before calling exit() for itself. The wait functions returns the child process’s status, they also make sure that the child’s resources (namely memory) are free. childid = fork ( ); if (childid == 0) { /* must be the child */ execv(“mychild”,childargs); perror(“execl”); exit(1); } else { /* is the parent */ parent_stuff(); /* execute parent functionality */ wait(&cstatus); exit(0); } (iv) wait ( ) function (v) parent_stuff ( ) The parent_stuff ( ) function performs the work of the parent function.
  • 51. 2. Real time scheduling in POSIX (i) sched_setscheduler() function (ii) SCHED_FIFO policy #include <sched.h> int i, my_process_id; struct sched_param my_sched_params; … i = sched_setscheduler(my_process_id,SCHED_FIFO,&sched_params);
  • 52. Two other useful functions allow a process to determine the minimum and maximum priority values in the system: minval = sched_get_priority_min(SCHED_RR); maxval = sched_get_priority_max(SCHED_RR); (iii) sched_getparams ( ) The sched_getparams ( ) function returns the current parameter values for a process. (iv) sched_setparams ( ) sched_setparams ( ) changes the parameter values (v) sched_yield() function Whenever a process changes its priority, it is put at the back of the queue for that priority level. A process can also explicitly move itself to the end of its priority queue with a call to the sched_yield() function.
  • 53. 3. POSIX Pipes (i) pipe ( ) function A parent process uses the pipe ( ) function to create a pipe to talk to a child. It must do so before the child itself is created. if (pipe(pipe_ends) < 0) { /* create the pipe, check for errors */ perror(“pipe”); break; } /* create the process */ childid = fork(); if (childid == 0) { /* the child reads from pipe_ends[1]*/ childargs[0] = pipe_ends[1]; /* pass the read end descriptor to the new incarnation of child */ execv(“mychild”,childargs); perror(“execv”); exit(1); } else { /* the parent writes to pipe_ends[0] */ }
  • 54. 4. POSIX message passing POSIX also supports message queues under the _POSIX_MESSAGE_PASSING facility. The advantage of a queue over a pipe is that, because queues have names, we don’t have to create the pipe descriptor before creating the other process using it. The name of a starts with a “/”, (i) myq The queue descriptor myq is used to enqueue and dequeue messages. (ii) MQ_PRIO_MAX Messages can be prioritized, with a priority value between 0 and MQ_PRIO_MAX (there are at least 32 priorities available). (iii) mq_close ( ) When a process is done with a queue, it calls mq_close ( ). i = mq_close(myq);