SlideShare a Scribd company logo
Sinhgad Institutes
Embedded & Real Time Operating
System [410252(C)]
Dr. M. S. Chaudhari
Professor
Dept. Of Computer Engineering,
Sinhgad Institute of Technology, Lonavala
msc.sit@sinhgad.edu
Cell. +91 8554944349
WELCOME
Sinhgad Institutes
Unit 6 : Multiprocessor Scheduling
 Multiprocessor Scheduling, resource access control and synchronization in Real-time
Operating system.
 Real-time communication: Model, priority-based service disciplines for switched
networks, weighted round-robin service disciplines, Medium access-control protocols
for broadcast networks, internet and resource reservation protocols, real-time
protocols.
 Software development process for embedded system: Requirements engineering,
Architecture and design of an embedded system, Implementation aspects in an
embedded system, estimation modelling in embedded software.
 Validation and debugging of embedded systems.
 Embedded software development tools.
 Debugging techniques.
 Real-time operating systems: Capabilities of commercial real-time operating
systems, QNX/Neutrino, Microc/OS-II, VxWorks, Windows CE and RTLinux.
Sinhgad Institutes
• In multiple-processor scheduling multiple CPU’s are available and hence Load
Sharing becomes possible.
• However multiple processor scheduling is more complex as compared to single processor
scheduling.
• In multiple processor scheduling there are cases when the processors are identical i.e.
HOMOGENEOUS, in terms of their functionality, we can use any processor available to run
any process in the queue.
Approaches to Multiple-Processor Scheduling :-
• One approach is when all the scheduling decisions and I/O processing are handled by a
single processor which is called the Master Server and the other processors executes only
the user code. This is simple and reduces the need of data sharing. This entire scenario is
called Asymmetric Multiprocessing.
• A second approach uses Symmetric Multiprocessing where each processor is self
scheduling. All processes may be in a common ready queue or each processor may have
its own private queue for ready processes. The scheduling proceeds further by having the
scheduler for each processor examine the ready queue and select a process to execute.
Introduction :- Multiprocessor Scheduling
Sinhgad Institutes
Resource Access Control in Real-Time Systems
• Resources, Resource Access, and How Things Can Go Wrong:
• The Mars Pathfinder Incident
• Resources, Critical Sections, Blocking
• Priority Inversion, Deadlocks
• Non-preemptive Critical Sections
• Priority Inheritance Protocol
• Priority Ceiling Protocol
• Stack-Based Protocols
• Resource Access in ADA
Sinhgad Institutes
Synchronization in Real-time Operating system.
• Synchronization and messaging provides the necessary communication between tasks
in one system to tasks in another system.
• The event flag is used to synchronize internal activities while message queues and
mailboxes are used to send text messages between systems.
• Common data areas utilize semaphores. Below are top 3 messaging and
synchronization techniques.
1. Semaphores
2. Mailboxes
3. Queues
Semaphores
• These are independent kernel objects that are designed to offer flagging mechanisms
required to control access to resources.
• There are two types of semaphores; counting semaphores that feature a random
number of states and binary semaphores that feature two states.
• Binary semaphores can be classified as counting semaphores that have a count
limit of 1.
Sinhgad Institutes
Synchronization in Real-time Operating system.
Mailboxes:-
• Mailboxes also referred to as exchanges are independent kernel objects that facilitate
transfer of messages by tasks.
• The message sized may be fixed or determined by the implementation.
• Pointers to complex data are sent through mailboxes.
• As such, some kernels make use of mailboxes in order to store data in a regular variable
where kernel can access it with ease. If a task sends messages to a full mailbox, it
receives an error message.
Queues
• Queues are also independent kernel objects whose aim to provide means for tasks to
transfer messages.
• They are deemed more complex but flexible as compared to mailboxes, their message
size may be fixed, pointer oriented and based on the implementation.
• A task may send to a queue until the queue is full. Queue depths are mainly user
specified during creation or configuration.
Sinhgad Institutes
Real-time communication
Real time communications is the near simultaneous exchange of information over any
type of telecommunications service from the sender to the receiver in a connection with
negligible latency, according to Search Unified Communication.
Examples of real time communications include:
• Voice over landlines and mobile phones
• VoIP
• Instant messaging (e.g., WhatsApp, WeChat),
• Video and teleconferencing
• Robotic telepresence
Real time communications can take place in half duplex or full duplex:
Half duplex:-
communications in one channel in one direction at a time. Sender or receiver can send
but not receive at the same time (think of an old-style walkie-talkie where the user has to
say “over” to tell the person on the other end that she can speak).
Full duplex:-
sender and receiver can send and receive messages simultaneously in two parallel
communication pathways.
Sinhgad Institutes
Real-time communication
A real time communication model
• In the model of the real time communication, end users of the message
application systems as source and destination residing in different host.
• The network interface of each host contains input queue and output queue.
• Two buffer area called as input / output buffer are allocated to input and output
queue to store queuing information.
• The queue are jointly maintained by two local servers as Transport Protocol
Handler (TPH) and Network Access Control Handler (NACH).
• The former interfaces with local application and provides them with message
transport service. The next interface with the network below and provides
network access and message transmission services to the TPH.
• The client- server architecture produce more delay such that it is not suitable
communication network architecture for real time communication.
Sinhgad Institutes
Fig: a real time communication model
A real time communication model
Sinhgad Institutes
Real-time communication
• The fig. above shows the data path follow to transfer the message in between
two hosts.
• Two marked circle TPH and NACH are transport protocol handler and network
access control handler.
• When requested to send message by a local application task, the source TPH
places the massage in output queue.
• Each outgoing message is delivered to network under the control of source
NACH.
• After the placement of message on network, the NACH of destination host place
it on input queue of destination and notify the destination TPH.
• The destination TPH then moves the message to address space of the
destination application task and notify the destination task of arrival of message.
• Ideally the network delivers messages to receiver with no delay.
• In reality there is some of the delay are associated with queuing delay at sender,
network transmit time and queuing delay at receiver as well as network.
• Hence a synchronization protocol is needed to model the real time
communication model.
Sinhgad Institutes
Real-time communication
Priority – Based Service Disciplines For Switched Network:-
• According to a priority based service disciplines, the transmission of ready packets
are scheduled in priority driven manner.
• Two Types
1. Waited fair queuing (WFQ)
2. Waited round robin scheduling are common approach for scheduling the packets in
real time communication network.
Waited Fair Queuing (WFQ) Discipline:
It is a rate allocating service discipline and provides each flow with at least its
proportional fair share link capacity and isolates the timing between flows such that it is
also called as packet by packet generalized processor sharing algorithms. It is define as
a packet switch has several inputs, feeding to an output link shared by n established
flows where each flows i is allocated to ui of the link such that total bandwidth allocated
to all connections is:
𝑈 = ∑ 𝑢𝑖 𝑛 𝑖=1 Where U<=1.
Sinhgad Institutes
Real Time Traffic Model
Real Time Traffic Model:
• The real time traffic means isochronous or synchronous traffic, consisting
stream of message that are generated by their sources and delivered to
their respective destination on continuous basis.
• The traffic includes the periodic, aperiodic and sporadic messages.
• The periodic and sporadic message are synchronous in nature and there
requirement of guarantee of on time delivery whereas aperiodic message
are asynchronous in nature and shows the soft timing constraint.
• In real time traffic model, each message (Mi) be characterized by tuples of
inter-packet spacing (Pi), message length (ei), reception deadline (Di) as
below.
• Mi = (pi , ei , Di )
• This traffic model is called peak rate model in real time communication.
Sinhgad Institutes
Throughput, Delay and Jitter:
• The throughput is the measure of the numbers of packets or
message stream that the network can deliver per unit time.
• The delay (latency) is time taken to deliver the packet or
message stream. It is fixed due to minimum propagation delay
due to speed of light and varying due to queuing on path.
• The term jitter indicates variance on delay.
• Many real time communication protocol and algorithms are
designed to keep not only the worst case delay and jitter as
small.
Sinhgad Institutes
Real-time communication
Weighted round-robin service disciplines :-
• The weighted round robin schedule extends normal round robin to give each job
with weight Wi such that ith job gets Wi lenth time slice for execution.
• In this method each packets obtained from set of n flows are arranged in FIFO order
and gets the connection for Wi time after connection and preempted and backlogged
to the end of the queue if it is not completely transmitted otherwise removed from the
queue.
• In WRR queuing packets are first classified into various service classes such as:
real time, interactive and file transfer, and then assigned to a queue that is
specifically dedicated to that service class.
• Each of the queues is serviced in a round-robin order.
• Similar to strict priority queuing and fair queuing - empty queues are skipped.
•
• .
• WRR queuing supports the allocation of different amounts of bandwidth to different
service class by either:
• Allowing higher-bandwidth queues to send more than a single packet each time that
they are visited during a service round.
• Allowing each queue to send only a single packet each time that it is visited, but to
visit higher-bandwidth queues multiple times in a single service round.
Sinhgad Institutes
Real-time communication
Medium access-control protocols for broadcast networks :-
 The transmission medium of the broadcast network is the processor.
 A MAC protocol is a discipline for scheduling this type of processor.
 Scheduling of the transmission medium is done distributed by network interfaces of
