You are on page 1of 21

om

.c
ng
Introduction to RTOS

co
an
th
o ng
du
u
cu

CuuDuongThanCong.com https://fb.com/tailieudientucntt
About SwiftACT

om
• A Technology services startup company

.c
o Under establishment

ng
co
• Areas of specialties:

an
o Mobile telecommunication services development
Embedded systems development

th
o
ng
• Types of services:
o
du

o Consultation
o Managed services
u

o Sourcing
cu

o Training

Amr Ali Abdel-Naby@2010 Introduction to RTOS


CuuDuongThanCong.com https://fb.com/tailieudientucntt
About Me

om
• Graduated 2004

.c
o ECE, ASU: 5 yrs distinction

ng
• 5+ years in embedded systems development

co
o SDLC, Apps, MW, DD, Porting, ...
• 3+ years in SW engineering

an
PSP, CMMI, Systematic reuse, ...

th
o
• 3+ years in SW testing ng
o IBM certified, ISTQB certified, ...
o
du
u
cu

Amr Ali Abdel-Naby@2010 Introduction to RTOS


CuuDuongThanCong.com https://fb.com/tailieudientucntt
Copyright

om
• Materials in this course is the property of Amr Ali Abdel-Naby.

.c
ng
• Reproduction or transmission of the materials in any manner

co
without the copyright owner permission is a law violation.

an
th
o ng
du
u
cu

Amr Ali Abdel-Naby@2010 Introduction to RTOS


CuuDuongThanCong.com https://fb.com/tailieudientucntt
Outline

om

.c
Introduction
• Tasks

ng
• Semaphores

co
• Message Queues

an
• Other Kernel Objects

th
• Other Kernel Services o ng
du
u
cu

Amr Ali Abdel-Naby@2010 Introduction to RTOS


CuuDuongThanCong.com https://fb.com/tailieudientucntt
Outline

om

.c
Introduction
• Tasks

ng
• Semaphores

co
• Message Queues

an
• Other Kernel Objects

th
• Other Kernel Services o ng
du
u
cu

Amr Ali Abdel-Naby@2010 Introduction to RTOS


CuuDuongThanCong.com https://fb.com/tailieudientucntt
Brief History of Operating Systems

om
• Programs of primitive times

.c
o Tight integration of SW + HW Low portability

ng
o Difficult and costly to maintain

co
an
th
Modularity ng GPOS
o
du

Abstraction Evolution of OS
u
cu

Interconnectivity RTOS

Amr Ali Abdel-Naby@2010 Introduction to RTOS


CuuDuongThanCong.com https://fb.com/tailieudientucntt
RTOS vs. GPOS

om
• RTOS == GPOS • RTOS != GPOS

.c
o Multitasking o More reliable

ng
o SW + HW management o Scalable

co
o HW abstraction o Faster
o Reduced memory needs

an
o ROM or RAM bootable

th
o Portable
o ng
du
u
cu

Amr Ali Abdel-Naby@2010 Introduction to RTOS


CuuDuongThanCong.com https://fb.com/tailieudientucntt
GPOS or RTOS for embedded
systems

om
• GPOS can run on embedded systems with high memory and soft

.c
real-time requirements.

ng
co
• RTOS is more suitable for low memory and hard real-time

an
requirements.

th
• Many embedded systems run without RTOS!
o ng
du
u
cu

Amr Ali Abdel-Naby@2010 Introduction to RTOS


CuuDuongThanCong.com https://fb.com/tailieudientucntt
RTOS Definition

om
• A program that schedules

.c
Application
execution in a timely manner,

ng
manages system resources,

co
RTOS
and provides a consistent

an
foundation for developing Network File

th
Systems
application code. Protocols
ng Kernel
C/C++
• A kernel is the RTOS heart.
o
Library Other
du

Device Components
Drivers
• Kernel = Scheduler + Objects
u
cu

+ Services
Hardware

Amr Ali Abdel-Naby@2010 Introduction to RTOS


CuuDuongThanCong.com https://fb.com/tailieudientucntt
Scheduler

