1. what is a
non reentrant code?
Re entrant code is code which does not rely on being executed without interruption before completion. Reentrant code can be used by multiple, simultaneous tasks. Reentrant code generally does not access global data. Variables within a reentrant function are allocated on the stack, so each instance of the function has its own private data. Nonreentrant code, to be used safely by multiple processes, should have access controlled via some synchronization method such as a semaphore.
2. how
is RTOS different from other OS?
A RTOS offers services that allow tasks to be performed within predictable timing constraints
3. Is unix a multitasking or multiprocessing operating system? whats the difference between the two?
unix is a multitasking operating system, multiprocessing means it can run on multiple processors,
the multiproceesing os coordinates with multiple processors running in parallel.
4. what is a
core dump?
A core dump is the recorded state of the working memory of a computer program at a specific time, generally when the program has terminated abnormally includes the program counter and stack pointer, memory management information, and other processor and operating system flags and information a fatal error usually triggers the core dump, often buffer overflows, where a programmer allocates too little memory for incoming or
computed data, or
access to null pointers, a common coding error when an unassigned memory reference variable is accessed
5. what is stack overflow and heap overflow?
stack overflow occurs when when the program tries to access memory that is outside the region reserved for the call stack
call stack contains the subroutines called, the local variables
overflow occurs when too many functions are called,huge amount of local variables are allocated
6. windows also has multiple processes has process priotities switches between multiple process, how RTOS is different from that?
RTOS has predictable timing constranints
7. how
will u create a
process in UNIX or our OS OSE?
We can use thr fork system call to create a process in UNIX and in OSE the system call create_process is used.
8. what is a
flat memory model and a shared memory model?
in a flatmemory model the code and data segment occupies single address space.
in a shared model the large memory is divided into different segments and needs a qualifier to identify each segment
in a flat memory model the programmer doesnt need to switch for data and code
9. what is paging, segmentation y do we need it?
Paging
Paging is a techinque where in the OS makes available the data required as quickly as possible. It stores some pages from the aux device to main memory and when a prog needs a page that is not on the main memory it fetches it from aux memory and replaces it in main memory. It uses specialised algorithms to choose which page to replace from in main memory.
Caching
It deals with a concept where the data is temperorarily stored in a high speed memory for faster access. This data is duplicated in cache and the original data is stored in some aux memory. This concepts brings the average access time lower.
Segmentation
Segmentation is a memory management scheme. This is the technique used for memory protection. Any accesses outside premitted area would result in segmentation fault.
Virtual Memory
This technique enables noncontiguous memory to be accessed as if it were contiguous. Same as paging.
10. write a
code to check whether a
stack grows upwards or downwards?
void checkStack()
{
int i=2;
int j=3;
if(&i >
&j) printf("stack grown downwards");
else printf("stack grows upwards");
}
define 2 local variables one after other and try to print the address
11. why do we require semaphore?
For process synchronization, it is a mechanism to invoke the sleeping process to become ready for execution. Its mechanism where a process can wait for resources to be available.typical example is producer consumer process. The producer process creates resources and signals the semaphore
saying resource is available. Consumer process waiting on the semaphore gets the signal that resource is available.
12. write a
small piece of code protecting a shared memory variable with a semaphore?
int global_i;
void increment_shared_memory
{
wait(semaphore);
global_i++;
signal(semaphore);
}
13. what are the different types
of semaphores and where they are used?
Binary semaphore and counting semaphore. Binary semaphore is same as mutex. Binary semaphore
tries to protect only one resource.
Counting semaphore is used in case of multiple resource. For ex: we have 4 printers then the counting semaphore value will be init to 4. When it reaches 0, the task waiting on the semaphore is suspended.
14. what are the different inter process communications?
semaphore, mutex, message passing, shared memory, socket connections
15. what is present in .bss
The bss section contains uninitialized data, and is allocated at runtime. Until it is written to, it remains zeroed
16. what are the different segments of a program (code, data,stack,heap etc)
memory Segments: Code segment
This phrase used to refer to a portion of memory or of an object file that contains executable
computer instructions. It is generally readonly segment.
data segment
This is one of the sections of a program in an object file or in memory, which contains the global variables that are initialized by the programmer. It has a fixed size, since all of the data in this section is set by the programmer before the program is loaded. However, it is not readonly, since the values of the variables can be altered at runtime.
.bss
This segment of memory is part of data segment that contains uninitialized data (static variables).
These are initialized to 0 and later assigned values during runtime.
stack segment
This segment of memory is a special stack which stores information about the active subroutines of a task. It contains the return address to be branched to after a subroutine has finished execution. It contains local variables of the subroutines and the parameters that are passed to those sub routines.
heap segment
The segment of memory which is used for dynamic memory allocation is known as heap. It is the responsibility of the programmer to deallocate it after its use. Or alternatively it will be garbage
collected by the OS.
17. what is OS scheduling mechanism in our OSE?
18. how and wher the context related information is stored PCB i guess
19. what is a make command and what are al its uses?
20. what if no process responding how it is handled (watch dog timeout mechanism)
21. what is an ELF
Executable and Linking Format is a common standard file format for executables, object code, shared libraries, and core dumps.
22. what is priority inversion?
In a scenario where a low priority task holds a shared resource (example semaphore) that is required by a high priority task. This causes the execution of the high priority task to be blocked
until the low priority task has released the resource. This scenario is averted by the OS by increasing the priority of the lowproi process until it completes the task and releases the resources.
23. Locality of reference:It deals with a process accessing a resource multiple times. There are three type of localities namely
temporal A resource is referenced at point in time and will be referenced again in near future. spatial The concept that the likelihood of referencing a resource is higher if a resource near it has been referenced.
sequencial The concept of accessing the memory sequentially.
SHORT NOTES ON INTERRUPT HANDING
1) An interrupt is generated by some HW source or SW source
(timer or software event).
2) CPU invokes
the kernal interrupt handler.
3) Kernal
interrupt handler invokes
the vector handler
which returns the vector number. (Vector handler
has the mapping
from vector number
to interrupt source).
4) Kernal
invokes the mask handler which masks all existing equal or low priority interrupts.
5) In interrupt routine associated with the vector
number is invoked.
6) Kernal invokes
the mask handler
again to restore
old mask.
THREAD POOLING
Thread pool is a collection of managed threads
usually organized in a
queue, which execute the tasks in the task queue.
Creating a new thread
object every time you need something to be
executed asynchronously is expensive. In a thread
pool you would
just add the tasks you wish to be executed asynchronously to the task queue
and the thread pool takes care of assigning an available thread,
if any, for the corresponding task.
As soon as the task is completed, the the now available thread requests another
task (assuming there is any left).
DIFFERENT TYPES OF MEMORY FRAGMENTATION
In computer storage, fragmentation is a phenomenon in which storage space is used inefficiently, reducing storage capacity and in most cases performance. The term is also used to
RTOS VS GENERAL PURPOSE OS
The biggest difference is determinacy. An RTOS will have a deterministic scheduler. For any given set of tasks your process will always execute every number of microseconds or milliseconds exactly, and the same number from schedule to schedule. operating system services consume only known and expected amounts of time
In UNIX or Windows the scheduler are usually softrealtime (as opposed to some hardreal
time RTOS). Softrealtime means that the scheduler tries to assure your process runs every X number of milliseconds, but may fail to do so on some occasions.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1) What is RTOS and why do we go for it?
RTOS sheludes execution in a timely manner,manages system resources and provides a consistent foundation for developing application code.
Application code designed for RTOS could be ranging from simple digital stopwatch to complex aircraft navigation systems.
RTOS differs from the GPOS by
Task scheduling : RTOS like vxWorks,neclueos, uC/OSII uses a strict scheduling algorithms (like pre-emptive scheduling) that makes the tasks meet their deadline to get the job done.
The sheduler decides which task run when by knowing its priorities.Whereas In a GPOS, the scheduler typically uses a "fairness" policy that offers no assurances that high-priority, time-critical tasks will execute in preference to lower-priority tasks.This policy is maintained to obtain the overall output by the desktop pc or server pc.
2) What are the different types of semaphores in vxworks RTOS? Which is the fastest?
VxWorks supports three types of semaphores.
1) Binary 2) mutual exclusion, and 3)counting semaphores.
Fastest : Binary semaphore.
3. What is priority inversion ? why priority inversion occurs?
Tasks in RTOS's communucates between them via IPC source semphores for synchornization.
The situation priority inversion occurs when a higher priority taks is ready to run but it is waiting for a shared resource that is to be released by a lower priority task currently running .Now higher-priority task is pending on the resource and it has to wait until the lower priority task to finish.
4. What are the solutions for priority inversion ?
1) Priority inheritance
2) Priority ceiling
5. What is super loop ?
Super loop is the infinite loop that runs all the time because , most of the embedded systems has no OS in it to return to application.
//Super loop example while(true) { //all other code } //or for(;;) { } //or label: //This is is tricky assembly version goto label:
6) What is the difference between Structure and union? Where do we use union?
When a structure is defined the compiler allocates memory for all of its member variables with necessary alignment .Whereas for unions the compiler allocates memory for the highest the union is equal to the biggest size of member from the union member variable list.union can only store information in one field at any one time.
#include <stdio.h> struct mStruct { char name[10]; int age; float height; }; union mUnion { char name[15]; int age; float height; }; int main(void) { union mUnion uTest; struct mStruct sTest; strcpy(sTest.name,"sTest"); sTest.age = 20; sTest.height = 6.1; strcpy(uTest.name ,"uTest"); uTest.height = 6.0; uTest.age = 20; printf("\n"); printf("sizeof(uTest) = %d ,sizeof(sTest) = %d \n",sizeof(uTest),sizeof(sTest)); printf("uTest.age = %d , uTest.height = %f , uTest.name = %s\n",uTest.age, uTest.height, uTest.name); printf("sTest.age = %d , sTest.height = %f , sTest.name = %s\n",sTest.age, sTest.height, sTest.name); printf("\n"); }7) Convert number 2 --> 37 without using any other operator but bitwise ?
Answer: int x = 2; printf("X before :%d\n",x); x = (x<<x<<x) | (x<<x<<x) | x<<!!x | !!x ; printf("X After :%d\n",x);
8) Set , Get , Clear ,Toggle , Display Bits ?
// Display Every bits in a int number void displayBits(int data) { int dataSize = 1<<sizeof(data); int count = 0; for (count = dataSize;count >= 0; count--) { printf("%d",(testBit(data,count))); } } // test a bit if it is zero or one int8_t testBit(int8_t value,int whichBit) { int mask = 1 << whichBit; if (value&mask) { return TRUE; } else return FALSE; } // Set a bit to one int8_t setBit(int8_t result, int whichBit) { return (result |= (1<<whichBit)); } // toggle a bit int8_t toggleBit(int8_t result, int whichBit) { return (result ^= (1<<whichBit)); } /* Clear a bit to zero */ int8_t clearBit(int8_t result, int whichBit) { return (result &=~ (1<<whichBit)); }
/////////////////////////////////////////////////////////////////////////////////////////////
this link provides you to learn more
http://interviewquestionsanswers.org/_RTOS
http://www.allinterview.com/interview-questions/217/rtos.html
http://www.globalguideline.com/interview_questions/Questions.php?sc=Real-Time_Operating_System_RTOS
/////////////////////////////////////////////////////////////////////////////////////////////
In this post you will get know about Real-time system
and its entire scenario. This will prove helpful to you for your
Interview purpose as well as for your academic preparation. You can also
download the Real-Time systems Interview question in PDF format by
clicking the link provided at the end of the Article. we always look for
serve better. Please put your suggestions and comments in the box
provided below the Article. Wish you All the Best for your Preparation!!
Q1: What do you mean by a real-time system?
Ans: A real-time system is one that must process information and produce a response within a specified time, else risk serve consequences, including failure. That is, in a system with a real-time constraint it is no good to have the correct action or the correct answer after a certain deadline: it is either by the deadline or it is useless.
Ans: A real-time system is one that must process information and produce a response within a specified time, else risk serve consequences, including failure. That is, in a system with a real-time constraint it is no good to have the correct action or the correct answer after a certain deadline: it is either by the deadline or it is useless.
We can also say that
any information processing activity or system which has to respond to
externally generated input stimuli within a finite and specified period.
Q2: Discuss issues in real-time system scenario.
Ans: Most important issues regarding real-time systems are:
Ans: Most important issues regarding real-time systems are:
- Recovering from Failures.
- Working with distributed Architectures.
- Asynchronous Communication
- Race Conditions and Timing.
- Real Time response.
Q3: What is an Embedded system? Differentiate between embedded system and real-time system.
Ans: An embedded system
is some combination of computer hardware and software, either fixed in
capability or programmable, that is specifically designed for a
particular function.
OR
It can be defined as “A specialized computer system that is part of a larger system or machine”.
Embedded
systems are the ones found in generally immutable machines, such as
ATMs, internet kiosks, airport terminal displays, cellphones,or at the
screen at McD that displays your order are all examples of embedded
systems. Real-time systems are the ones that are designed to provide a
result within a specific time-frame. If you are using a touch-screen to
order a sandwich from a gas store chain, you don’t want to have to wait
20 seconds for it to display pictures of each of the ingredients. You
want it “now”, or at least within a second or two of pushing the button.
Q4: Explain real-time communications.
Ans: Real-time communications (RTC) is any mode of telecommunications in which all users can exchange information instantly or with negligible latency. In this context, the term “real-time” is synonymous with “live.”
Ans: Real-time communications (RTC) is any mode of telecommunications in which all users can exchange information instantly or with negligible latency. In this context, the term “real-time” is synonymous with “live.”
RTC can take
place in half-duplex or full duplex modes.In half-duplex RTC, data can
be transmitted in both directions on a single carrier or circuit but not
at the same time. In full-duplex RTC, data can be transmitted in both
directions simultaneously on a single carrier or circuit. RTC generally
refers to peer-to-peer communications, not broadcast or multicast.
Real-time communications can include:
- Telephony in the conventional sense
- Mobile and cellular telephone.
- IM (instant messaging)
- VoIP (Voice over IP, also called Internet telephone).
- Live videoconference communications.
Q5: Define Hard and Soft real-time system.
Ans: A hard real-time system (also known as an immediate real-time system) is hardware or software that must operate within the confines of a stringent deadline. The application may be considered to be failed if it does not complete its function within the allotted time span. Examples of hard real-time systems include components of pacemakers, anti-lock brakes and aircraft control systems.
Ans: A hard real-time system (also known as an immediate real-time system) is hardware or software that must operate within the confines of a stringent deadline. The application may be considered to be failed if it does not complete its function within the allotted time span. Examples of hard real-time systems include components of pacemakers, anti-lock brakes and aircraft control systems.
A
soft real-time system is a system where a critical real-time task gets
priority over other tasks and retains that priority until it completes.
As in hard real time systems, kernel delays need to be bounded.
Q6: Draw structure or block diagram of Real time system OR the components of the RTS.
Ans: Schematic block diagram of a Real time system.
Ans: Schematic block diagram of a Real time system.
Q7. Describe Trigger Generator?
Ans: The “Trigger generator” is a representation at the mechanism used to trigger the execution of individual jobs. It is not really a separate hardware unit, typically it is a part of an executive software. Many of the jobs are periodic i.e. they execute regularly. The schedule for these jobs can be obtained offline and loaded as a look up table to be used by the scheduler.
Ans: The “Trigger generator” is a representation at the mechanism used to trigger the execution of individual jobs. It is not really a separate hardware unit, typically it is a part of an executive software. Many of the jobs are periodic i.e. they execute regularly. The schedule for these jobs can be obtained offline and loaded as a look up table to be used by the scheduler.
Q8. Define real time database and give its types.
Ans: A real-time database system is a database system in which a timely response to a user request is needed.
Ans: A real-time database system is a database system in which a timely response to a user request is needed.
Types of Real-Time Database Systems:
• Hard real-time database systems, e.g., safety-critical system such as an early warning system, etc.
• Soft real-time database systems, e.g., banking system,
airline reservation system, digital library, stock market
system, etc.
• Mixed real-time database systems, e.g., air traffic
control system, etc.
• Soft real-time database systems, e.g., banking system,
airline reservation system, digital library, stock market
system, etc.
• Mixed real-time database systems, e.g., air traffic
control system, etc.
Q.9. Explain all types of task classes in real time system?
Ans: There are five types of task classes:
Ans: There are five types of task classes:
(i) Periodic and aperiodic tasks
(ii) Sporadic task
(iii) Critical task
(iv) Noncritical task
(ii) Sporadic task
(iii) Critical task
(iv) Noncritical task
(1) Periodic task: There
are many tasks in real — time systems that are done repeatitively. For
example one may wish to monitor the speed altitude and attitude of an
aircraft every 100 ms. This sensor information will be used by periodic
tasks that control surfaces of the aircraft in order to maintain
stability and other desired characteristics. The periodicity of these
tasks is known to the designer, and much tasks can be pre-scheduled.
(2) Aperiodic task: There
are many other tasks that are aperiodic, that occur occasionally. For
instance, when the pilot wishes to execute a turn a large number
of subtasks. Associated with that action are self off aperiodic tasks
cannot be predicted and sufficient completing power must be held in a
reserve to execute them in a timely fashion.
(3) Critical tasks: Critical
tasks are those whose timely executions is critical; if deadlines are
missed, catastrophes occur. Example include life – support systems and
the stability control of air craft. If critical tasks are executed at a
higher frequency then it is absolutely necessary.
(4) Non critical tasks: Non
critical tasks are real times tasks. As the name implies, they are not
critical to the application. However they do deal with time varying data
and hence they are useless if not completed within a deadline. The goal
in scheduling these tasks is to maximize the percentage of jobs
successfully executed within their deadlines.
Q10: Define TargetOS.
Ans: TargetOS is a full-featured real-time operating system (RTOS) from Blunk Microsystems designed specifically for embedded applications. TargetOS is fast, small, and preemptive. To help reduce your time to market, TargetOS is integrated with development tools and off-the-shelf board support packages. Custom board support packages and drivers are also available.
Benefits:
Ans: TargetOS is a full-featured real-time operating system (RTOS) from Blunk Microsystems designed specifically for embedded applications. TargetOS is fast, small, and preemptive. To help reduce your time to market, TargetOS is integrated with development tools and off-the-shelf board support packages. Custom board support packages and drivers are also available.
Benefits:
- Royalty Free
- Source Code
- Integrated with TargetTools
- Integrated Event Trace Tool
- Board Support Packages and Device Drivers.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
RTOS has become very important as it is concerned with time critical events. Okay, let me list down few of the famous RTOS questions that can be discussed here.
1. What is priority inversion ?
2. What are the solutions for priority inversion ?
3. What is priority inheritance ?
4. What is priority ceiling ?
5. What is deadlock ?
6. What is the famous diners problem ?
7. What is mutex ?
8. What is spinlock ?
9. Where are spinlocks used ?
10. What do you mean by atomic operations ?
11. what is a semaphore ?
12. What are the types of semaphore ?
13. What is binary semaphore ?
14. What is a counting semaphore ?
15. What is message queue ?
16. What is the role of a scheduler ? How does it function ?
17. What is the difference between a normal OS and RTOS ?
18. What is preemption ?
19. What is preemptive multi-tasking/time-sharing ? What is its difference with co-operative multi-tasking/time-sharing ?
20. Threads are described as lightweight because switching between threads does not involve changing the memory context - True/False ?
21.What are the factors considered for a RTOS selection ?
22. What is the use of the method of temporarily masking / disabling interrupts ? When is it used ? What should be taken care while doing this method ?
23. Since, disabling/masking of interrupts can be done whent the critical section is ONLY SHORT,What method can be used if the critical section is longer than few source lines or if it involves few lengthy loopings ?
24. Difference between semaphores and disabling/masking of interrupts method ?
25. Binary semaphore is equivalent to Mutex - True/False. How ?
26. How can you avoid deadlocks incase of semaphore based designs ?
27. What is Message passing method ? What is its advantages ?
28. Tell about the design of Interrupt Handler and Scheduler in RTOS ?
29. What is interrupt latency ?
30. Even if we never enables interrupts in the code, the processor automatically disables them often during hardware access - True/False ? In this case how to reduce interrupt latency ?
31. When should we re-enable the interrupts in an ISR and why ?
32. How do you measure the latency of your system ?
33. What are First Level Interrupt handlers and Second level Interrupt handlers ?
34. What could be the typical design/implementation of FLIH and SLIH ?
35. Reentrant interrupt handlers might cause a stack overflow from multiple preemptions by the same interrupt vector - True / False ?
36. What kind of memory allocation procedure is good for embedded systems ?
37. Is there any RTOS that has non-preemptive scheduling ?
38. What is reentrant code ?
39. What is preemptive multitasking ?
40. What does timeslice refer to ?
41. If the time slice is too short then the scheduler will consume too much of processing time - True / False
42. What is I/O bound ? What is CPU bound ?
43. What is non-preemptive multitasking ?
44. CFS uses 'nanosecond' granularity accounting, the atomic units by which individual process share the CPU instead of previous notion of 'timeslice' - True/False .
45. When will you use binary semaphore ?
46. When will you choose busy-wait instead of context switch ?
47. What are the possible scenarios in which context switching of threads can occur ?
48. Can you use mutex/semaphore inside an ISR ?
49. Explain a scenari that could cause deadlock ? What is the best solution for a deadlock ?
50. Will the performance of your application improve if it has only a single thread and it is running on multiple cores of a processor ?
51. What will happen if there are more threads requesting for CPU resource such as time ?
52. What is Gang Scheduling and how is it useful ?
53. Can you sleep in interrupt handler ?
54. What is the main drawback for not considering Linux as realtime / RTOS ?
55. What is the drawback in using semaphore for synchronization ? How does spinlock help in overcoming it ?
56. What does a semaphore consist of ? and What does a spinlock consist of ?
57. Why spinlocks are useless in uniprocessor systems ?
58. What is timeslice ?
59. What is the difference between multiprogramming and multiprocessing ?
60. What is parallel programming ?
61. What are the types of IPC mechanisms ?
62. What are the types of synchronization problems and what are the resources that can cause such problems ?
63. What is data race ?
64. What is Indefinite Postponement / Indefinite blocking or starvation ?
65. What are the synchronization relationships that are present in a multithreaded or mulitprogramming applications ?
66. How Many Processes or Threads Are Enough for an application ?
67. Tell the advantages and disadvantages of Co-operative multitasking.
67. When should we use mutex and when should we use semaphore ?
for answers see this link
http://embedded-telecom-interview.blogspot.in/2010/06/rtos-interview-questions.html
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Major Concerns of selecting RTOS
1) Interuppt latency2) Footprint (size of the executable which is generated
after compiling)
3) Context switching time is also considered as vital
element in selection
Linux and Real Time
Linux is built as a general-purpose multiuser operating system. General-purpose operating systems are tuned to maximize average throughput even at the expense of latency, while real-time operating systems attempt to minimize, and place an upper bound on, latency, sometimes at the expense of average throughput. There are several reasons why standard Linux is not suitable for real-timeuse:
- Non-preemptive kernel procedure – This is a fancy way of saying that kernel system calls are not preemptible. Once a process enters the kernel, it can’t be preempted until it’s ready to exit the kernel. If an event occurs while the kernel is executing, the process waiting for that event can’t be scheduled until the currently executing process exits the kernel. Some kernel calls, fork() for example, can hold off preemption for tens of milliseconds.
- Paging – The process of swapping pages in and out of virtual memory is, for all practical purposes, unbounded. We have no way of knowing how long it will take to get a page off a disk drive and so we simply can’t place an upper bound on the time a process may be delayed due to a page fault.
- Fairness in Scheduling – Reflecting its Unix heritage as a multi-user time-sharing system, the conventional Linux scheduler does its best to be fair to all processes. Thus, the scheduler may give the processor to a low-priority process that has been waiting a long time even though a higher-priority process is ready to run.
- Request Reordering – Linux reorders I/O requests from multiple processes to make more efficient use of hardware. For example, hard disk block reads from a lower priority process may be given precedence over read requests from a higher priority process in order to minimize disk head movement or improve chances of error recovery.
- Batching – Linux will batch operations to make more efficient use of resources. For example, instead of freeing one page at a time when memory gets tight, Linux will run through the list of pages, clearing out as many as possible, delaying the execution of all processes.
Major Concerns of selecting RTOS
1) Interuppt latency2) Footprint (size of the executable which is generated
after compiling)
3) Context switching time is also considered as vital
element in selection
Linux and Real Time
Linux is built as a general-purpose multiuser operating system. General-purpose operating systems are tuned to maximize average throughput even at the expense of latency, while real-time operating systems attempt to minimize, and place an upper bound on, latency, sometimes at the expense of average throughput. There are several reasons why standard Linux is not suitable for real-timeuse:
- Non-preemptive kernel procedure – This is a fancy way of saying that kernel system calls are not preemptible. Once a process enters the kernel, it can’t be preempted until it’s ready to exit the kernel. If an event occurs while the kernel is executing, the process waiting for that event can’t be scheduled until the currently executing process exits the kernel. Some kernel calls, fork() for example, can hold off preemption for tens of milliseconds.
- Paging – The process of swapping pages in and out of virtual memory is, for all practical purposes, unbounded. We have no way of knowing how long it will take to get a page off a disk drive and so we simply can’t place an upper bound on the time a process may be delayed due to a page fault.
- Fairness in Scheduling – Reflecting its Unix heritage as a multi-user time-sharing system, the conventional Linux scheduler does its best to be fair to all processes. Thus, the scheduler may give the processor to a low-priority process that has been waiting a long time even though a higher-priority process is ready to run.
- Request Reordering – Linux reorders I/O requests from multiple processes to make more efficient use of hardware. For example, hard disk block reads from a lower priority process may be given precedence over read requests from a higher priority process in order to minimize disk head movement or improve chances of error recovery.
- Batching – Linux will batch operations to make more efficient use of resources. For example, instead of freeing one page at a time when memory gets tight, Linux will run through the list of pages, clearing out as many as possible, delaying the execution of all processes.
Major Concerns of selecting RTOS
1) Interuppt latency2) Footprint (size of the executable which is generated
after compiling)
3) Context switching time is also considered as vital
element in selection
Linux and Real Time
Linux is built as a general-purpose multiuser operating system. General-purpose operating systems are tuned to maximize average throughput even at the expense of latency, while real-time operating systems attempt to minimize, and place an upper bound on, latency, sometimes at the expense of average throughput. There are several reasons why standard Linux is not suitable for real-timeuse:
- Non-preemptive kernel procedure – This is a fancy way of saying that kernel system calls are not preemptible. Once a process enters the kernel, it can’t be preempted until it’s ready to exit the kernel. If an event occurs while the kernel is executing, the process waiting for that event can’t be scheduled until the currently executing process exits the kernel. Some kernel calls, fork() for example, can hold off preemption for tens of milliseconds.
- Paging – The process of swapping pages in and out of virtual memory is, for all practical purposes, unbounded. We have no way of knowing how long it will take to get a page off a disk drive and so we simply can’t place an upper bound on the time a process may be delayed due to a page fault.
- Fairness in Scheduling – Reflecting its Unix heritage as a multi-user time-sharing system, the conventional Linux scheduler does its best to be fair to all processes. Thus, the scheduler may give the processor to a low-priority process that has been waiting a long time even though a higher-priority process is ready to run.
- Request Reordering – Linux reorders I/O requests from multiple processes to make more efficient use of hardware. For example, hard disk block reads from a lower priority process may be given precedence over read requests from a higher priority process in order to minimize disk head movement or improve chances of error recovery.
- Batching – Linux will batch operations to make more efficient use of resources. For example, instead of freeing one page at a time when memory gets tight, Linux will run through the list of pages, clearing out as many as possible, delaying the execution of all processes.
and see this ,you will found some more
http://chinswe.webs.com/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Your blog is so nice and you tell very important things to throw your blog. we are the best coaching for Bank Po in Jaipur and SSC coaching in Jaipur, we provide best services in Jaipur.
ReplyDeletethank you
ReplyDeleteIAS is one of the most aware positions in India. In the event that you need to be an IAS in future, at that point joins Ramanasri IAS Institute, which is the best IAS instructing in Delhi. India's best IAS personnel show classes with their commitment. Best investigation materials, current issues magazines, current issues classes and NCERT notes are given to understudies to their planning. Ramanasri IAS Institute begins online test arrangement for UPSC Prelims 2020. The course is finished in time and corrections are held after course fruition. Presently, Ramanasri IAS Institute began GS expansion bunch for UPSC 2021. The restricted seat is accessible, Hurry! Up to get enlistment. ias electrical engineering paper
ReplyDeleteSharma Academy consists of the best minds from academics. Thhis is top quality coaching institutes of Central India. The institute has achieved status of distinction following the path envisioned by its founder. The institute has been very successful in making potential aspirants realize their dreams which is evident from the success stories of the previous years. It is Perfect Coaching for MPPSC in Indore. Providing Best MPPSC Coaching in Indore, MPPSC Notes, MPPSC Syllabus, MPPSC Online Coaching Available.
ReplyDeleteNice post Here also read watchdog timer in embedded system
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThank You for sharing these Operating System Interview Questions and Answers. It will help those who want to crack OS interview.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteJava Training in Chennai
ReplyDeleteJava Online Course
Java Training in Bangalore
Java Training in Coimbatore
CDS coaching in India refers to specialized training programs aimed at preparing candidates for the Combined Defence Services (CDS) examination. The CDS exam is conducted by the Union Public Service Commission (UPSC) and serves as a gateway for individuals aspiring to join the Indian Army, Navy, and Air Force as officers.
ReplyDelete