hosts in the network
 Medium Access Control Protocol determines a particular way a medium is accessed
for communication . It comes under the data link layer of 7layer OSI model for
Network communication
 Every equipment which need to become a part of network communication has a
physical address or MAC address which makes it unique across all the networking
devices in the world this is called MAC addressing.
 This makes it possible for the Data to send correctly to a specific destination through
a network.
Sinhgad Institutes
• Medium Access Protocol in CAN (Controller Area Network)
• Controller area network are very small network. CANs are used to connect components
of embedded controllers. An example is an automotive control system whose
components control the engine, brake, and other parts of an automobile.
• The end to end length of CAN must not exceed 100 meters. This means that within the
fraction of a bit time after a station starts to transmit, all stations on the network can
hear the transmission.
• The output of all stations are wire-ANDed together by the bus i.e. the bit on the network
during bit time is a logical 0 if the output of any station is 0 and logical 1 when the
output of all stations is 1.
• CAN MAC protocol is similar to the CSMA/CD (carrier sense Multiple Access/ Collision
Detection)
• A station with a packet to send waits until it hears that the network is idle and then
commences to transmit the ID number of the packet. At the same time, the station
listens.
• Whenever it hears a 0 on the network while it is transmitting 1, it interrupts its own
transmission.
• Network connection is resolved in favor of the packet with the smallest ID among all
contending packets.
Sinhgad Institutes
https://www.youtube.com/watch?v=XdtdBUHEdOI
Sinhgad Institutes
Sinhgad Institutes
Sinhgad Institutes
R = Rececive, D = Dominant, SOF= Dominant bit, Every frame start with SOF.
Sinhgad Institutes
Real-time communication
Internet And Resource Reservation Protocols:-
• RSVP (Resource Reservation Protocol) is a set of communication rules that
allows channels or paths on the Internet to be reserved for
the multicast (one source to many receivers) transmission of video and
other high-bandwidth messages.
• RSVP is part of the Internet Integrated Service (IIS) model, which ensures
best-effort service, real-time service, and controlled link-sharing.
There are several related protocols which support real time traffic over the
internet. Some of the important protocols are
• RTP (Real Time Protocol): used for real time data transport developed by
extending UDP and sits between UDP and application.
• RTCP (Real Time Control Protocol): used to exchange the control
information between sender and receiver and works conjunction with RTP.
• SIP (Session Initiation Protocol): provides the mechanism for establishing
calls over IP.
• RTSP (Real Time Streaming Protocol): allows user to control display as
rewind, pause, forward etc.
Sinhgad Institutes
Real-time communication
Real-time Protocols:-
There was a dilemma weather to implement RTP as a sub layer of transport layer or as a part
of application layer.
At this point it is common that RTP is implemented as application library, which
RTP doesn’t ensure the real time delivery itself but it provides the means for
 Jitter elimination / reduction - Synchronization of several audio or video streams that belong
to same multimedia session.
 Multiplexing of audio/video streams that belong to different session.
 Translation of audio/video streams from one encoding type to another.
 With the help of RTCP, RTP also provides hooks for adding reliability and flow/congestion
control which is implemented within multimedia application. This property sometimes called
as application level framing.
 RTP is a protocol that provides the basic transport layer for real time application but doesn’t
provide any mechanism for error and flow control , congestion control, quality feedback and
synchronization. For that purpose RTCP is added as a companion to RTP to provide end to
end monitoring, data delivery and QOS.
Sinhgad Institutes
Software Development Process For Embedded System
Requirements Engineering:-
Sinhgad Institutes
Development process of an embedded system
Sinhgad Institutes
Software Development Process For Embedded System
Architecture And Design of an Embedded System:-
Embedded System Development Cycle
 Determine the requirements Design the system architecture
 Select the OS Choose the processor and peripherals
 Choose the development platform Code the applications and optimize
 Verify the software on the host system Verify the software on the target system
Determine the Requirements
Functional and nonfunctional , Multimode or multifunctional system
Size, cost, weight, etc., Choosing the hardware components
Application specific hardware, External interfaces, Input and output devices
Design the System Architecture: The architecture of an embedded system depends on,
 Whether the system is real time , Whether operating system needs to be embedded
 Cost, size, power consumption, etc.
Select the OS If operating system we can select,
 Real-time operating systems like RTLinux, VX works, pSOS, QNX, VRTX, etc.
 Nonreal operating systems like Windows CE, embedded Windows XP, etc.
Sinhgad Institutes
Choose the Processor
• The following processors can be used in the development of an embedded system
• • Microprocessors-8085, 8086, Pentium
• • Microcontrollers-PIC, MCS-51, MSP-430, AVR
• • Digital signal processor- dsPIC, Sharp, Blackfin,Tigersharc
Choose the Development Platform
• The development platforms of an embedded systems include the following
• • The hardware platform
• • The programming language
• • The operating system
• • The development tools
Code the Applications and Optimize
• The coding of an embedded system can be done by using the following programming languages.
• • Assembly language
• • C language
• • Object oriented languages like C++, Java, etc.
• • Optimizing the code
Verify the Software on the Host System
• • Compile and assemble the source code into object file
• • Use a simulator to simulate the working of the system
Verify the Software on the Target System
• • Download the program using a programmer device
• • Use an Emulator or on chip debugging tools to verify the software
Sinhgad Institutes
Install the Program in the Chip
• To install the developed code into a microcontroller needs the following two items
• A Programmer Hardware
• The hardware of an embedded system can communicate to both the microcontroller and the PC. This
allows it to get what the personal computer is saying and write those to the microcontroller chip. Here,
the USB interface is used to communicate to the PC and the ISP interface is used to communicate with the
MCU.
• A Programmer Software
• A programmer software of an embedded systems runs on your PC where you ran the IDE tool. The main
function of this tool is to read data from the hex file produced by a ‘C’ compiler and transfer them to the
hardware allied on the USB port.
Sinhgad Institutes
Software Development Process For Embedded System
Implementation aspects in an embedded system:-
 Embedded system designs that include more than one processor are increasingly common
