Vous êtes sur la page 1sur 6

DEPARTMENT OF ELECTRONICS & INSTRUMENTATION Date: 24/2/11 Question Bank: CS 2361 EMBEDDED SYSTEM TWO MARK QUESTIONS:

1 Define Interrupt An Interrupt is an asynchronous signal indicating the need for attention or a synchronous event in software indicating the need for a change in execution. A hardware interrupt causes the processor to save its state of execution and begin execution of an handler. Software interrupts are usually implemented as instructions in the instruction set, which cause a context switch to an interrupt handler similar to a hardware interrupt. Interrupts are a commonly used technique for computer multitasking, especially in real-time computing. Such a system is said to be interrupt-driven. An act of interrupting is referred to as an interrupt request (IRQ). 2 Mention the Strategies by which I/O device Communicate with CPU Polled Waiting loop Interrupt Driven I/O Direct Memory Access 3 Compare Interrupt & Exception An Interrupt is an asynchronous signal indicating the need for attention or a synchronous event in software indicating the need for a change in execution An exception is an event, which occurs during the execution of a program, that disrupts the normal flow of the program's instructions 4 what is ISR? An interrupt handler, also known as an interrupt service routine (ISR), is a callback subroutine in an operating system or device driver whose execution is triggered by the reception of an interrupt. Interrupt handlers have a multitude of functions, which vary based on the reason the interrupt was generated and the speed at which the interrupt handler completes its task. These handlers are initiated Powered By www.technoscriptz.com

by either hardware interrupts or interrupt instructions in software, and are used for servicing hardware devices and transitions between protected modes of operation such as system calls. 5 Define Interrupt Overrun When PSI sends EOI Command, before processing the data, there may be problem arise if the second input ready interrupt is obtained from the same device causes the ISR to reenter while still processing the previous interrupt, this situation is termed as Interrupt Overrun. 6Define Transfer rate It is measure of number of bytes per second transferred between the CPU & External device Fast Transfer rate is Provided by DMA than polled waiting loop. 7 what is Latency? Latency is measure of delay from the Instant that the device is ready until the time the first data byte is transferred. It is high in polled waiting loop very less in DMA. 8 Mention the various I/O instructions for reading from or writing to an I/O Port. Refer P:118 Fundamentals of Embedded Software by Daniel w.Lewis 9List the methodologies to reduce latency that is Imposed on Low Priority Interrupt by ISR Waiting loop to be removed from ISR Writing in Queue from Inside an ISR & Subsequently emptying it in the background loop. 10 How will you prevent the Interrupt overrun? By using ISR Busy flag. On the Entry of ISR, the Entire interrupt system is remain disabled the data is Removed from Interrupt request, EOI is sent to PIC .If flag is already Set another interrupt from the same device is in Progress or else ISR sets the flag ,reenables the entire system & proceeds to process the data.

Powered By www.technoscriptz.com

11 Define Thread. Thread of execution is the smallest unit of processing that can be scheduled by an operating system. It generally results from a fork of a computer program into two or more concurrently running tasks. when a process forks, it creates a copy of itself. Fork in a multithreading environment means that a thread of execution is duplicated, creating a child thread from the parent thread. 12 List the Thread states. Inactive: Thread is Unknown to the Scheduler Pending : Thread is waiting for External Event or shared Resource. Ready: Thread is waiting for Scheduler to Give its control Running : Thread is currently processing or Running 13 what is Scheduler? Scheduling refers to the way processes are assigned to run on the available CPUs, since there are typically many more processes running. This assignment is carried out by softwares known as a scheduler and dispatcher. 14Mention the scheduling Algorithms Round Robin Scheduling Priority based Scheduling Rate monotonic Scheduling 15 Define Semaphore A semaphore restricts the number of simultaneous users of a shared resource up to a maximum number. Threads can request access to the resource (decrementing the semaphore), and can signal that they have finished using the resource (incrementing the semaphore)." 16 what is Round Robin Scheduling?

Powered By www.technoscriptz.com

