Real-Time Operating Systems: Dayang Norhayati Abang Jawawi

Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

REAL-TIME OPERATING SYSTEMS

Dayang Norhayati Abang Jawawi

Department of Software Engineering


Faculty of Computing
Universiti Teknologi Malaysia
email : [email protected]
Real-Time Operating Systems

n RTOS provides an "abstraction


layer" that hides from application
software the hardware details of
the processor (or set of processors)
upon which the application
software will run.
n In the development of real-time
embedded systems, the use of a
RTOS will increase the software
productivity and improve the
performance of the real-time
system.
2
Real-Time Operating Systems
RTOS vs. General OS
1. RTOS ability to schedule tasks on the basis of
external events, which are signaled to the
computer by interrupts.
2. RTOS is that their command interpreters are
usually rather simple and they do not include
many utility programs.
3. The goal of RTOS is usually to serve the system
it controls rather than human users
4. RTOS Deterministic timing behavior in RTOS
using mathematical formulas used to provide the
service time must strictly algebraic & not include
random timing components to avoid delay & miss
deadlines.
3
Real-Time Operating Systems
Structure
§The overall controller of all computer programs
§Directly controls all scheduling, mutual exclusion, data
transfer and synchronization activities.

nConsistsof software
which handles the
hardware of the system.
Executive
Application Real-world
program Kernel interfaces
Interfaces

nSelf-explanatory

§Provide detailed facilities to the executive.


§Called by the executive: executive behaves as the
manager & kernel as the executor. 4
Real-Time Operating Systems
Basic Services
synchronization and
mutual exclusion Scheduling

Share RAM Such as task delays


among tasks & time-out

<optional>

<optional>

Organizing & accessing hardware device


5
Real-Time Operating Systems
Basic Services
n Task Management

n This set of services allows application software


developers to design their software as a number of
separate "chunks" or “task”of software

n The main RTOS service in this category is the


scheduling of tasks as the embedded system is in
operation.

n Controls the execution of application software tasks,


and can make them run in a very timely and
responsive fashion.

6
Real-Time Operating Systems
Basic Services
n Inter-task Communication and Synchronization

n It possible for tasks to pass information from one to


another, without danger of that information ever
being damaged.

n They also make it possible for tasks to coordinate, so


that they can productively cooperate with one
another.

7
Real-Time Operating Systems
Basic Services
n Dynamic Memory Allocation Services

n allows tasks to "borrow" chunks of RAM memory


for temporary use in application software. The
memory are then passed from task to task, as a means
of quickly communicating large amounts of data
between tasks.

n very small RTOS kernels that are intended for tightly


memory-limited environments, do not offer this
service.

8
Example RTOS’s
n Micrium µc/OS II
http://www.ucos-ii.com/
n AvrX
http://www.barello.net/avrx/
n RTLinux
http://fsmlabs.com/developers/man_pages/
n QNX Neutrino
http://www.qnx.com/

9
µC/OS-II Introduction
n What is µC/OS-II ?
n MicoController Operating System Version 2
n based on uCOS 1.0 first published in 1992
n developed and tested on a PC (Windows 95,
Borland International C/C++ compiler V3.1-
v4.5)
n uCOS-II is actually targeted for embedded
systems
n Thousands of people around the world are
using µC/OS in all kinds of applications .

10
Books and Resources

n MicroC/OS-II The Real-Time Kernel Second


Edition
n Jean J. Labrosse,
n CMP Books, 1992
n MicroC/OS-II e-book (1st edition)
n Jean J. Labrosse
n CMP Books, 1999.
Homepage: www.micrium.com

11
µC/OS-II Introduction
n Features
n Portable
n most of µC/OS-II is written in ANSI C
n only target microprocessor-specific code written in
assembly language
n µC/OS-II can be ported to a large number of
microprocessors as long as the microprocessor
provides a stack pointer and the CPU registers can
be pushed onto and popped from the stack.
n µC/OS-II can run on

n most 8-bit, 16-bit, 32-bit or even 64-bit


microprocessors or micro-controllers and, DSPs

12
µC/OS-II Introduction
n Features (continued)

n ROMable
n µC/OS-II was designed for embedded application
n embed µC/OS-II as part of your product

n Source code
n ALL the source code for µC/OS-II are provided

13
µC/OS-II Introduction
n Features (continued)
n Scalable
n you can use only the services you need in your
application
n this feature can reduce the amount of memory (both
RAM and ROM)
n can reduce both the code and data space required by
µC/OS-II.
n Preemptive multitasking
n fully preemptive real-time kernel
n always run the highest priority task that is ready

n µC/OS-II can manage up to 64 tasks (8 of these


tasks for system use) 14
µC/OS-II Introduction
n Features (continued)
n Deterministic
n execution time of all µC/OS-II function and
services are deterministic
n can always know how much time µC/OS-II will
take to execute a function or a service.
n Task stacks
n each task requires its own stack
n each task can have a different stack size -> reduce
the amount of RAM needed in your application.
n stack checking feature – to determine exactly how
much stack space each task actually requires
15
µC/OS-II Introduction
n Features (continued)
n Services
n mailbox, queue, semaphore, time related function
and so on
n Interrupt Management
n interrupt can suspend the execution of a task or
resume the execution of a task
n interrupt can be nested up to 255 levels deep

16
µC/OS-II Introduction

n Features (continued)
n Robust and Reliable
n µCOS-II is based µuCOS,which has been used in
hundreds of commercial applications since 1992
n Applications : cameras, medical instruments,
musical instruments, engine controls, network
adapters, highway telephone call boxes, ATM
machines, industrial robots, and many more.

17
µC/OS-II Architecture

Application Software

uCOS-II uCOS-II Configuration


Software
Microprocessor Independent Application Specific

uCOS-II Port
Microprocessor Dependent

Microprocessor Timer Hardware

18
Revision on RTS Concepts
n Given the material from Chapter 2 of Labrosse., we will conduct a
short group quiz on these. T/F question.
n Critical section n Assigning task priorities
n Shared resources n Mutual exclusion
n Task n Deadlock
n Context switch n Synchronization
n Kernel n Event Flags
n Scheduler n Intertask communication
n Preemptive & Non- n Message Queues
Preemptive kernel
n Interrupts Latency
n Reentrancy
n Interrupts Response
n Round-Robin scheduling
n Interrupts Recovery
n Task Priority
n ISR Processing time
n Static priorities
n NMIs
n Dynamic priorities
n Clock Tick
n Priority inversions
n Memory Requirements 19
RTS Concepts
Student Teams-Achievement Division
n Teaching phase – base on RTS concepts
(from lecture & the given reference)
1. The students work in teams to make sure that
everyone has mastered the concepts.
2. Each student individually takes a quiz.
3. Next, the students take the test in group.
4. If students meet or exceed their previous
averages with their quiz scores, they get
point that are summed according to team
membership.
20
Thank You.

21

You might also like