market research suggests that, before very long, multicore designs will be the norm.
 A digital camera typically has two CPUs: one deals with image processing and the other
looks after the general operation of the camera.
 The biggest challenge with multiple processors is debugging.
 The code on each individual device may be debugged
 the tools and techniques are well understood.
 The challenge arises with interactions between the two processors. There is a clear need
for debugging technology that addresses the issue of debugging the system that is,
multicore debugging.
Sinhgad Institutes
Software Development Process For Embedded System
Estimation Modeling in Embedded Software :-
 Performance estimation is a critical aspect in design of
embedded systems:
 Produced design must meet the required performance
constraints
 Accurate techniques (e.g., simulators or WCET techniques)
can be too slow to be used in Design Space Exploration
 Solution: performance estimation techniques based on
mathematical models
Enough accurate to drive the exploration
Not enough accurate to validate the final solution:
simulators or WCET techniques have still to be used for
final validation
Sinhgad Institutes
Software Development Process For Embedded System
Validation and debugging of embedded systems:-
 Building quality into software as it's being developed is far more effective than
trying to test it in after it's been built.
 Verification and validation techniques can be applied throughout the product
lifecycle to help assure that the correct product is being built and that the product
is being built correctly.
 Verification and validation (commonly referred to as V&V) is concerned with
answering two fundamental questions: did we build the right product, and did we
build the product right?
 Speaking broadly, validation is concerned with building the right product, and
verification is concerned with building the product right.
Sinhgad Institutes
Embedded Software Development Tools
Software Development Tools
1. Software Development Kit (SDK)
2. Source-code Engineering Software
3. RTOS
4. Integrated Development Environment
5. Proto typer
6. Editor
7. InterpreterCompiler
8. Assembler
9. Cross Assembler
10.Testing and debugging tools
11.Locator
Sinhgad Institutes
Embedded Software Development Tools
Sinhgad Institutes
Embedded Software Development Tools
When we produce an executable, several things happen:
1. Compile: Translates source code (C) into object code Also, preprocessing, optimizing,
semantic analysis . Each source file creates one object file
2. Link: Combines one or more object files into an executable
3. Run
• Host: computer where tools are run
• „
Target: processor you are shipping
• „
Native tools – run on the host. „E.g. Windows NT compiler produces binary Pentium
instructions (great for Pentium, worthless for Motorola 68000)
• „
Cross-Compilers „Runs on your host, but produces binary instructions for your target from
your C/C++ programs.
• „
Cross-Assemblers : „Runs on your host, but produces binary instructions for your target
from your assembly programs.
• „
Tool Chains: „Named because output of one tool becomes the input for the next tool
„ Tools compatible with a particular target are called a “Tool Chain” and are available from
different vendors.
Sinhgad Institutes
Embedded Software Development Tools
• Linker/locators: Address Resolution
• Many microprocessor instructions contain addresses of operands (variables, function
calls).
• Hooking up all the addresses is called Address Resolution When each file compiled,
addresses are not known, so flags left as placeholders.
• The linker: combines all files, so it can replace placeholders with actual address values.
• Loader/locator : figure out starting memory address for executable.
Sinhgad Institutes
Advanced Embedded Software Development Tools
1. PyCharm
2. WebStorm
3. Qt Creator
4. MPLAB X
5. Visual Studio
6. Eclipse
7. NetBeans etc.
Sinhgad Institutes
Embedded Software Development Tools
PyCharm:-
A Czech company JetBrains created this IDE specifically for developers working with Python.
Nevertheless, PyCharm is suitable for cross-platform development as it supports JavaScript,
CoffeeScript, TypeScript, Cython, SQL, HTML/CSS, AngularJS, Node.js, template
languages, and more, together with Windows, macOS and Linux operating systems.
PyCharm provides everything you need for productive embedded software development:
• Intelligent code completion
• Error highlighting and fixing
• Automated code refactoring
• Easy project navigation
WebStorm:-
Another IDE from JetBrains is WebStorm, used for creating JavaScript, CSS and HTML
solutions.
WebStorm performs auto completion, on-the-fly code analysis, code navigation, refactoring,
debugging and integration with version control systems. It also supports multiple nesting e.g.
when a JS script is embedded in an HTML document, in which another HTML code is
embedded, inside which JavaScript is embedded. The organization of information in these
layers provides correct refactoring.
Sinhgad Institutes
Embedded Software Development Tools
Qt Creator:-
Qt integrated development environment has a comprehensive set of libraries, APIs and tools
to create software for embedded devices in C++, JavaScript and QML.
Features:
 Cross-compiling
 Auto completion
 Syntax highlighting
 Virtual keyboard
