SlideShare a Scribd company logo
1 of 58
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
Inter Process
Techniques in
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.
(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
There are two modes; Power –up and power-down.
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
A more advanced technique is based on amore thorough
Technique 1
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
Physical Layer
(ii) CAN Bus
CAN is a multi-master message broadcast system
Data frame
When RTR = 0, request data
from the device specified by the
identifier.
When RTR = 1, write data to
the destination identifier.
Bus Arbitration
Carrier Sense Multiple Access with Arbitration on Message Priority (CSMA/AMP).
CAN controllerArchitecture
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
Electrical interface to the I2C bus
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
Standard
i) Mpeg Layer 1 Encoder
i) Mpeg Layer 1 Decoder
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
5. System testing
The most challenging part of system integration and
debugging is ensuring that audio plays smoothly and
without interruption.
 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
• ECU is a generic term for any embedded
system that controls one or more of the
electrical system or subsystem in a motor
vehicle.
• ECU is a type of electronic control unit that
controls a series of actuators on a internal
combustion engine to ensure optimal
engine performance.
THEORY OF OPERATION:
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
 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.
5. System integration 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.
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
 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
5. System testing
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
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.
WinCEArchitecture
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

Similar to EC8791-U5-PPT.pptx

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
 
Unit 1 introduction to Operating System
Unit 1 introduction to Operating SystemUnit 1 introduction to Operating System
Unit 1 introduction to Operating Systemzahid7578
 
UNIT 1 SONCA.pptx
UNIT 1 SONCA.pptxUNIT 1 SONCA.pptx
UNIT 1 SONCA.pptxmohan134666
 
Chapter7_InputOutputStorageSystems.pptx
Chapter7_InputOutputStorageSystems.pptxChapter7_InputOutputStorageSystems.pptx
Chapter7_InputOutputStorageSystems.pptxJanethMedina31
 
Operating system notes ch1
Operating system notes ch1Operating system notes ch1
Operating system notes ch1Emmanuel Damka
 
Embedded systems 101 final
Embedded systems 101 finalEmbedded systems 101 final
Embedded systems 101 finalKhalid Elmeadawy
 
Embedded os
Embedded osEmbedded os
Embedded oschian417
 
Avionics Paperdoc
Avionics PaperdocAvionics Paperdoc
Avionics PaperdocFalascoj
 
microprocessormicrocontrollerbysanat-140107013112-phpapp02.pdf
microprocessormicrocontrollerbysanat-140107013112-phpapp02.pdfmicroprocessormicrocontrollerbysanat-140107013112-phpapp02.pdf
microprocessormicrocontrollerbysanat-140107013112-phpapp02.pdfMECHANICALENGINEERIN19
 
Operating Systems
Operating Systems Operating Systems
Operating Systems Fahad Shaikh
 
Procesamiento multinúcleo óptimo para aplicaciones críticas de seguridad
 Procesamiento multinúcleo óptimo para aplicaciones críticas de seguridad Procesamiento multinúcleo óptimo para aplicaciones críticas de seguridad
Procesamiento multinúcleo óptimo para aplicaciones críticas de seguridadMarketing Donalba
 
Embeddedsystem 110412132957-phpapp02
Embeddedsystem 110412132957-phpapp02Embeddedsystem 110412132957-phpapp02
Embeddedsystem 110412132957-phpapp02ishan111
 

Similar to EC8791-U5-PPT.pptx (20)

Unit 1 - Introduction
Unit 1 - IntroductionUnit 1 - Introduction
Unit 1 - Introduction
 
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
 
Unit 1 introduction to Operating System
Unit 1 introduction to Operating SystemUnit 1 introduction to Operating System
Unit 1 introduction to Operating System
 
UNIT 1 SONCA.pptx
UNIT 1 SONCA.pptxUNIT 1 SONCA.pptx
UNIT 1 SONCA.pptx
 
Embedded system
Embedded systemEmbedded system
Embedded system
 
Embeddedsystem
EmbeddedsystemEmbeddedsystem
Embeddedsystem
 
Chapter7_InputOutputStorageSystems.pptx
Chapter7_InputOutputStorageSystems.pptxChapter7_InputOutputStorageSystems.pptx
Chapter7_InputOutputStorageSystems.pptx
 
