Introduction to RTOS

Post on 06-Jan-2017

3,470 views 1 download

transcript

Introduction to RTOS

Yong Heui Cho @ Mokwon University

Most of slides are referred to and all credits should go to:[1] Swetanka Kumar Mishra & Kirti Chawla, RTOS Design & Implementation, slideshare, 2014.

2

Smart Device Structure

8. Introduction to IoT

9. Smart Device RF & Anten-nas10. Introduction to RTOS

11. Introduction to Bluetooth

3

RTOS• Real-Time Operating System• A variant of OS that operates in

constrained environment in which computer memory and processing power is limited– Moreover they often need to provide

their services in definite amount of time.• Hard, Soft & Firm RTOS• Example RTOS: VxWorks, pSOS,

Nucleus, RTLinux

□ Courtesy to Mishra & Chawla, RTOS Design & Implementation, slideshare.

4

Types of RTOS

5

Structure of RTOS

Custom-Hardware

RTOS-kernel

Applications

BSP

□ Courtesy to Mishra & Chawla, RTOS Design & Implementation, slideshare.

6

Component of RTOS• The most important component

of RTOS is its kernel.– Monolithic & Microkernel

• BSP or Board Support Package makes an RTOS target-specific.– It’s a processor specific code onto

(processor) which we like to have our RTOS running.

□ Courtesy to Mishra & Chawla, RTOS Design & Implementation, slideshare.

7

RTOS Kernel

□ Courtesy to Mishra & Chawla, RTOS Design & Implementation, slideshare.

8

Task• A task is basic unit of execution

in RTOS. • RTOS scheduler needs to be

deterministic ~ O(1) or O(n). • Scheduling policies that are

available in a RTOS are:– Clock driven– Priority driven

□ Courtesy to Mishra & Chawla, RTOS Design & Implementation, slideshare.

9

Task Control Block

.

.

TID

SAVED_TASK_STATE

Resource 1 (signals)

Resource 2 (events)

Resource 3 (shared memory)

System Variables

□ Courtesy to Mishra & Chawla, RTOS Design & Implementation, slideshare.

10

Memory• Memory is premium in

environments where RTOS work.• Supports Virtual Memory (MMU:

Memory Management Unit) and Memory Protection (MPU) models.

• User space and Kernel space memory.

□ Courtesy to Mishra & Chawla, RTOS Design & Implementation, slideshare.

11

Virtual Memory Concept

Physical Address Virtual AddressM

.

.

.

.

.

PHY1 VIRT1

PHY2 VIRT2

PHY3 VIRT3

PHY4 VIRT4

□ Courtesy to Mishra & Chawla, RTOS Design & Implementation, slideshare.

12

Timer• Timer is SW entity derived from

hardware clock.• Timer provides mechanism to

introduce task-delays and/or to help synchronize and provide time off-course.

• Watchdog Timers, Programmable Timers

□ Courtesy to Mishra & Chawla, RTOS Design & Implementation, slideshare.

13

Inter-Process Com.• Most of the time tasks cannot

run in isolation. They require to talk to each other.

• Synchronization, Protection and Sharing are goals of IPC.

□ Courtesy to Mishra & Chawla, RTOS Design & Implementation, slideshare.

14

Device DriverClient Drivers

Protocol Layers

Host Controller Drivers

Hardware

□ Courtesy to Mishra & Chawla, RTOS Design & Implementation, slideshare.