MPLAB:-
MPLAB X is the latest version of an integrated development environment MPLAB created by
Microchip Technology company. The software is based on the open-source NetBeans
platform and is designed to create applications for various types of PIC microcontrollers and
digital signal controllers.
Sinhgad Institutes
Embedded Software Development Tools
Visual Studio:-
A popular integrated development environment by Microsoft Visual Studio is used to build
not only computer programs and mobile apps, but embedded software as well. The
extension Visual C++ for IoT development enables programmers to debug native C/C++
code either locally on Windows, or on microcontrollers, or on remote Linux machines. Using
Visual Studio for IoT, you can build, edit and debug devices running on Linux.
Eclipse:-
Initially, the Eclipse integrated development environment was created for Java applications,
and now it is the most widely used solution by Java programmers. Nevertheless, Eclipse can
work with other programming languages (Ada, ABAP, C, C++, C#, Python, PHP, etc.) via
plug-ins.
A separate package Eclipse IDE for Automotive Software Developers contains tools and
frameworks for quick and easy creation of embedded automotive software.
Sinhgad Institutes
Debugging techniques
1. Simplify complex data :-
Substitute complex analog inputs with digital, synthetic, known, and repeatable data. If a
counting pattern does the trick to start, use a counting pattern. For algorithms with coefficients
(such as filters), replace the production coefficients with a simpler set of coefficients.
2. Divide and conquer:-
Home in on the location of the problem as much as possible before trying to understand it.
This can save significant time both in simulation and in the lab on hardware in the long run. To
elaborate, let’s say you’ve got a chained set of processing-intensive signal processing
algorithms; let’s call them A, B, C, D. When you stimulate A and observe D, you notice a
problem. If you can narrow down that the input to C looks fine, but the output of C is bad,
you’ve just homed in on the bug and the problem is likely within C. Now you can strip away
dealing with the additional complexities of A, B, and D.
3. Slow the process down:-
Slow down clocks and data rates. Perhaps some timing requirement isn’t being met. Maybe
one algorithm isn’t synchronized with another. Perhaps one of the algorithms that needs to be
data-driven was accidentally coded to be clock-driven. Or maybe one device is trying to push
data too quickly to another.
Sinhgad Institutes
Debugging techniques
4. Only change one variable at a time:-
When there are multiple inputs, it can be valuable to isolate them and only change one input at
a time, observing the system response. The trick here is to identify all the inputs that induce a
change in the output of the system. This is related to fault isolation and activation.
5. Create off-line models:-
These models should match as closely as possible the real-time algorithm, for bit-level
comparison. This is most useful for non-intuitive transformations (such as matrix operations)
where it’s too challenging to understand what the output should look like relative to the input. If
the real-time algorithm is fixed-point and the off-line algorithm is floating-point, there may be
small discrepancies that accumulate and cause problems.
6. Start from a known-good state: Slowly tune the input until something breaks, and the bug
is observable. This can be helpful for scenarios where overflow may be occurring. For example,
if bit wrapping is suspected, slowly increase the amplitude at the input until the problem is
observed. Similarly, if there are buffers in use, start by feeding a small amount of data into the
algorithm and slowly increasing until the suspected condition occurs. Alternatively, maybe a
control loop that breaks with large transients may appear fine with smaller deviations around a
steady-state condition.
Sinhgad Institutes
Real-Time operating systems
Capabilities of commercial real-time operating systems:-
• A real-time operating system, in turn, achieves this by using appropriate task scheduling
techniques. Normally, real-time operating systems provide flexibility to the programmers to
select an appropriate scheduling policy among several supported policies.
• Deployment of an appropriate task scheduling technique out
• A real-time operating system (RTOS) is an operating system (OS) intended to
serve real-time applications that process data as it comes in, typically without buffer delays.
• Processing time requirements (including any OS delay) are measured in tenths of seconds
or shorter increments of time.
Sinhgad Institutes
Real-Time operating systems
QNX/Neutrino:-
• QNX is a product from QNX Software System Ltd.
• QNX Neutrino offers POSIX-compliant APIs and is implemented using microkernel
architecture.
• The microkernel architecture of QNX is shown in Fig.
• Because of the fine grained scalability of the micro- kernel architecture, it can be configured
to a very small size.
• critical advantage in high volume devices, where even a 1% reduction in memory costs can
return millions of dollars in profit.
Sinhgad Institutes
Real-Time operating systems
Microc/OS-II:-
• µC/OS-II is a free RTOS.
• It is written in ANSI C and contains small portion of assembly code.
• The assembly language portion has been kept to a minimum to make it
easy to port it to different processors.
• To date, µC/OS-II has been ported to over 100 different processor
architectures ranging from 8-bit to 64-bit microprocessors,
microcontrollers, and DSPs.
• Some important features of µC/OS-II are highlighted in the following.
• µC/OS-II was designed so that the programmer can use just a few of the
offered services
or select the entire range of services.
• This allows the programmer to minimize the amount of memory needed
by µC/OS-II on a per-product basis.
Sinhgad Institutes
Real-Time operating systems
VxWorks:-
• VxWorks was deployed in the Mars Pathfinder which was sent to
Mars in 1997.
• Pathfinder landed in Mars, responded to ground commands, and
started to send science and engineering data.
• However, there was a hitch: it repeatedly reset itself.
• Remotely using trace generation, logging, and debugging tools of
VxWorks, it was found that the cause was unbounded priority
inversion.
• The unbounded priority inversion caused real-time tasks to miss their
deadlines, and as a result, the exception handler reset the system
each time.
• Although VxWorks supports priority inheritance, using the remote
debugging tool, it was found to have been disabled in the
configuration file. The problem was fixed by enabling it.
Sinhgad Institutes
Real-Time operating systems
Windows CE :-
• Windows CE is a stripped down version of Windows, and has a minimum
footprint of 400KBytes only.
• It provides 256 priority levels.
• To optimize performance, all threads are run in the kernel mode.
• The timer accuracy is 1 msec for sleep and wait related APIs.
• The different functionalities of the kernel are broken down into small non-
preemptive sections.
• So, during system call preemption is turned off for only short periods of
time.
• Also, interrupt servicing is pre-emptible. That is, it supports nested
interrupts.
• It uses memory management unit (MMU) for virtual memory
management.
Sinhgad Institutes
Real-Time operating systems
RTLinux:-
• Lynx is a self host system.
• The currently available version of Lynx (Lynx 3.0) is a
microkernel-based real-time operating system.
• Though the earlier versions were based on monolithic design.
Lynx is fully compatible with Linux.
• With Lynx’s binary compatibility, a Linux program’s binary
image can be run directly on Lynx.
• On the other hand, for other Linux compatible operating
systems such as QNX, Linux applications need to be
recompiled in order to run on them.
• The Lynx microkernel is 28KBytes in size and provides the
essential services in scheduling, interrupt dispatch, and
synchronization.
Sinhgad Institutes
Sinhgad Institutes

More Related Content

PPTX
Types of delay (Nodal, Queuing, Transmission and Propagation)
PPTX
Computer networks unit v
PPT
Data Link Layer| Error Detection
PPT
Message Authentication Code & HMAC
PPTX
Unit-3-Virtualization.pptx
PDF
Circuit Switching, Packet Switching, Virtual Circuit Networks and Datagram Ne...
PPT
PPTX
Distributed system lamport's and vector algorithm
Types of delay (Nodal, Queuing, Transmission and Propagation)
Computer networks unit v
Data Link Layer| Error Detection
Message Authentication Code & HMAC
Unit-3-Virtualization.pptx
Circuit Switching, Packet Switching, Virtual Circuit Networks and Datagram Ne...
Distributed system lamport's and vector algorithm

What's hot (20)

PPT
IP Security Part 2
 
PPTX
MEDIUM ACCESS CONTROL
PDF
Mobile Network Layer
PPTX
Graphics in C programming
PPTX
Network software
PPTX
Software engineering 12 process quality metrics
PPTX
Mobile IP - pavankumar_912
PDF
Control Unit Design
PPT
TCP timers.ppt
PPTX
Parsing (Automata)
PPTX
Os unit 3 , process management
PPTX
Token bus
PPT
Socket Programming
PDF
PPTX
FTP & TFTP
PDF
Cs8591 Computer Networks - UNIT V
PPTX
IEEE Posix Standards
PPTX
Software Engineering Practice
PPT
Cpu organisation
IP Security Part 2
 
MEDIUM ACCESS CONTROL
Mobile Network Layer
Graphics in C programming
Network software
Software engineering 12 process quality metrics
Mobile IP - pavankumar_912
Control Unit Design
TCP timers.ppt
Parsing (Automata)
Os unit 3 , process management
Token bus
Socket Programming
FTP & TFTP
Cs8591 Computer Networks - UNIT V
IEEE Posix Standards
Software Engineering Practice
Cpu organisation
Ad

Similar to ERTOS UNIT6.ppt (20)

PDF
Resource Management in Real Time Systems and Networks 1st Edition C. Siva Ram...
PDF
Distributed systems short notes module 1
PPT
Data & comp. communication
PPTX
Lecture 3 Inter Process Communication.pptx
PPT
Embedded System serial Communication.ppt
PPTX
Communication And Synchronization In Distributed Systems
PPTX
Communication And Synchronization In Distributed Systems
PPTX
Distributed Systems
PPTX
Distributed Systems Introduction and Importance
PPT
Lecture 02
PPT
Computer network basics
PDF
OMG Data-Distribution Service (DDS) Tutorial - 2009
PPTX
Pertemuan_3 Internet and Internetworking.pptx
PDF
Stable Ethernet TCP/IP Real Time Communication In Industrial Embedded Applica...
PDF
Resource Management In Realtime Systems And Networks C Siva Ram Murthy Chebiy...
PDF
02 Models of Distribution Systems.pdf
PDF
Cs556 section2
PDF
Soft Real-Time Guarantee for Control Applications Using Both Measurement and ...
PDF
Distributed Realtime Systems Theory And Practice 1st Ed K Erciyes
PDF
A Bandwidth Efficient Scheduling Framework for Non Real Time Applications in ...
Resource Management in Real Time Systems and Networks 1st Edition C. Siva Ram...
Distributed systems short notes module 1
Data & comp. communication
Lecture 3 Inter Process Communication.pptx
Embedded System serial Communication.ppt
Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systems
Distributed Systems
Distributed Systems Introduction and Importance
Lecture 02
Computer network basics
OMG Data-Distribution Service (DDS) Tutorial - 2009
Pertemuan_3 Internet and Internetworking.pptx
Stable Ethernet TCP/IP Real Time Communication In Industrial Embedded Applica...
Resource Management In Realtime Systems And Networks C Siva Ram Murthy Chebiy...
02 Models of Distribution Systems.pdf
Cs556 section2
Soft Real-Time Guarantee for Control Applications Using Both Measurement and ...
Distributed Realtime Systems Theory And Practice 1st Ed K Erciyes
A Bandwidth Efficient Scheduling Framework for Non Real Time Applications in ...
Ad

Recently uploaded (20)

PPT
First Aid Training Presentation Slides.ppt
PPTX
ART-APP-REPORT-FINctrwxsg f fuy L-na.pptx
PPTX
AcademyNaturalLanguageProcessing-EN-ILT-M02-Introduction.pptx
PPTX
2025-08-10 Joseph 02 (shared slides).pptx
PDF
oil_refinery_presentation_v1 sllfmfls.pdf
PPTX
Tour Presentation Educational Activity.pptx
PPTX
BIOLOGY TISSUE PPT CLASS 9 PROJECT PUBLIC
PPTX
nose tajweed for the arabic alphabets for the responsive
PPTX
chapter8-180915055454bycuufucdghrwtrt.pptx
PPTX
Sustainable Forest Management ..SFM.pptx
PDF
COLEAD A2F approach and Theory of Change
PPTX
Project and change Managment: short video sequences for IBA
PDF
Instagram's Product Secrets Unveiled with this PPT
DOC
LSTM毕业证学历认证,利物浦大学毕业证学历认证怎么认证
PPTX
NORMAN_RESEARCH_PRESENTATION.in education
PPTX
MERISTEMATIC TISSUES (MERISTEMS) PPT PUBLIC
PDF
Yusen Logistics Group Sustainability Report 2024.pdf
PPTX
lesson6-211001025531lesson plan ppt.pptx
DOCX
ENGLISH PROJECT FOR BINOD BIHARI MAHTO KOYLANCHAL UNIVERSITY
PPTX
FINAL TEST 3C_OCTAVIA RAMADHANI SANTOSO-1.pptx
First Aid Training Presentation Slides.ppt
ART-APP-REPORT-FINctrwxsg f fuy L-na.pptx
AcademyNaturalLanguageProcessing-EN-ILT-M02-Introduction.pptx
2025-08-10 Joseph 02 (shared slides).pptx
oil_refinery_presentation_v1 sllfmfls.pdf
Tour Presentation Educational Activity.pptx
BIOLOGY TISSUE PPT CLASS 9 PROJECT PUBLIC
nose tajweed for the arabic alphabets for the responsive
chapter8-180915055454bycuufucdghrwtrt.pptx
Sustainable Forest Management ..SFM.pptx
COLEAD A2F approach and Theory of Change
Project and change Managment: short video sequences for IBA
Instagram's Product Secrets Unveiled with this PPT
LSTM毕业证学历认证,利物浦大学毕业证学历认证怎么认证
NORMAN_RESEARCH_PRESENTATION.in education
MERISTEMATIC TISSUES (MERISTEMS) PPT PUBLIC
Yusen Logistics Group Sustainability Report 2024.pdf
lesson6-211001025531lesson plan ppt.pptx
ENGLISH PROJECT FOR BINOD BIHARI MAHTO KOYLANCHAL UNIVERSITY
FINAL TEST 3C_OCTAVIA RAMADHANI SANTOSO-1.pptx

ERTOS UNIT6.ppt

  • 1. Sinhgad Institutes Embedded & Real Time Operating System [410252(C)] Dr. M. S. Chaudhari Professor Dept. Of Computer Engineering, Sinhgad Institute of Technology, Lonavala msc.sit@sinhgad.edu Cell. +91 8554944349 WELCOME
  • 2. Sinhgad Institutes Unit 6 : Multiprocessor Scheduling  Multiprocessor Scheduling, resource access control and synchronization in Real-time Operating system.  Real-time communication: Model, priority-based service disciplines for switched networks, weighted round-robin service disciplines, Medium access-control protocols for broadcast networks, internet and resource reservation protocols, real-time protocols.  Software development process for embedded system: Requirements engineering, Architecture and design of an embedded system, Implementation aspects in an embedded system, estimation modelling in embedded software.  Validation and debugging of embedded systems.  Embedded software development tools.  Debugging techniques.  Real-time operating systems: Capabilities of commercial real-time operating systems, QNX/Neutrino, Microc/OS-II, VxWorks, Windows CE and RTLinux.
  • 3. Sinhgad Institutes • In multiple-processor scheduling multiple CPU’s are available and hence Load Sharing becomes possible. • However multiple processor scheduling is more complex as compared to single processor scheduling. • In multiple processor scheduling there are cases when the processors are identical i.e. HOMOGENEOUS, in terms of their functionality, we can use any processor available to run any process in the queue. Approaches to Multiple-Processor Scheduling :- • One approach is when all the scheduling decisions and I/O processing are handled by a single processor which is called the Master Server and the other processors executes only the user code. This is simple and reduces the need of data sharing. This entire scenario is called Asymmetric Multiprocessing. • A second approach uses Symmetric Multiprocessing where each processor is self scheduling. All processes may be in a common ready queue or each processor may have its own private queue for ready processes. The scheduling proceeds further by having the scheduler for each processor examine the ready queue and select a process to execute. Introduction :- Multiprocessor Scheduling
  • 4. Sinhgad Institutes Resource Access Control in Real-Time Systems • Resources, Resource Access, and How Things Can Go Wrong: • The Mars Pathfinder Incident • Resources, Critical Sections, Blocking • Priority Inversion, Deadlocks • Non-preemptive Critical Sections • Priority Inheritance Protocol • Priority Ceiling Protocol • Stack-Based Protocols • Resource Access in ADA
  • 5. Sinhgad Institutes Synchronization in Real-time Operating system. • Synchronization and messaging provides the necessary communication between tasks in one system to tasks in another system. • The event flag is used to synchronize internal activities while message queues and mailboxes are used to send text messages between systems. • Common data areas utilize semaphores. Below are top 3 messaging and synchronization techniques. 1. Semaphores 2. Mailboxes 3. Queues Semaphores • These are independent kernel objects that are designed to offer flagging mechanisms required to control access to resources. • There are two types of semaphores; counting semaphores that feature a random number of states and binary semaphores that feature two states. • Binary semaphores can be classified as counting semaphores that have a count limit of 1.
  • 6. Sinhgad Institutes Synchronization in Real-time Operating system. Mailboxes:- • Mailboxes also referred to as exchanges are independent kernel objects that facilitate transfer of messages by tasks. • The message sized may be fixed or determined by the implementation. • Pointers to complex data are sent through mailboxes. • As such, some kernels make use of mailboxes in order to store data in a regular variable where kernel can access it with ease. If a task sends messages to a full mailbox, it receives an error message. Queues • Queues are also independent kernel objects whose aim to provide means for tasks to transfer messages. • They are deemed more complex but flexible as compared to mailboxes, their message size may be fixed, pointer oriented and based on the implementation. • A task may send to a queue until the queue is full. Queue depths are mainly user specified during creation or configuration.
  • 7. Sinhgad Institutes Real-time communication Real time communications is the near simultaneous exchange of information over any type of telecommunications service from the sender to the receiver in a connection with negligible latency, according to Search Unified Communication. Examples of real time communications include: • Voice over landlines and mobile phones • VoIP • Instant messaging (e.g., WhatsApp, WeChat), • Video and teleconferencing • Robotic telepresence Real time communications can take place in half duplex or full duplex: Half duplex:- communications in one channel in one direction at a time. Sender or receiver can send but not receive at the same time (think of an old-style walkie-talkie where the user has to say “over” to tell the person on the other end that she can speak). Full duplex:- sender and receiver can send and receive messages simultaneously in two parallel communication pathways.
  • 8. Sinhgad Institutes Real-time communication A real time communication model • In the model of the real time communication, end users of the message application systems as source and destination residing in different host. • The network interface of each host contains input queue and output queue. • Two buffer area called as input / output buffer are allocated to input and output queue to store queuing information. • The queue are jointly maintained by two local servers as Transport Protocol Handler (TPH) and Network Access Control Handler (NACH). • The former interfaces with local application and provides them with message transport service. The next interface with the network below and provides network access and message transmission services to the TPH. • The client- server architecture produce more delay such that it is not suitable communication network architecture for real time communication.
  • 9. Sinhgad Institutes Fig: a real time communication model A real time communication model
  • 10. Sinhgad Institutes Real-time communication • The fig. above shows the data path follow to transfer the message in between two hosts. • Two marked circle TPH and NACH are transport protocol handler and network access control handler. • When requested to send message by a local application task, the source TPH places the massage in output queue. • Each outgoing message is delivered to network under the control of source NACH. • After the placement of message on network, the NACH of destination host place it on input queue of destination and notify the destination TPH. • The destination TPH then moves the message to address space of the destination application task and notify the destination task of arrival of message. • Ideally the network delivers messages to receiver with no delay. • In reality there is some of the delay are associated with queuing delay at sender, network transmit time and queuing delay at receiver as well as network. • Hence a synchronization protocol is needed to model the real time communication model.
  • 11. Sinhgad Institutes Real-time communication Priority – Based Service Disciplines For Switched Network:- • According to a priority based service disciplines, the transmission of ready packets are scheduled in priority driven manner. • Two Types 1. Waited fair queuing (WFQ) 2. Waited round robin scheduling are common approach for scheduling the packets in real time communication network. Waited Fair Queuing (WFQ) Discipline: It is a rate allocating service discipline and provides each flow with at least its proportional fair share link capacity and isolates the timing between flows such that it is also called as packet by packet generalized processor sharing algorithms. It is define as a packet switch has several inputs, feeding to an output link shared by n established flows where each flows i is allocated to ui of the link such that total bandwidth allocated to all connections is: 𝑈 = ∑ 𝑢𝑖 𝑛 𝑖=1 Where U<=1.
  • 12. Sinhgad Institutes Real Time Traffic Model Real Time Traffic Model: • The real time traffic means isochronous or synchronous traffic, consisting stream of message that are generated by their sources and delivered to their respective destination on continuous basis. • The traffic includes the periodic, aperiodic and sporadic messages. • The periodic and sporadic message are synchronous in nature and there requirement of guarantee of on time delivery whereas aperiodic message are asynchronous in nature and shows the soft timing constraint. • In real time traffic model, each message (Mi) be characterized by tuples of inter-packet spacing (Pi), message length (ei), reception deadline (Di) as below. • Mi = (pi , ei , Di ) • This traffic model is called peak rate model in real time communication.
  • 13. Sinhgad Institutes Throughput, Delay and Jitter: • The throughput is the measure of the numbers of packets or message stream that the network can deliver per unit time. • The delay (latency) is time taken to deliver the packet or message stream. It is fixed due to minimum propagation delay due to speed of light and varying due to queuing on path. • The term jitter indicates variance on delay. • Many real time communication protocol and algorithms are designed to keep not only the worst case delay and jitter as small.
  • 14. Sinhgad Institutes Real-time communication Weighted round-robin service disciplines :- • The weighted round robin schedule extends normal round robin to give each job with weight Wi such that ith job gets Wi lenth time slice for execution. • In this method each packets obtained from set of n flows are arranged in FIFO order and gets the connection for Wi time after connection and preempted and backlogged to the end of the queue if it is not completely transmitted otherwise removed from the queue. • In WRR queuing packets are first classified into various service classes such as: real time, interactive and file transfer, and then assigned to a queue that is specifically dedicated to that service class. • Each of the queues is serviced in a round-robin order. • Similar to strict priority queuing and fair queuing - empty queues are skipped. • • . • WRR queuing supports the allocation of different amounts of bandwidth to different service class by either: • Allowing higher-bandwidth queues to send more than a single packet each time that they are visited during a service round. • Allowing each queue to send only a single packet each time that it is visited, but to visit higher-bandwidth queues multiple times in a single service round.
  • 15. Sinhgad Institutes Real-time communication Medium access-control protocols for broadcast networks :-  The transmission medium of the broadcast network is the processor.  A MAC protocol is a discipline for scheduling this type of processor.  Scheduling of the transmission medium is done distributed by network interfaces of hosts in the network  Medium Access Control Protocol determines a particular way a medium is accessed for communication . It comes under the data link layer of 7layer OSI model for Network communication  Every equipment which need to become a part of network communication has a physical address or MAC address which makes it unique across all the networking devices in the world this is called MAC addressing.  This makes it possible for the Data to send correctly to a specific destination through a network.
  • 16. Sinhgad Institutes • Medium Access Protocol in CAN (Controller Area Network) • Controller area network are very small network. CANs are used to connect components of embedded controllers. An example is an automotive control system whose components control the engine, brake, and other parts of an automobile. • The end to end length of CAN must not exceed 100 meters. This means that within the fraction of a bit time after a station starts to transmit, all stations on the network can hear the transmission. • The output of all stations are wire-ANDed together by the bus i.e. the bit on the network during bit time is a logical 0 if the output of any station is 0 and logical 1 when the output of all stations is 1. • CAN MAC protocol is similar to the CSMA/CD (carrier sense Multiple Access/ Collision Detection) • A station with a packet to send waits until it hears that the network is idle and then commences to transmit the ID number of the packet. At the same time, the station listens. • Whenever it hears a 0 on the network while it is transmitting 1, it interrupts its own transmission. • Network connection is resolved in favor of the packet with the smallest ID among all contending packets.
  • 20. Sinhgad Institutes R = Rececive, D = Dominant, SOF= Dominant bit, Every frame start with SOF.
  • 21. Sinhgad Institutes Real-time communication Internet And Resource Reservation Protocols:- • RSVP (Resource Reservation Protocol) is a set of communication rules that allows channels or paths on the Internet to be reserved for the multicast (one source to many receivers) transmission of video and other high-bandwidth messages. • RSVP is part of the Internet Integrated Service (IIS) model, which ensures best-effort service, real-time service, and controlled link-sharing. There are several related protocols which support real time traffic over the internet. Some of the important protocols are • RTP (Real Time Protocol): used for real time data transport developed by extending UDP and sits between UDP and application. • RTCP (Real Time Control Protocol): used to exchange the control information between sender and receiver and works conjunction with RTP. • SIP (Session Initiation Protocol): provides the mechanism for establishing calls over IP. • RTSP (Real Time Streaming Protocol): allows user to control display as rewind, pause, forward etc.
  • 22. Sinhgad Institutes Real-time communication Real-time Protocols:- There was a dilemma weather to implement RTP as a sub layer of transport layer or as a part of application layer. At this point it is common that RTP is implemented as application library, which RTP doesn’t ensure the real time delivery itself but it provides the means for  Jitter elimination / reduction - Synchronization of several audio or video streams that belong to same multimedia session.  Multiplexing of audio/video streams that belong to different session.  Translation of audio/video streams from one encoding type to another.  With the help of RTCP, RTP also provides hooks for adding reliability and flow/congestion control which is implemented within multimedia application. This property sometimes called as application level framing.  RTP is a protocol that provides the basic transport layer for real time application but doesn’t provide any mechanism for error and flow control , congestion control, quality feedback and synchronization. For that purpose RTCP is added as a companion to RTP to provide end to end monitoring, data delivery and QOS.
  • 23. Sinhgad Institutes Software Development Process For Embedded System Requirements Engineering:-
  • 24. Sinhgad Institutes Development process of an embedded system
  • 25. Sinhgad Institutes Software Development Process For Embedded System Architecture And Design of an Embedded System:- Embedded System Development Cycle  Determine the requirements Design the system architecture  Select the OS Choose the processor and peripherals  Choose the development platform Code the applications and optimize  Verify the software on the host system Verify the software on the target system Determine the Requirements Functional and nonfunctional , Multimode or multifunctional system Size, cost, weight, etc., Choosing the hardware components Application specific hardware, External interfaces, Input and output devices Design the System Architecture: The architecture of an embedded system depends on,  Whether the system is real time , Whether operating system needs to be embedded  Cost, size, power consumption, etc. Select the OS If operating system we can select,  Real-time operating systems like RTLinux, VX works, pSOS, QNX, VRTX, etc.  Nonreal operating systems like Windows CE, embedded Windows XP, etc.
  • 26. Sinhgad Institutes Choose the Processor • The following processors can be used in the development of an embedded system • • Microprocessors-8085, 8086, Pentium • • Microcontrollers-PIC, MCS-51, MSP-430, AVR • • Digital signal processor- dsPIC, Sharp, Blackfin,Tigersharc Choose the Development Platform • The development platforms of an embedded systems include the following • • The hardware platform • • The programming language • • The operating system • • The development tools Code the Applications and Optimize • The coding of an embedded system can be done by using the following programming languages. • • Assembly language • • C language • • Object oriented languages like C++, Java, etc. • • Optimizing the code Verify the Software on the Host System • • Compile and assemble the source code into object file • • Use a simulator to simulate the working of the system Verify the Software on the Target System • • Download the program using a programmer device • • Use an Emulator or on chip debugging tools to verify the software
  • 27. Sinhgad Institutes Install the Program in the Chip • To install the developed code into a microcontroller needs the following two items • A Programmer Hardware • The hardware of an embedded system can communicate to both the microcontroller and the PC. This allows it to get what the personal computer is saying and write those to the microcontroller chip. Here, the USB interface is used to communicate to the PC and the ISP interface is used to communicate with the MCU. • A Programmer Software • A programmer software of an embedded systems runs on your PC where you ran the IDE tool. The main function of this tool is to read data from the hex file produced by a ‘C’ compiler and transfer them to the hardware allied on the USB port.
  • 28. Sinhgad Institutes Software Development Process For Embedded System Implementation aspects in an embedded system:-  Embedded system designs that include more than one processor are increasingly common market research suggests that, before very long, multicore designs will be the norm.  A digital camera typically has two CPUs: one deals with image processing and the other looks after the general operation of the camera.  The biggest challenge with multiple processors is debugging.  The code on each individual device may be debugged  the tools and techniques are well understood.  The challenge arises with interactions between the two processors. There is a clear need for debugging technology that addresses the issue of debugging the system that is, multicore debugging.
  • 29. Sinhgad Institutes Software Development Process For Embedded System Estimation Modeling in Embedded Software :-  Performance estimation is a critical aspect in design of embedded systems:  Produced design must meet the required performance constraints  Accurate techniques (e.g., simulators or WCET techniques) can be too slow to be used in Design Space Exploration  Solution: performance estimation techniques based on mathematical models Enough accurate to drive the exploration Not enough accurate to validate the final solution: simulators or WCET techniques have still to be used for final validation
  • 30. Sinhgad Institutes Software Development Process For Embedded System Validation and debugging of embedded systems:-  Building quality into software as it's being developed is far more effective than trying to test it in after it's been built.  Verification and validation techniques can be applied throughout the product lifecycle to help assure that the correct product is being built and that the product is being built correctly.  Verification and validation (commonly referred to as V&V) is concerned with answering two fundamental questions: did we build the right product, and did we build the product right?  Speaking broadly, validation is concerned with building the right product, and verification is concerned with building the product right.
  • 31. Sinhgad Institutes Embedded Software Development Tools Software Development Tools 1. Software Development Kit (SDK) 2. Source-code Engineering Software 3. RTOS 4. Integrated Development Environment 5. Proto typer 6. Editor 7. InterpreterCompiler 8. Assembler 9. Cross Assembler 10.Testing and debugging tools 11.Locator
  • 33. Sinhgad Institutes Embedded Software Development Tools When we produce an executable, several things happen: 1. Compile: Translates source code (C) into object code Also, preprocessing, optimizing, semantic analysis . Each source file creates one object file 2. Link: Combines one or more object files into an executable 3. Run • Host: computer where tools are run • „ Target: processor you are shipping • „ Native tools – run on the host. „E.g. Windows NT compiler produces binary Pentium instructions (great for Pentium, worthless for Motorola 68000) • „ Cross-Compilers „Runs on your host, but produces binary instructions for your target from your C/C++ programs. • „ Cross-Assemblers : „Runs on your host, but produces binary instructions for your target from your assembly programs. • „ Tool Chains: „Named because output of one tool becomes the input for the next tool „ Tools compatible with a particular target are called a “Tool Chain” and are available from different vendors.
  • 34. Sinhgad Institutes Embedded Software Development Tools • Linker/locators: Address Resolution • Many microprocessor instructions contain addresses of operands (variables, function calls). • Hooking up all the addresses is called Address Resolution When each file compiled, addresses are not known, so flags left as placeholders. • The linker: combines all files, so it can replace placeholders with actual address values. • Loader/locator : figure out starting memory address for executable.
  • 35. Sinhgad Institutes Advanced Embedded Software Development Tools 1. PyCharm 2. WebStorm 3. Qt Creator 4. MPLAB X 5. Visual Studio 6. Eclipse 7. NetBeans etc.
  • 36. Sinhgad Institutes Embedded Software Development Tools PyCharm:- A Czech company JetBrains created this IDE specifically for developers working with Python. Nevertheless, PyCharm is suitable for cross-platform development as it supports JavaScript, CoffeeScript, TypeScript, Cython, SQL, HTML/CSS, AngularJS, Node.js, template languages, and more, together with Windows, macOS and Linux operating systems. PyCharm provides everything you need for productive embedded software development: • Intelligent code completion • Error highlighting and fixing • Automated code refactoring • Easy project navigation WebStorm:- Another IDE from JetBrains is WebStorm, used for creating JavaScript, CSS and HTML solutions. WebStorm performs auto completion, on-the-fly code analysis, code navigation, refactoring, debugging and integration with version control systems. It also supports multiple nesting e.g. when a JS script is embedded in an HTML document, in which another HTML code is embedded, inside which JavaScript is embedded. The organization of information in these layers provides correct refactoring.
  • 37. Sinhgad Institutes Embedded Software Development Tools Qt Creator:- Qt integrated development environment has a comprehensive set of libraries, APIs and tools to create software for embedded devices in C++, JavaScript and QML. Features:  Cross-compiling  Auto completion  Syntax highlighting  Virtual keyboard MPLAB:- MPLAB X is the latest version of an integrated development environment MPLAB created by Microchip Technology company. The software is based on the open-source NetBeans platform and is designed to create applications for various types of PIC microcontrollers and digital signal controllers.
  • 38. Sinhgad Institutes Embedded Software Development Tools Visual Studio:- A popular integrated development environment by Microsoft Visual Studio is used to build not only computer programs and mobile apps, but embedded software as well. The extension Visual C++ for IoT development enables programmers to debug native C/C++ code either locally on Windows, or on microcontrollers, or on remote Linux machines. Using Visual Studio for IoT, you can build, edit and debug devices running on Linux. Eclipse:- Initially, the Eclipse integrated development environment was created for Java applications, and now it is the most widely used solution by Java programmers. Nevertheless, Eclipse can work with other programming languages (Ada, ABAP, C, C++, C#, Python, PHP, etc.) via plug-ins. A separate package Eclipse IDE for Automotive Software Developers contains tools and frameworks for quick and easy creation of embedded automotive software.
  • 39. Sinhgad Institutes Debugging techniques 1. Simplify complex data :- Substitute complex analog inputs with digital, synthetic, known, and repeatable data. If a counting pattern does the trick to start, use a counting pattern. For algorithms with coefficients (such as filters), replace the production coefficients with a simpler set of coefficients. 2. Divide and conquer:- Home in on the location of the problem as much as possible before trying to understand it. This can save significant time both in simulation and in the lab on hardware in the long run. To elaborate, let’s say you’ve got a chained set of processing-intensive signal processing algorithms; let’s call them A, B, C, D. When you stimulate A and observe D, you notice a problem. If you can narrow down that the input to C looks fine, but the output of C is bad, you’ve just homed in on the bug and the problem is likely within C. Now you can strip away dealing with the additional complexities of A, B, and D. 3. Slow the process down:- Slow down clocks and data rates. Perhaps some timing requirement isn’t being met. Maybe one algorithm isn’t synchronized with another. Perhaps one of the algorithms that needs to be data-driven was accidentally coded to be clock-driven. Or maybe one device is trying to push data too quickly to another.
  • 40. Sinhgad Institutes Debugging techniques 4. Only change one variable at a time:- When there are multiple inputs, it can be valuable to isolate them and only change one input at a time, observing the system response. The trick here is to identify all the inputs that induce a change in the output of the system. This is related to fault isolation and activation. 5. Create off-line models:- These models should match as closely as possible the real-time algorithm, for bit-level comparison. This is most useful for non-intuitive transformations (such as matrix operations) where it’s too challenging to understand what the output should look like relative to the input. If the real-time algorithm is fixed-point and the off-line algorithm is floating-point, there may be small discrepancies that accumulate and cause problems. 6. Start from a known-good state: Slowly tune the input until something breaks, and the bug is observable. This can be helpful for scenarios where overflow may be occurring. For example, if bit wrapping is suspected, slowly increase the amplitude at the input until the problem is observed. Similarly, if there are buffers in use, start by feeding a small amount of data into the algorithm and slowly increasing until the suspected condition occurs. Alternatively, maybe a control loop that breaks with large transients may appear fine with smaller deviations around a steady-state condition.
  • 41. Sinhgad Institutes Real-Time operating systems Capabilities of commercial real-time operating systems:- • A real-time operating system, in turn, achieves this by using appropriate task scheduling techniques. Normally, real-time operating systems provide flexibility to the programmers to select an appropriate scheduling policy among several supported policies. • Deployment of an appropriate task scheduling technique out • A real-time operating system (RTOS) is an operating system (OS) intended to serve real-time applications that process data as it comes in, typically without buffer delays. • Processing time requirements (including any OS delay) are measured in tenths of seconds or shorter increments of time.
  • 42. Sinhgad Institutes Real-Time operating systems QNX/Neutrino:- • QNX is a product from QNX Software System Ltd. • QNX Neutrino offers POSIX-compliant APIs and is implemented using microkernel architecture. • The microkernel architecture of QNX is shown in Fig. • Because of the fine grained scalability of the micro- kernel architecture, it can be configured to a very small size. • critical advantage in high volume devices, where even a 1% reduction in memory costs can return millions of dollars in profit.
  • 43. Sinhgad Institutes Real-Time operating systems Microc/OS-II:- • µC/OS-II is a free RTOS. • It is written in ANSI C and contains small portion of assembly code. • The assembly language portion has been kept to a minimum to make it easy to port it to different processors. • To date, µC/OS-II has been ported to over 100 different processor architectures ranging from 8-bit to 64-bit microprocessors, microcontrollers, and DSPs. • Some important features of µC/OS-II are highlighted in the following. • µC/OS-II was designed so that the programmer can use just a few of the offered services or select the entire range of services. • This allows the programmer to minimize the amount of memory needed by µC/OS-II on a per-product basis.
  • 44. Sinhgad Institutes Real-Time operating systems VxWorks:- • VxWorks was deployed in the Mars Pathfinder which was sent to Mars in 1997. • Pathfinder landed in Mars, responded to ground commands, and started to send science and engineering data. • However, there was a hitch: it repeatedly reset itself. • Remotely using trace generation, logging, and debugging tools of VxWorks, it was found that the cause was unbounded priority inversion. • The unbounded priority inversion caused real-time tasks to miss their deadlines, and as a result, the exception handler reset the system each time. • Although VxWorks supports priority inheritance, using the remote debugging tool, it was found to have been disabled in the configuration file. The problem was fixed by enabling it.
  • 45. Sinhgad Institutes Real-Time operating systems Windows CE :- • Windows CE is a stripped down version of Windows, and has a minimum footprint of 400KBytes only. • It provides 256 priority levels. • To optimize performance, all threads are run in the kernel mode. • The timer accuracy is 1 msec for sleep and wait related APIs. • The different functionalities of the kernel are broken down into small non- preemptive sections. • So, during system call preemption is turned off for only short periods of time. • Also, interrupt servicing is pre-emptible. That is, it supports nested interrupts. • It uses memory management unit (MMU) for virtual memory management.
  • 46. Sinhgad Institutes Real-Time operating systems RTLinux:- • Lynx is a self host system. • The currently available version of Lynx (Lynx 3.0) is a microkernel-based real-time operating system. • Though the earlier versions were based on monolithic design. Lynx is fully compatible with Linux. • With Lynx’s binary compatibility, a Linux program’s binary image can be run directly on Lynx. • On the other hand, for other Linux compatible operating systems such as QNX, Linux applications need to be recompiled in order to run on them. • The Lynx microkernel is 28KBytes in size and provides the essential services in scheduling, interrupt dispatch, and synchronization.