Spread Spectrum Based Statistically Distributed
Total Page:16
File Type:pdf, Size:1020Kb
Proceedings of the 4th National Conference; INDIACom-2010 Computing For Nation Development, February 25 – 26, 2010 Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi Real Time Operating System (RTOS) Ashima Wadhwa [email protected] [Pursuing M.Tech-IT (Weekend) 5th Semester, G.G.S.I.P University Kashmere Gate] Working as Computer Science lecturer in Hindu Boys College Sonepat, Haryana. ABSTRACT applications. Such applications include embedded systems A Real-Time Operating System (RTOS) is one that supports (programmable thermostats, household appliance controllers), real-time applications and embedded systems. Real-time industrial robots, spacecraft, industrial control, and scientific applications have the requirement to meet task deadlines in research equipment. addition the logical correctness of the results. A Real-Time A RTOS facilitates the creation of a real-time system, but does Operating System (RTOS) is an operating system that not guarantee the final result will be real-time; this requires guarantees a certain capability within a specified time correct development of the software.RTOS does not necessarily constraint. The main difficulties in designing real-time systems have high throughput; rather, an RTOS provides facilities are related to time constraints: if an action is performed too which, if used properly, guarantee deadlines can be met late, it is considered as a fault (with different levels of generally or deterministically (known as soft or hard real-time, criticism). Designers need to use a solution that fully supports respectively).It will typically use specialized scheduling timing constraints and enables them to simulate early on the algorithms in order to provide the real-time developer with the design process a real-time system. tools necessary to produce deterministic behavior in the final system. Apart from deterministic in nature it is valued more for This paper will explain some Real-Time Operating Systems how quickly and/or predictably it can respond to a particular (RTOS) basics. The material presented here is not intended as event than for the amount of work it can perform over a given a complete coverage of different RTOSes and their features. period of time. For the purposes of simplification, I will briefly cover the most Designing applications for an embedded application is almost important features like categories, components, services, and always challenging, to say the least. One way to decrease the scheduling algorithm, interrupt handling, Inter task complexity of your application is to use a task-oriented design communication mechanism of an RTOS. and divide a project into different modules (or tasks). Each After we explore what constitutes an RTOS and why we might module is then responsible for some part of the application. want to use one, I’ll explain each of the basic components of a With such a system you would like to be able to specify that typical RTOS and show how these building blocks are some modules (or tasks) are more important than others. That integrated into the system. is, some tasks have real-time requirements. They have to respond quickly and correctly. If your system employs a KEYWORDS professional RTOS, features that prioritize tasks are already kernel: A basic unit of any OS that includes the functions for part of the package. In addition to task prioritization, a clean processes, memory, interrupts, task scheduling, interprocess and well-tested API is included that eases communicate communication and network subsystems in certain OSs. between different tasks. Process: A code that has its independent program counter values and an independent stack. CATEGORIES OF RTOS Task: A task is an independent process that takes control of the CPU when scheduled by a scheduler. Every task has a TCB. Hard RTOS: In Hard Real Time System where failure to meet Inter Process Communication: An output from one task (or time constraints leads to system failure. The RTOS used in this process) passed to another task through the scheduler. system is known as Hard RTOS. For example Rocket Priority inversion: A problem in which a low priority task launching. inadvertently does not release the process for a high priority task. Soft RTOS: In Soft Real Time System where no System Failure occurs but the performance is degraded by failure to INTRODUCTION meet time constraints. The RTOS used in these kinds of A real-time operating system (RTOS) is a systems is called Soft RTOS. For example Production House multitasking operating system intended for real-time Proceedings of the 4th National Conference; INDIACom-2010 Mobile & Hand hold RTOS: The devices such as mobiles, application you might not want to run the system tick handler laptops where power saving is a big issue uses the Mobile & each time a timer times out. For example, you might have an hands hold RTOS. For example Smart Phones. application that goes down in sleep mode to save power. The device only has to wake up if an external event occurs. If this DIFFERENCE BETWEEN RTOS AND OPERATING external event is an external interrupt, you can call the system SYSTEM (OS) tick handler from that external interrupt. This way the application only runs the RTOS when something actually An RTOS differs from common OS, in that the user when happens. Rest of the time it can be in sleep mode. using the former has the ability to directly access the microprocessor and peripherals. Such an ability of the RTOS 3) Software timers: Closely associated with the system tick helps to meet deadlines. Other differences are as follows: are software timers. Software timers ticks once for each system • RTOS is deterministic where as OS is not. tick, and is a convenient way to setup for example delays in an • Meeting the deadlines is mandatory in case of RTOS RTOS. but not in OS. • Whenever you switch on your system first control 4) Tasks: goes to the application in case of RTOS but in normal Tasks are like functions, each with its own stack and task system control goes to the OS. control block (TCB). Unlike most functions, however, a task is • RTOS needs more Priority levels. almost always an infinite loop. That is, once it has been • It is mandatory to use preemptive scheduling created, it will never exit. algorithm in case of RTOS but in OS any algorithm A task is always in one of several states. A task can be ready to can be used. be executed, that is, in the READY state. Or the task may be suspended (pending), that is, the task is waiting for something RTOS SERVICES to happen before it goes into the READY state. This is called the WAITING state. Here is a short description of the states we Two essential services of RTOS are inter-process will use in our RTOS. communication and scheduling in addition to other OS services. The services of an RTOS can be categorized as: State Description • Basic OS Services such as Memory Management, DORMANT This task is not available for scheduling Process Management, Device Management etc. • RTOS Main Services such as Real time scheduling, READY This task is ready to run Interrupt-latency control and uses of timers. RUNNING This is the currently-running task • Time Management Services like time allocation and WAITING This task is waiting for something. This de-allocation to attain efficiency in given time could be an event, a message or maybe for constraint. the RTOS clock to reach a specific value • (delayed). Priorities Management includes priorities allocation and priorities inheritance. • Time slicing for the process execution. Note: Different RTOSes may have different names for each of these • Predictability services which includes predictable states. timing behaviour and predictable task- synchronization. 5) Scheduler: The real key is designing the scheduler. Usually the data structure of the ready list in the scheduler is designed RTOS COMPONENTS to minimize the worst-case length of time spent in the Broadly we can divide RTOS in to following components. scheduler's critical section, during which preemption is inhibited, and, in some cases, all interrupts are disabled. But, 1) Kernel.: The core of an RTOS is known as the kernel. An the choice of data structure depends also on the maximum API is provided to allow access to the kernel for the creation number of tasks that can be on the ready list. There are two of tasks, among other things. major types of scheduler from which you can choose: a)Event-driven: 2) Systick: The heart beat of the kernel is the system tick, often It is also known as Priority-Controlled Scheduling Algorithm. called just systick. Without a system tick in the RTOS, nothing Usually different tasks have differing response requirement. will happen. For every system tick the kernel will check if a For example, in an application that controls a motor, a task switch needs to be performed. System tick can be keyboard and a display, the motor usually requires faster implemented with one of the hardware timers in the embedded reaction time than the keyboard and display. This makes an chip. Using a timer might not be the best way to go for all event-driven scheduler must in event-driven systems, every applications. If you for example have an energy sensitive task is assigned a priority and the task with the highest priority is executed. The order of execution depends on this priority. Real Time Operating System The rule is very simple: The scheduler activates the task that systems to prevent user tasks from doing this. Many embedded has the highest priority of all tasks that are ready to run. systems and RTOSs, however, allow the application itself to run in kernel mode for greater system call efficiency and also to permit the application to have greater control of the operating environment without requiring OS intervention.