Chap_9Lesson01EmsysNewRTOSes.pdf
-
Upload
tmohanrajkec -
Category
Documents
-
view
215 -
download
0
Transcript of Chap_9Lesson01EmsysNewRTOSes.pdf
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
1/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
1
REAL TIME OPERATING SYSTEMREAL TIME OPERATING SYSTEM
PROGRAMMINGPROGRAMMING--I:I: C/OSC/OS--II andII and
VxWorksVxWorks
LessonLesson--11:: RTOSesRTOSes
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
2/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
2
1.1. Kernel of an RTOSKernel of an RTOS
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
3/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
3
Kernel of an RTOSKernel of an RTOS
Used for real-time programming
features to meet hard and soft real time
constraints,
Provides for preemption points at
kernel, user controlled dynamic prioritychanges, fixed memory blocks,
asynchronous IOs, user processes in
kernel space and other functions for a
system.
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
4/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
4
2.2. Common options forCommon options for RTOSRTOS
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
5/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
5
Common options available for
selecting an RTOS
Linux 2.6.24
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
6/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
6
3.3. Complex multitasking embeddedComplex multitasking embedded
system design requirementssystem design requirements
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
7/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
7
Complex multitasking embedded systemComplex multitasking embedded system
design requirementsdesign requirements
Integrated Development Environment,
Multiple task functions in Embedded C orEmbedded C++,
Real time clock!
hardware and softwaretimers,
Scheduler,
Device drivers and device manager,
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
8/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
8
Complex multitasking embedded systemComplex multitasking embedded systemdesign requirementsdesign requirements
Functions for inter inter-processcommunications using the signals, eventflag group, semaphore- handling functions,
functions for the queues, mailboxes, pipe,and sockets,
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
9/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
9
Complex multitasking embedded systemComplex multitasking embedded system
design requirementsdesign requirements
Additional functions for example, TCP/IP
or USB port, other networking functions, Error handling functions and Exception
handling functions, and
Testing and system debugging software for
testing RTOS as well as developed
embedded application
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
10/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
10
4.4. Basic functions expected fromBasic functions expected from
kernel of an RTOSkernel of an RTOS
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
11/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
11
Basic functions expected from kernel of an
RTOS
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
12/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
12
5.5. RTOS features in generalRTOS features in general
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
13/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
13
RTOS features in generalRTOS features in general
Basic kernel functions and scheduling:
Preemptive or Preemptive plus time slicing Support to Limited Number of tasks and
threads
Task priorities and Inter Service Threads
priorities definitions
Priority Inheritance feature or option ofpriority ceiling feature
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
14/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
14
RTOS features in generalRTOS features in general
Task synchronization and IPC functions
Support to task and threads running in kernelspace
IDE consisting of editor, platform builder,
GUI and graphics software, compiler,
debugging and host target support tools
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
15/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
15
RTOS features in generalRTOS features in general
Device Imaging tool and device drivers
Clock, time and timer functions, Support to POSIX,
Asynchronous IOs,
Fixed memory blocks allocation and
deallocation system,
Support to different file systems and flashmemory systems
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
16/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
16
RTOS features in generalRTOS features in general
TCP/IP protocols, network and buses
protocols, Development environment with Java
Componentization (reusable modules for
different functions), which leads to smallfootprint (small of size of RTOS codes placed
in ROM image)
Support to number of processor architectures,
such as INTEL, ARM, Philips,
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
17/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
17
6.6. Development ApproachesDevelopment Approaches
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
18/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
18
Host and Target Based DevelopmentHost and Target Based Development
ApproachApproach
. A host machine (Computer) for example, a PCuses a general purpose OS, for example, Windows
or Unix for system development. The targetconnects by a network protocol for exampleTCP/IP during the development phase. The
developed codes and the target RTOS functionsfirst connect a target. The target with downloadedcodes finally disconnects and contains a small sizefootprint of RTOS. For example, the target does
not download host machine resident compiler,cross compiler, editor for programs, simulationand debugging programs, and MMU support
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
19/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
19
Self Host Based Development ApproachSelf Host Based Development Approach
same system with full RTOS is used for
development on which the application willbe running. This also does not require cross
compilation. When application codes are
ready, the required RTOS function codesand application codes are downloaded into
the ROM of the target board
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
20/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
20
7.7. Types of RTOSesTypes of RTOSes
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
21/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
21
InIn--House Developed RTOSesHouse Developed RTOSes Codes written for the specific need based,
and application or product Customizes the in-house design needs.
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
22/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
22
InIn--House Developed RTOSes House Developed RTOSes Generally either a small level application
developer uses the in-house RTOS or a bigresearch and development company uses the
codes built by in-house group of engineers
and system integrators
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
23/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
23
Broad based Commercial RTOSesBroad based Commercial RTOSes
Provides an advantage of availability of off
the self thoroughly tested and debuggedRTOS functions.
Provides several development tools.
Testing and debugging tools
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
24/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
24
Broad based Commercial RTOSesBroad based Commercial RTOSes
Support to many processor architectures!
ARM as well as x86, MIPS and SuperH. Support to GUIs
Support to many devices, graphics, network
connectivity protocols and file systems
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
25/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
25
Broad based Commercial RTOSes Broad based Commercial RTOSes
Support to device software optimization
(DSO) Provides error and exceptional handling
functions can be ported directly as these are
already well tested by thousands of users
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
26/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
26
Broad based Commercial RTOSes Broad based Commercial RTOSes
Simplifies the coding process greatly for a
developer Helps in building a product fast
Aids in building robust and bug-free
software by thorough testing and simulationbefore locating the codes into the hardware
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
27/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
27
Broad based Commercial RTOSes Broad based Commercial RTOSes
Saves large amount of RTOS, tools and in-
house documentation development time. Saving of time results in little time to
market an innovative and new product.
Saves the maintenance costs.
Saves the costs of keeping in-hose
engineers.
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
28/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
28
General Purposes OSes with RTOSGeneral Purposes OSes with RTOS
Embedded Linux or Windows XP is general
purpose OS. They are not componentized.Footprint (the code that goes as ROM
image) is not reducible.
The tasks are not assignable priorities. However, they offer powerful GUIs, rich
multimedia interfaces and have low cost.
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
29/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
29
General Purposes OSes with RTOS General Purposes OSes with RTOS
The general purpose OSes can be used in
combination with the RTOS functions. For example, Linux 2.6.24 and RTLinux
sre real time kernels over the Linux kernel.
Other example is Windows XP Embeddedfor x86 architecture
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
30/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
30
Special Focus RTOSesSpecial Focus RTOSes
Used with specific processors like ARM or
8051 or DSP, OSEK for automotives or
Symbian OS for Mobile phones
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
31/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
31
SummarySummary
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
32/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
32
We learntWe learnt
RTOS used for real-time programming
features to meet hard and soft real time
constraints,
Provides for preemption points at kernel,
user controlled dynamic priority changes,fixed memory blocks, asynchronous IOs,
user processes in kernel space and otherfunctions for a system
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
33/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.
33
We learnt RTOSes basic functions are OS
initiate and start, scheduling, error
handling, system clock and service,
time delay and task, memory and IPC
management functions.
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
34/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc. 34
We learnt
Host-target and self hos development
approaches In-house, broad-based, general purpose
with RTOS functions and special focusRTOSes
-
8/10/2019 Chap_9Lesson01EmsysNewRTOSes.pdf
35/35
2008 Chapter-9 L1: "Embedded Systems - Architecture, Programmingand Design" , Raj Kamal, Publs.: McGraw-Hill, Inc. 35
End of Lesson 1 of Chapter 9End of Lesson 1 of Chapter 9