The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+16 votes
2.7k views

Which of the following devices should get higher priority in assigning interrupts?

  1. Hard disk
  2. Printer
  3. Keyboard
  4. Floppy disk
asked in Operating System by Veteran (59.7k points)
edited by | 2.7k views
+1
How can we understand priority among those?
+1
among these options  can say that keyboard has the maximum priority. but if options are different , how we can comment?
0
+8
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.

2 Answers

+23 votes
Best answer

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

answered by Veteran (370k points)
selected by
+6
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.
+3
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.
+2
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 ???
+5
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.
+2
@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 ?
0
No. Data overwritten from where?
0
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
@Vaishali Any reference?
0
No reference..from My notes only..
+2
Then it is like old 1000 note :)
+1
So...this is not the proper reason?
+1

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

+2
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"
+1
What is the fast device here?
+1
May be processor..
0

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
@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.
0

@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
1.Hard disk

2.Floppy disk

3.printer

4. keyboard

Will priority sequence be this correct? please check
0
@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?
+3 votes
Hard disk should be given higher priority as all user programs and OS are stored in here.
answered by (55 points)
0
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
0
@krishna

Please provide references me too think it should be keyboard.
Answer:

Related questions



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

44,490 questions
49,940 answers
165,703 comments
65,910 users