Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
32Activity
0 of .
Results for:
No results containing your search query
P. 1
RTOS

RTOS

Ratings: (0)|Views: 628 |Likes:
Published by naikswathi

More info:

Published by: naikswathi on Feb 13, 2010
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, PDF, TXT or read online from Scribd
See more
See less

10/23/2012

pdf

text

original

 
Real-Time Operating SystemsPosted by HafsalTuesday, October 6, 2009comments (0)Real-Time System ConceptsReal-time SystemA real-time system is one whose logical correctness is based on both the correctneReal-time means computing with a deadline.In real-time computing a late answer is a wrong answer.Real-time doesn’t mean fast. It means being fast enough to meet the deadlines of tHard Real-time (HRT) SystemsHard real-time (HRT) systems are a subclass of RT systems in which missing of a deCost of missing deadlines is infinitely highLate results are uselessExamples:oAutomobile air bag deploymentSoft Real-Time (SRT) SystemsSoft real-time systems are a subclass of RT systems in which deadlines may be misExample:o Vending machineo Real-time videoo TelecommunicationReal-Time Design ApproachesThere are two primary techniques used in real-time designsSuper-loop (Grand-loop) techniqueo Employed in dedicated applicationso Control code is an infinite loop that may poll several deviceso Used when the main processing loop combined with worst case interrupt latencies io Suitable development approach for a small programming team.o Extremely difficult to guarantee that the deadlines will be meto CPU is 100% utilized even when the system is idle.MultitaskingoAlso called pseudo parallelismoSeveral threads of control runningo Each threads of control share the same CPU and communicate with each othero CPU is shared between threads of control using a scheduling policy implemented byo Scheduling policies can be either cooperative, priority-based or round-robinReal-Time Operating Systems
 
What is an RTOS?A Real- Time Operating System is a software that allows a program to:o React in a deterministic way to external eventso Communicate with peripherals and other taskso Share the CPU and resources between competing threads of execution in a predictabRTOS is a building block for an RT systemIt has a bounded behavior under all system load scenariosMultitasking RevisitedMultitasking is the process of scheduling and switching the CPU between several tMaximizes the utilization of the CPUFacilitates modular construction of applicationsSimplifies the design of application programsTaskA task (thread) is a simple program that thinks it has the CPU all to itself.A Real-Time application consists of several tasks executing concurrently.Each task is assigned a priority, its own set of CPU registers (context), and itsKernelDefinitionoKernel is the part of the multi-tasking system responsible for the management of tServicesoSchedulingoInter task communication services (Semaphore management, mail boxes, queues, timeSchedulerScheduler is the part of the kernel responsible for determining which task will ruMost real-time kernels are priority basedEach task is assigned a priority based on its importanceThe priority of each task is application specificControl is always given to the highest priority task ready to run.Context SwitchOccurs when a Multi-Tasking kernel decides to run a different taskSteps involved in a context switch1.Save current task’s context(CPU registers) in the current task’s context storage a2.Restore the new task’s context from it’s storage area (it’s stack).3.Resume execution of the new tasks code.Multiple Tasks Reentrancy
 
A reentrant function can be interrupted at any time and resumed at a later time wiIt either uses local variables or protects data when global variables are used.It can be used by more than one task without fear of data corruption.Critical Section & Mutual ExclusionA Critical Section is the code that needs to be executed indivisibly.Mutual Exclusion is used to ensure the exclusive access to a shared resource withoCommon Methods areoDisabling interruptsoDisabling schedulingoUsing Mutexes(Semaphore)Non-Preemptive KernelRequire that each task does something to explicitly give up the control of the CPUAlso called cooperative multitaskingISR always returns to the interrupted taskAdvantagesoLow interrupt latencyoIt can use Non-Reentrant functionsDisadvantagesoResponsiveness is very lawVery few real-time kernels are non-preemptive Preemptive KernelIt is used when system responsiveness is important.High priority task ready to run is always given control of the CPUMost real-time kernels are preemptive.Application code using a preemptive kernel should not use non-reentrant functionsTask States SynchronizationCommonly used synchronization primitives areMutexesoThe operations are
MutexLock()
MutexUnlock()SemaphoresoThe operations are
Signal()
Wait()SemaphoreTerm borrowed from railwaysIt is a flag that is set or reset by rtos on request from a threadOn a set request when it is already set, the task is blocked !On the later reset request, the blocked task is resumedQuestion: Why cant we use a global flag for the same purpose ?Reentrancy and semaphoresRoutines using global resources can be made reentrant by setting a semaphore while

Activity (32)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Sushma Pothula liked this
pavinod liked this
BDeebak liked this
tsenapathy liked this
kishan1234 liked this
swarna123456 liked this

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->