1. Short note on RTOS
RTOS real time operating system is another important component that is present in an embedded system. Now whether it is a real-time operating system or a normal operating system the function of an operating system is to coordinate hardware and software. RTOS that is real-time operating systems is coordinating mainly it is doing the function of coordination between hardware and software. Now a question arise in our minds that why we are going for a real-time operating system? Because if you take the case of automatic chocolate vending machine or automatic washing machine here there is a lot of importance to time at this time interval the washing should be completed or within this time interval the draining should be completed. The spinning should be completed or drying should be completed. So likewise there is actually a lot of importance to time if you take most of the embedded systems time is actually a very critical thing. So if you miss the time limit or the deadline the functioning of that embedded system will be completely disturbed. So in that case we are going for real-time operating systems.
2. What is RTOS in embedded system?
A Real Time Operating System, commonly known as an RTOS, is a software component that rapidly switches between tasks, giving the impression that multiple programs are being executed at the same time on a single processing core.
In actual fact the processing core can only execute one program at any one time, and what the RTOS is actually doing is rapidly switching between individual programming threads (or Tasks) to give the impression that multiple programs are executing simultaneously.
An RTOS differs in that it typically provides a hard real time response, providing a fast, highly deterministic reaction to external events.
Scheduling Algorithms
When switching between Tasks the RTOS has to choose the most appropriate task to load next. There are several scheduling algorithms available, including Round Robin, Co-operative and Hybrid scheduling. However, to provide a responsive system most RTOS PI?'s use a pre-emptive scheduling algorithm.
Tasks and Priorities
In a pre-emptive system each Task is given an individual priority value. The faster the required response, the higher the priority level assigned. When working in pre-emptive mode, the task chosen to execute is the highest priority task that is able to execute. This results in a highly responsive system.
3. What are the design principles of RTOS to design an embedded system explain?
RTOS are Operating Systems (OS) which act in Real Time (RT). This means that RTOS have other purposes than general OS or embedded operating systems (EOS). Where the general OS have the goal to maximize the average throughput of tasks (data?), in RTOS the keyword is determinism. Real-time tasks have to be completed before a certain deterministic deadline. This requires that responses to stimulus must always execute within a constant amount of time. Violation of the specified timing constraints is (normally) considered catastrophic. Non real-time systems are considered correct if certain inputs map to certain outputs: the system (code and hardware) must always do the proper thing given some current state and input. Real-time systems must achieve the same logical correctness, but must achieve this logical correctness using constant time algorithms. Because of this additional requirement on executional behavior, the implementations of RTOS differ significantly from other OS, although the general principles are the same.
RTOS have 4 main responsibilities:
1. Task management and scheduling: The responsibility of task management includes the scheduling of the multiple tasks. Because scheduling is pure overhead, the RTOS implement scheduling algorithms which are not too complex. The simpler the algorithm, the faster, smaller (less memory) and more predictable the task will be executed.
2. Interrupt servicing; Most modern OS are interrupt- driven. This means that if there are no processes waiting to be executed, no I/O-devices requesting a service and no users waiting for an answer, the OS waits till something happens. Events are almost always signaled by an interrupt or a trap. A trap is an interrupt that is generated by the software, either after an error or after a specific request of a user program to execute a system service. For each type of interrupt there are separate code segments available in the OS.
3. inter-process communication and synchronization; Because there are tasks that have to communicate with each other, the need exists for synchronization of different tasks, as well as for data exchange between them. The RTOS should provide easy and safe IPC primitives which can be used for programmers to build their software systems. These primitives can have different effects on task scheduling (blocking, non-blocking, conditional blocking, blocking with time out), can use different degrees of coupling (named connection, broadcast, blackboard, object request broker) and buffering.
4. memory management; The job of the OS is memory allocation and memory mapping and to take action when a task uses memory that is not allocated (memory protection). Some of the points of attention in memory management in an RT-system are:
- Fast and deterministic memory management
- Page locking
- Dynamic allocation
- Memory mapping
- Memory sharing
- RAM Disks
4. What is Round-Robin Scheduling?
- Round robin is a pre-emptive algorithm
- The CPU is shifted to the next process after fixed interval time, which is called time quantum/time slice.
- The process that is preempted is added to the end of the queue.
- Round robin is a hybrid model which is clock-driven
- Time slice should be minimum, which is assigned for a specific task that needs to be processed. However, it may differ OS to OS.
- It is a real time algorithm which responds to the event within a specific time limit.
- Round robin is one of the oldest, fairest, and easiest algorithm.
- Widely used scheduling method in traditional OS.
Post a Comment
0 Comments