Round-robin (RR) is one of the simplest scheduling algorithms for processes in an operating system, which assigns time slices to each process in equal portions and in circular order, handling all processes without priority (also known as cyclic executive). Limitation: Round-robin scheduling may not be desirable if the sizes of the jobs or tasks are strongly varying. 17 what is PRIORITY SCHEDULING? Processes scheduling in which the scheduler selects tasks to run based on their priority. Priorities may be static or dynamic. Static priorities are assigned at the time of creation, while dynamic priorities are based on the processes' behavior while in the system. 18 what is Priority Inversion? Priority inversion is a situation where in lower priority tasks will run blocking higher priority tasks waiting for resource (mutex). For ex: consider 3 tasks. A, B and C, A being highest priority task and C is lowest. Look at sequence of context swaps A goes for I/O . unlocks mutex. C was ready to run. So C starts running. locks mutex B is ready to run. Swaps out C and takes mutex. A is ready to run. but A is blocked as mutex is locked by B.but B will never relinqishes the mutex as its higher Priority than C. 19 What is Mutex?
Mutex (mutual exclusion object) is a program object that is created so that multiple

program thread can take turns sharing the same resource, such as access to a file. when a program is started, it creates a mutex for a given resource at the beginning by requesting it from the system and the system returns a unique name or ID for it. After that, any thread needing the resource must use the mutex to lock the resource from other threads while it is using the resource. If the mutex is already locked, a thread needing the resource is typically queued by the system and then given control when the mutex becomes unlocked.

Powered By www.technoscriptz.com

20 what is Priority Ceiling Protocol? The priority ceiling protocol, which gives each shared resource a predefined priority ceiling. When a task acquires a shared resource, the task is hoisted (has its priority temporarily raised) to the priority ceiling of that resource. The priority ceiling must be higher than the highest priority of all tasks that can access the resource, thereby ensuring that a task owning a shared resource won't be preempted by any other task attempting to access the same resource. When the hoisted task releases the resource, the task is returned to its original priority level. Limitation: In priority ceiling protocol is that the priority of a task changes every time it acquires or releases a shared resource. These priority changes occur even if no other task would compete for the resource at that time. 21 what is Context Switching? Context switch is the computing process of storing and restoring state (context) of a CPU so that execution can be resumed from the same point at a later time. This enables multiple processes to share a single CPU. The context switch is an essential feature of a multitasking operating system. A context switch can mean a register context switch, a task context switch, a thread context switch, or a process context switchSwitching from one process to another requires a certain amount of time for doing the administration - saving and loading registers and memory maps, updating various tables and list 22 what is Cooperative multitasking? Threads should Explicitly call Kernel Routine to perform the Context switch,By calling this routine the thread relinquishes control of the processor allowing the another thread to run. the Context switch call is termed as Yield. 23List the situations the Kernel calls implicitly the scheduler. To terminate the Thread To wait for External Event to occur To wait for shared resource that is currently in use To sleep for some specified amount of time.

Powered By www.technoscriptz.com

24 Define deadlock Dead lock is situation in which two or more threads are blocked because they are waiting on each others resources. 25 what is Priority Inheritance protocol? The priority inheritance protocol, uses dynamic priority adjustments. When a lowpriority task acquires a shared resource, the task continues running at its original priority level. If a high-priority task requests ownership of the shared resource, the low-priority task is hoisted above the requesting task. The low-priority task can then continue executing its critical section until it releases the resource. Once the resource is released, the task is dropped back to its original low-priority level, permitting the high-priority task to use the resource it has just acquired.

Big Questions:
1 Explain how interrupt service routine is serviced in Embedded System. 2 Compare Preemptive& Non Preemptive Context Switching. Discuss briefly about the thread States during the Mechanism 3 What is the job of Scheduler? Discuss briefly about Rate monotonic, Priority based Scheduling Algorithm. 4What is Interrupt? How will you prevent the Interrupt overrun? 5 Differentiate Process, task and threads &its states. 6 Explain in brief about Interrupt Driven I/O. 7 Compare Semaphore & Mutex.(4) 8 Explain in detail how you will reduce the latency imposed on Lower priority interrupt while processing ISR.

Powered By www.technoscriptz.com

Vous aimerez peut-être aussi