om
• Which task will run next?

.c
o Scheduler has the answer.

ng
co
• Scheduler = Scheduling algorithm + Dispatcher

an
th
o ng
du
u
cu

Amr Ali Abdel-Naby@2010 Introduction to RTOS


CuuDuongThanCong.com https://fb.com/tailieudientucntt
Scheduling Algorithm

om
• AKA scheduling policy

.c
• Most kernels support:

ng
o Preemptive priority based algorithm

co
o Round-Robin algorithm

an
th
ng
Preemptive priority Round-Robin
o
based algorithm algorithm
du
u
cu

T3
Priority Priority T4
T2 T2

T1 T1 T1 T2 T3 T1 T2

Time Time

Amr Ali Abdel-Naby@2010 Introduction to RTOS


CuuDuongThanCong.com https://fb.com/tailieudientucntt
Dispatcher

om
• Performs context switch

.c
ng
• Lets see an example of a context switch.

co
o Click Here

an
th
o ng
du
u
cu

Amr Ali Abdel-Naby@2010 Introduction to RTOS


CuuDuongThanCong.com https://fb.com/tailieudientucntt
Objects

om
• Building blocks for system development

.c
ng
• Most common objects are:

co
o Tasks

an
o Semaphores
Message queues

th
o o ng
du
u
cu

Amr Ali Abdel-Naby@2010 Introduction to RTOS


CuuDuongThanCong.com https://fb.com/tailieudientucntt
Services

om
• They perform operations on objects.

.c
ng
• Or provide other operations like:

co
o Timer management

an
o Interrupt handling
Device I/O

th
o
o Memory management ng
o
du
u
cu

Amr Ali Abdel-Naby@2010 Introduction to RTOS


CuuDuongThanCong.com https://fb.com/tailieudientucntt
C/Cs of RTOS

om
• Reliability

.c
ng
• Predictability

co
an
• Performance

th
• Compactness
o ng
du

• Scalability
u
cu

Amr Ali Abdel-Naby@2010 Introduction to RTOS


CuuDuongThanCong.com https://fb.com/tailieudientucntt
Reliability

om
• How long systems can operate without human interaction?

.c
ng
• Different reliability may be required.

co
an
• Reliable system = Available and does not fail

th
• Measured by downtime per year
o ng
du
u
cu

Amr Ali Abdel-Naby@2010 Introduction to RTOS


CuuDuongThanCong.com https://fb.com/tailieudientucntt
Predictability

om
• Real-time System = Correct functionality + Correct timing

.c
ng
• Predictable RTOS = Deterministic RTOS

co
o Completion of OS calls occurs within known timeframes.

an
o Variance in response times is very small.

th
o ng
du
u
cu

Amr Ali Abdel-Naby@2010 Introduction to RTOS


CuuDuongThanCong.com https://fb.com/tailieudientucntt
Performance

om
• RTS must be fast enough.

.c
ng
• CPU performance is measured in MIPS.

co
an
• Throughput measures overall system performance.

th
o SW + HW
o Rate of generating output by a system
ng
o Measured in bps
o
du

• WCET of a RTS must be known.


u
cu

o RTOS per se does not specify performance.

Amr Ali Abdel-Naby@2010 Introduction to RTOS


CuuDuongThanCong.com https://fb.com/tailieudientucntt
Compactness

om
• Embedded systems have constrained memory.

.c
ng
• RTOS must be small and efficient.

co
an
• Designers must understand both the static and dynamic memory

th
consumption of the RTOS and the application that will run on it.
o ng
du
u
cu

Amr Ali Abdel-Naby@2010 Introduction to RTOS


CuuDuongThanCong.com https://fb.com/tailieudientucntt
Scalability

om
• RTOS is used in a variety of systems.

.c
ng
• They should scale up or down to meet different requirements.

co
an
• Modular deign of RTOS aids scalability.

th
o ng
du
u
cu

Amr Ali Abdel-Naby@2010 Introduction to RTOS


CuuDuongThanCong.com https://fb.com/tailieudientucntt

You might also like