28 votes 28 votes Which of the following devices should get higher priority in assigning interrupts? Hard disk Printer Keyboard Floppy disk Operating System gate1998 operating-system interrupts normal + – Kathleen asked Sep 25, 2014 • edited Feb 22, 2018 by go_editor Kathleen 12.3k views answer comment Share Follow See all 4 Comments See all 4 4 Comments reply shree commented Jan 22, 2015 reply Follow Share How can we understand priority among those? 1 votes 1 votes shree commented Jan 22, 2015 reply Follow Share among these options can say that keyboard has the maximum priority. but if options are different , how we can comment? 1 votes 1 votes smsubham commented Mar 9, 2018 reply Follow Share @shree Check this: https://gateoverflow.in/1657/gate1998-1-20 0 votes 0 votes Akhilesh Singla commented May 3, 2018 reply Follow Share In peripherals, priority is given based on the speed of the device. Higher the speed, higher the priority. Hard disk has the highest speed(MBps) among the given options and thus has the highest priority. Whereas, keyboard is the slowest one because we humans write so slow(like 1-3 word per second) when compared to CPU, and thus keyboard has lowest priority. You may have noticed sometimes that when you are copying/moving a large file on to your hard disk from other device, like pen drive, and then you try to type something using keyboard the typed words are shown with some lag. This is because of the priority being given to hard disk right now. 30 votes 30 votes Please log in or register to add a comment.
Best answer 37 votes 37 votes It should be a Hard disk. I don't think there is a rule like that. But hard disk makes sense compared to others here. http://www.ibm1130.net/functional/IOInterrupts.html Arjun answered Jan 22, 2015 • selected Jan 17, 2017 by naga praveen Arjun comment Share Follow See all 25 Comments See all 25 25 Comments reply Anurag_s commented Jan 22, 2015 reply Follow Share Arjun i was thinking about virtual memory here that if virtual memory implemented then secondary storage may have higher priority. Is it the right way to think about it. 9 votes 9 votes Arjun commented Jan 23, 2015 reply Follow Share Makes sense. Also, that should be for the primary hard disk. We can have many hard disks on a machine and it is not necessary to give all of them higher priority than the keyboard. 7 votes 7 votes Mithlesh Upadhyay commented Apr 10, 2015 i reshown by Arjun Mar 5, 2016 reply Follow Share The transfer rate of hard disk (memory) device is higher than the transfer rate of keyboard (input device) . so there should be hard disk is higher priority than the keyboard , ..... is correct ??? 3 votes 3 votes Arjun commented Apr 10, 2015 reply Follow Share why transfer rate matters here? Priority is based on how critical a device is. In many real time systems, keyboard should have the top priority but on a computer system, I guess this is a bit ambiguous. 7 votes 7 votes Dexter commented Nov 30, 2016 reply Follow Share @arjun sir : By transfer rate . it can be like if its give high tarnsfer rate then old data would be getting repleced by next data very soon so now to avoid data loss , hardisk has a higher priority ? is it ryt ? 2 votes 2 votes Arjun commented Nov 30, 2016 reply Follow Share No. Data overwritten from where? 0 votes 0 votes vaishali jhalani commented Dec 17, 2016 reply Follow Share If hard disk is writing in some buffer and cpu does not respond it then there could be some data overwritten.. Due to its speed it should have high priority.. as keyboard input given by the user will not as fast as data written by disk into buffer, same case with mouse also. 0 votes 0 votes Arjun commented Dec 17, 2016 reply Follow Share @Vaishali Any reference? 0 votes 0 votes vaishali jhalani commented Dec 18, 2016 reply Follow Share No reference..from My notes only.. 0 votes 0 votes Arjun commented Dec 18, 2016 reply Follow Share Then it is like old 1000 note :) 5 votes 5 votes vaishali jhalani commented Dec 18, 2016 reply Follow Share So...this is not the proper reason? 2 votes 2 votes Arjun commented Dec 18, 2016 reply Follow Share No. I do not know what that buffer is even. See here for working of harddisk http://superuser.com/questions/832199/understanding-cpu-ram-and-hard-disk-drive 1 votes 1 votes vaishali jhalani commented Dec 18, 2016 reply Follow Share Speed differences between two devices. A slow device may write data into a buffer, and when the buffer is full, the entire buffer is sent to the fast device all at once. So that the slow device still has somewhere to write while this is going on, a second buffer is used, and the two buffers alternate as each becomes full. Source: Peter Baer Galvin, "Operating System Concepts" 3 votes 3 votes Arjun commented Dec 18, 2016 reply Follow Share What is the fast device here? 1 votes 1 votes vaishali jhalani commented Dec 18, 2016 reply Follow Share May be processor.. 2 votes 2 votes GateAspirant999 commented Jun 9, 2017 reply Follow Share When I read problem, I felt it should be keyboard, as initially BIOS is loading and it has to respond to any commands from keyboard. Till that disk is not yet accessed. And any command fed from keyboard has to be abided over anything from disk (as I already said disk is not loaded, so in fact nothing will come from disk). So as a pure command input, keyboard should be given higher priority. But then I read the answer and it says disk. So I googled it a bit and come up with these links which also think keyboard should be the answer: http://gategeeks.blogspot.in/2014/11/gate-questions-set-3.html http://cs.btechonline.org/index.php/questions/view?id=20 So whats right? 0 votes 0 votes VS commented Nov 2, 2017 reply Follow Share @Arjun sir I think I read it somewhere that floppy disks can be used in case of system recovery (System Disk). And whenever we first start the computer floppy disks are read first. So, may be floppy disks should get highest priority. 1 votes 1 votes akash.dinkar12 commented Jul 7, 2018 reply Follow Share @Arjun Sir why transfer rate matters here? Priority is based on how critical a device is. In many real-time systems, a keyboard should have the top priority but on a computer system, I guess this is a bit ambiguous. The speed of I/O devices matters here because if we talk about keyboard then one can maximum type 3-4 characters in 1 sec. and within 1 sec, our CPU can execute millions of instructions(MIPS) depends on a frequency of the processor, main memory, and cache data transfer rate is faster than a keyboard, printer, scanner etc.. If CPU will service interrupt of the keyboard then there will be a chance that MM which has high data generating speed within some buffer, we might lose some data that is the reason CPU has to first service interrupt of higher speed device than compare to slower ones. That is how interrupt driven priority based I/O implemented. 0 votes 0 votes air1ankit commented Aug 28, 2018 reply Follow Share 1.Hard disk 2.Floppy disk 3.printer 4. keyboard Will priority sequence be this correct? please check 1 votes 1 votes adm1n123 commented Nov 20, 2018 reply Follow Share @vaishali @Arjun sir Speed of device will only matter to deliver the interrupt first to CPU but here we are talking about which one of interrupt CPU service over others. And which operation or what request generated by HDD a keyboard cant interrupt? It should be keyboard? 0 votes 0 votes rohith1001 commented Dec 29, 2019 i edited by rohith1001 Dec 29, 2019 reply Follow Share https://kb.iu.edu/d/ailq I found this reference. according to this keyboard has higher priority. There is a table given in that link, which has the IRQ(Interrupt Request) number and also the I/O device name. But I could not find hard disk in that table. An Interrupt Request is a signal from a hardware device on your computer to your CPU. When a hardware device needs the CPU to do something (such as move the cursor as you move the mouse), the device sends an Interrupt Request to the CPU. Since a CPU can get several of these Interrupt Requests at once from various devices along the same path (e.g., the serial port or the PCI bus), it needs a way to distinguish between them. To do so, the computer assigns an Interrupt Request number (the IRQ number) to each device and its path to the CPU. The IRQ number is a numeric way to assign the priority that the devices have with the CPU. The lower the value of the IRQ number, the more important the need for the input or action to take place. Some devices that are assigned IRQ numbers include the disk drive controllers (floppy and hard disk), mouse, keyboard, and sound card. 0 votes 0 votes rohith1001 commented Dec 29, 2019 i edited by rohith1001 Dec 29, 2019 reply Follow Share # cat /proc/interrupts CPU0 0: 7514294 IO-APIC-edge timer 1: 4528 IO-APIC-edge i8042 6: 2 IO-APIC-edge floppy 8: 1 IO-APIC-edge rtc 9: 0 IO-APIC-level acpi 12: 2301 IO-APIC-edge i8042 15: 41 IO-APIC-edge ide1 16: 3230 IO-APIC-level ioc0 17: 1016 IO-APIC-level vmxnet ether NMI: 0 LOC: 7229438 ERR: 0 MIS: 0 The first column specifies the IRQ associated with the interrupt. The following column shows the number of interrupts that were generated for each processor in the system; The last two columns provide information about the interrupt controller and the device name that registered the handler for that interrupt. Reference: https://linux-kernel-labs.github.io/master/labs/interrupts.html 0 votes 0 votes marvellouschandan commented Oct 25, 2020 reply Follow Share What if I press “ctrl +c” command to terminate some process or might be I gave “sudo rm -rf /” and suddenly press ctrl + c, I believe keyboard should be given more priority. What do you say? 1 votes 1 votes shashankrustagi commented Jan 19, 2021 reply Follow Share sir you roast students lol 0 votes 0 votes GNANESWARA SAI commented Jan 27, 2023 reply Follow Share That time lapse is sufficient to handle the interrupt . It is not in sec it is in msec 0 votes 0 votes Please log in or register to add a comment.
22 votes 22 votes Answer: (A) Devices with high speed get more priority in assigning interrupts. Here is the explanation taken from Morris Mano: Anony_XYZ answered Jan 6, 2020 Anony_XYZ comment Share Follow See all 0 reply Please log in or register to add a comment.
3 votes 3 votes Hard disk should be given higher priority as all user programs and OS are stored in here. Nik Sharma answered Jan 12, 2017 Nik Sharma comment Share Follow See all 3 Comments See all 3 3 Comments reply Krishna Yadav 1 commented Nov 16, 2018 reply Follow Share No doubt, it's (C) keyboard has the highest priority of them all. It's a rule. From highest to lowest. THERMAL MONITOR -> LOCK -> KEYBOARD -> SERIAL PORT -> HDD -> FLOPPY DISK -> PRINTER 1 votes 1 votes adm1n123 commented Nov 20, 2018 reply Follow Share @krishna Please provide references me too think it should be keyboard. 0 votes 0 votes Gaurav Yadav commented Apr 22, 2020 reply Follow Share Highest priority is given to the device which has high probability of data loss. 0 votes 0 votes Please log in or register to add a comment.
2 votes 2 votes Devices with high speed transfer such as Hard disk (according to given options it has high speed among all) are given high priority, and slow devices such as keyboard receive low priority. So, clearly Hard disk is answer. Option (A). Check the similar one: https://gateoverflow.in/2113/gate2011-11 Kuljeet Shan answered Apr 17, 2019 Kuljeet Shan comment Share Follow See all 0 reply Please log in or register to add a comment.