Operating system notes ch1
Operating system notes ch1Operating system notes ch1
Operating system notes ch1
 
Embedded systems 101 final
Embedded systems 101 finalEmbedded systems 101 final
Embedded systems 101 final
 
Embedded os
Embedded osEmbedded os
Embedded os
 
Avionics Paperdoc
Avionics PaperdocAvionics Paperdoc
Avionics Paperdoc
 
Matter new
Matter newMatter new
Matter new
 
microprocessormicrocontrollerbysanat-140107013112-phpapp02.pdf
microprocessormicrocontrollerbysanat-140107013112-phpapp02.pdfmicroprocessormicrocontrollerbysanat-140107013112-phpapp02.pdf
microprocessormicrocontrollerbysanat-140107013112-phpapp02.pdf
 
Operating Systems
Operating Systems Operating Systems
Operating Systems
 
ERTS_Unit 1_PPT.pdf
ERTS_Unit 1_PPT.pdfERTS_Unit 1_PPT.pdf
ERTS_Unit 1_PPT.pdf
 
Procesamiento multinúcleo óptimo para aplicaciones críticas de seguridad
 Procesamiento multinúcleo óptimo para aplicaciones críticas de seguridad Procesamiento multinúcleo óptimo para aplicaciones críticas de seguridad
Procesamiento multinúcleo óptimo para aplicaciones críticas de seguridad
 
UNIT I.pptx
UNIT I.pptxUNIT I.pptx
UNIT I.pptx
 
CH01.pdf
CH01.pdfCH01.pdf
CH01.pdf
 
Embeddedsystem 110412132957-phpapp02
Embeddedsystem 110412132957-phpapp02Embeddedsystem 110412132957-phpapp02
Embeddedsystem 110412132957-phpapp02
 
ch1.ppt
ch1.pptch1.ppt
ch1.ppt
 

Recently uploaded

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 

Recently uploaded (20)

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 

EC8791-U5-PPT.pptx

  • 1. 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
  • 2. 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 Inter Process Techniques in Communication
  • 3. (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
  • 4. (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.
  • 5. (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. 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
  • 7. (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.
  • 8. (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
  • 9. 7. POWER OPTIMIZATION STRATEGIES FOR PROCESSES Strategy for determining when to perform certain power management operations. (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 There are two modes; Power –up and power-down. 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 A more advanced technique is based on amore thorough
  • 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 Physical Layer (ii) CAN Bus CAN is a multi-master message broadcast system Data frame When RTR = 0, request data from the device specified by the identifier. When RTR = 1, write data to the destination identifier.
  • 16. Bus Arbitration Carrier Sense Multiple Access with Arbitration on Message Priority (CSMA/AMP). CAN controllerArchitecture
  • 17. 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 Electrical interface to the I2C bus
  • 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. i) Mpeg Layer 1 Encoder
  • 27. i) Mpeg Layer 1 Decoder
  • 29. 2. Specification Classes in the audio player
  • 30. State diagram for file display and selection.
  • 31. State diagram for audio playback.
  • 32. 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.
  • 33. 4. Component design 5. System testing The most challenging part of system integration and debugging is ensuring that audio plays smoothly and without interruption.  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
  • 34. 11. DESIGN EXAMPLE: ENGINE CONTROL UNIT • ECU is a generic term for any embedded system that controls one or more of the electrical system or subsystem in a motor vehicle. • ECU is a type of electronic control unit that controls a series of actuators on a internal combustion engine to ensure optimal engine performance. THEORY OF OPERATION: 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.
  • 37. 3. Architecture Class diagram for the engine controller.
  • 38. 4. Component design 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. 5. System integration 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.
  • 39. 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.
  • 40. Concept of Block motion Estimation
  • 44. Object diagram for the video accelerator
  • 45. 4. Component design  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 5. System testing 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
  • 46. 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. WinCEArchitecture WinCE layer diagram
  • 47. OAL (OEM Adaption Layer )Architecture
  • 48. 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.
  • 49. 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.
  • 50.
  • 51. 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.
  • 52. 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.
  • 53. (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.
  • 54. 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);
  • 55. 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.
  • 56. 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] */ }
  • 57. 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);