0% found this document useful (0 votes)
4 views15 pages

Input Output Systems

The document discusses various aspects of input-output systems, including data access times, communication protocols, disk scheduling policies, and file system structures. It presents multiple-choice questions with explanations regarding concepts like seek time, interrupt modes, disk capacities, and CPU handling of interrupts. Additionally, it covers the implications of different disk scheduling algorithms and their effects on performance and efficiency.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views15 pages

Input Output Systems

The document discusses various aspects of input-output systems, including data access times, communication protocols, disk scheduling policies, and file system structures. It presents multiple-choice questions with explanations regarding concepts like seek time, interrupt modes, disk capacities, and CPU handling of interrupts. Additionally, it covers the implications of different disk scheduling algorithms and their effects on performance and efficiency.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Input Output Systems

Question 1
Correct
Which of the following is major part of time taken when accessing data on the disk?
A Settle time
B Rotational latency
Seek time
D Waiting time
Input Output Systems
Discuss it

Question 1 Explanation:
Seek time is time taken by the head to travel to the track of the disk where the data to be
accessed is stored.
Question 2
Correct
We describe a protocol of input device communication below. a. Each device has a distinct
address b. The bus controller scans each device in sequence of increasing address value to
determine if the entity wishes to communicate. c. The device ready to communicate leaves it data
in IO register. d. The data is picked up and the controller moves to step-a above. Identify the
form of communication best describes the IO mode amongst the following: Source: nptel
A Programmed mode of data transfer
B DMA
C Interrupt mode
Polling
Input Output Systems
Discuss it

Question 2 Explanation:
See Polling
Question 3
Correct
From amongst the following given scenarios determine the right one to justify interrupt mode of
data-transfer: Source: nptel
A Bulk transfer of several kilo-byte
B Moderately large data transfer but more that 1 KB
Short events like mouse action
Key board inputs
Input Output Systems
Discuss it
Question 3 Explanation:
Both keyboard and mouse controllers typically use interrupt mode.
Question 4
Correct
Normally user programs are prevented from handling I/O directly by I/O instructions in them.
For CPUs having explicit I/O instructions, such I/O protection is ensured by having the I/O
instructions privileged. In a CPU with memory mapped I/O, there is no explicit I/O instruction.
Which one of the following is true for a CPU with memory mapped I/O? (GATE CS 2005)
I/O protection is ensured by operating system routine(s)
B I/O protection is ensured by a hardware trap
C I/O protection is ensured during system configuration
D I/O protection is not possible
Input Output Systems
Discuss it

Question 4 Explanation:
See question 1 of http://www.geeksforgeeks.org/operating-systems-set-16/
Question 5
Correct
Put the following disk scheduling policies results in minimum amount of head movement.
A FCS
Circular scan
C Elevator
Input Output Systems
Discuss it

Question 5 Explanation:
First Come -First Serve (FCFS) All incoming requests are placed at the end of the queue.
Whatever number that is next in the queue will be the next number served. Using this algorithm
doesn't provide the best results. Elevator (SCAN): This approach works like an elevator does. It
scans down towards the nearest end and then when it hits the bottom it scans up servicing the
requests that it didn't get going down. If a request comes in after it has been scanned it will not
be serviced until the process comes back down or moves back up. Circular Scan (C-SCAN):
Circular scanning works just like the elevator to some extent. It begins its scan toward the
nearest end and works it way all the way to the end of the system. Once it hits the bottom or top
it jumps to the other end and moves in the same direction. Keep in mind that the huge jump
doesn't count as a head movement. Source:
http://www.cs.iit.edu/~cs561/cs450/disksched/disksched.html
Question 6
Correct
Consider a hard disk with 16 recording surfaces (0-15) having 16384 cylinders (0-16383) and
each cylinder contains 64 sectors (0-63). Data storage capacity in each sector is 512 bytes. Data
are organized cylinder-wise and the addressing format is <cylinder no., surface no., sector no.> .
A file of size 42797 KB is stored in the disk and the starting disk location of the file is <1200, 9,
40>. What is the cylinder number of the last sector of the file, if it is stored in a contiguous
manner?
A 1281
B 1282
C 1283
1284
Input Output Systems GATE CS 2013
Discuss it

Question 6 Explanation:
42797KB will take 85512 sectors (42797*1024 bytes / 512 bytes)

Since there are 64 sectors per surface, 85512/64 = 1337.406


sectors are required, so we take 1338 sectors these sectors are
distributed among 16 surfaces, so 1338/16 = 83.58 cylinders will be
required.

So the final ans will be 84+1200 = 1284.

one more fact to be noted is that the file occupies 83.58 cylinders,
but the 0.58 cannot be accommodated in the first one (the file storage
starts from <1200,9,40>). Hence, the file will be extended to 194
(85594-85400) more bytes of cylinder 1284.
Question 7
Correct
A file system with 300 GByte disk uses a file descriptor with 8 direct block addresses, 1 indirect
block address and 1 doubly indirect block address. The size of each disk block is 128 Bytes and
the size of each disk block address is 8 Bytes. The maximum possible file size in this file system
is
A 3 Kbytes
35 Kbytes
C 280 Bytes
D Dependent on the size of the disk
GATE CS 2012 Input Output Systems
Discuss it

Question 7 Explanation:
See http://www.geeksforgeeks.org/operating-systems-set-5/
Question 8
Correct
A computer handles several interrupt sources of which the following are relevant for this
question.
. Interrupt from CPU temperature sensor (raises interrupt if
CPU temperature is too high)
. Interrupt from Mouse(raises interrupt if the mouse is moved
or a button is pressed)
. Interrupt from Keyboard(raises interrupt when a key is
pressed or released)
. Interrupt from Hard Disk(raises interrupt when a disk
read is completed)
Which one of these will be handled at the HIGHEST priority?
A Interrupt from Hard Disk
B Interrupt from Mouse
C Interrupt from Keyboard
Interrupt from CPU temperature sensor
Input Output Systems GATE CS 2011
Discuss it

Question 8 Explanation:
Higher priority interrupt levels are assigned to requests which, if delayed or interrupted, could
have serious consequences. Devices with high speed transfer such as magnetic disks are given
high priority, and slow devices such as keyboard receive low priority (Source: Computer System
Architecture by Morris Mano) Interrupt from CPU temperature sensor would have serious
consequences if ignored.
Question 9
Correct
An application loads 100 libraries at start-up. Loading each library requires exactly one disk
access. The seek time of the disk to a random location is given as 10 ms. Rotational speed of disk
is 6000 rpm. If all 100 libraries are loaded from random locations on the disk, how long does it
take to load all libraries? (The time to transfer data from the disk block once the head has been
positioned at the start of the block may be neglected)
A 0.50 s
1.50 s
C 1.25 s
D 1.00 s
Input Output Systems GATE CS 2011
Discuss it

Question 9 Explanation:
See Question 3 of http://www.geeksforgeeks.org/operating-systems-set-6/
Question 10
Correct
A CPU generally handles an interrupt by executing an interrupt service routine
A As soon as an interrupt is raised
B By checking the interrupt register at the end of fetch cycle.
By checking the interrupt register after finishing the execution of the current instruction.
D By checking the interrupt register at fixed time intervals.
Input Output Systems GATE-CS-2009
Discuss it
Question 10 Explanation:
Hardware detects interrupt immediately, but CPU acts only after its current instruction. This is
followed to ensure integrity of instructions.
Question 11
Correct
A hard disk has 63 sectors per track, 10 platters each with 2 recording surfaces and 1000
cylinders. The address of a sector is given as a triple (c, h, s), where c is the cylinder number, h is
the surface number and s is the sector number. Thus, the 0th sector is addressed as (0, 0, 0), the
1st sector as (0, 0, 1), and so on The address <400,16,29> corresponds to sector number:
A 505035
B 505036
505037
D 505038
Input Output Systems GATE-CS-2009
Discuss it

Question 11 Explanation:
Total surfaces are 20 There are 1000 cylinders each cylinder contains 20 tracks in all the surfaces
together. Each track contains 63 sectors So the address is 400x20x63 + 16x63 + 29 = 505037
Question 12
Correct
Consider the data given in previous question. The address of the 1039th sector is
A (0, 15, 31)
B (0, 16, 30)
(0, 16, 31)
D (0, 17, 31)
Input Output Systems GATE-CS-2009
Discuss it

Question 12 Explanation:
16*31 + 31 = 1039
Question 13
Correct
The data blocks of a very large file in the Unix file system are allocated using
A contiguous allocation
B linked allocation
C indexed allocation
an extension of indexed allocation
Input Output Systems GATE CS 2008
Discuss it

Question 13 Explanation:
The Unix file system uses an extension of indexed allocation. It uses direct blocks, single
indirect blocks, double indirect blocks and triple indirect blocks. Following diagram shows
implementation of Unix file system. The diagram is taken from Operating System Concept book.

Question 14
Correct
For a magnetic disk with concentric circular tracks, the seek latency is not linearly proportional
to the seek distance due to
A non-uniform distribution of requests
arm starting and stopping inertia
C higher capacity of tracks on the periphery of the platter
D use of unfair arm scheduling policies
Input Output Systems GATE CS 2008
Discuss it

Question 14 Explanation:
See http://en.wikipedia.org/wiki/Disk-drive_performance_characteristics#Seek_time
Question 15
Correct
Which of the following statements about synchronous and asynchronous I/O is NOT true?
An ISR is invoked on completion of I/O in synchronous I/O but not in asynchronous I/O
In both synchronous and asynchronous I/O, an ISR (Interrupt Service Routine) is invoked after
B
completion of the I/O
A process making a synchronous I/O call waits until I/O is complete, but a process making an
C
asynchronous I/O call does not wait for completion of the I/O
In the case of synchronous I/O, the process waiting for the completion of I/O is woken up by
D
the ISR that is invoked after the completion of I/O
Input Output Systems GATE CS 2008
Discuss it

Question 15 Explanation:
See Question 3 of http://www.geeksforgeeks.org/operating-systems-set-10/
Question 16
Correct
Consider a disk pack with 16 surfaces, 128 tracks per surface and 256 sectors per track. 512
bytes of data are stored in a bit serial manner in a sector. The capacity of the disk pack and the
number of bits required to specify a particular sector in the disk are respectively:
256 Mbyte, 19 bits
B 256 Mbyte, 28 bits
C 512 Mbyte, 20 bits
D 64 Gbyte, 28 bit
Input Output Systems GATE-CS-2007
Discuss it

Question 16 Explanation:
See Question 1 of http://www.geeksforgeeks.org/operating-systems-set-12/
Question 17
Correct
Suppose a disk has 201 cylinders, numbered from 0 to 200. At some time the disk arm is at
cylinder 100, and there is a queue of disk access requests for cylinders 30, 85, 90, 100, 105, 110,
135 and 145. If Shortest-Seek Time First (SSTF) is being used for scheduling the disk access, the
request for cylinder 90 is serviced after servicing ____________ number of requests.
A1
B2
3
D4
Input Output Systems GATE-CS-2014-(Set-1)
Discuss it

Question 17 Explanation:
In Shortest-Seek-First algorithm, request closest to the current position of the disk arm and head
is handled first. In this question, the arm is currently at cylinder number 100. Now the requests
come in the queue order for cylinder numbers 30, 85, 90, 100, 105, 110, 135 and 145. The disk
will service that request first whose cylinder number is closest to its arm. Hence 1st serviced
request is for cylinder no 100 ( as the arm is itself pointing to it ), then 105, then 110, and then
the arm comes to service request for cylinder 90. Hence before servicing request for cylinder 90,
the disk would had serviced 3 requests. Hence option C.
Question 18
Correct
A device with data transfer rate 10 KB/sec is connected to a CPU. Data is transferred byte-wise.
Let the interrupt overhead be 4 msec. The byte transfer time between the device interface register
and CPU or memory is negligible. What is the minimum performance gain of operating the
device under interrupt mode over operating it under program controlled mode?
A 15
25
C 35
D 45
Input Output Systems GATE-CS-2005
Discuss it

Question 18 Explanation:
In programmed I/O, CPU does continuous polling,
To transfer 10KB CPU polls for 1 sec = 10^6 micro-sec of processing
In interrupt mode CPU is interrupted on completion of i\o ,
To transfer 10 KB CPU does 4 micro-sec of processing.
Gain = 10^6 / 4 = 25000
250000 for 10000 bytes and 25 for 1 bytes.
Question 19
Correct
Consider a disk drive with the following specifications: 16 surfaces, 512 tracks/surface, 512
sectors/track, 1 KB/sector, rotation speed 3000 rpm. The disk is operated in cycle stealing mode
whereby whenever one byte word is ready it is sent to memory; similarly, for writing, the disk
interface reads a 4 byte word from the memory in each DMA cycle. Memory cycle time is 40
nsec. The maximum percentage of time that the CPU gets blocked during DMA operation is:
A 10
25
C 40
D 50
Input Output Systems GATE-CS-2005
Discuss it

Question 19 Explanation:
Time takes for 1 rotation = 60/3000 It reads 512*1024 Bytes in one rotation. Time taken to read
4 bytes = 153 ns 153 is approximately 4 cycles (160ns) Percentage of time CPU gets blocked =
40*100/160 = 25
Question 20
Correct
Consider an operating system capable of loading and executing a single sequential user process
at a time. The disk head scheduling algorithm used is First Come First Served (FCFS). If FCFS
is replaced by Shortest Seek Time First (SSTF), claimed by the vendor to give 50% better
benchmark results, what is the expected improvement in the I/O performance of user programs?
A 50%
B 40%
C 25%
0%
Input Output Systems GATE-CS-2004
Discuss it

Question 20 Explanation:
Since Operating System can execute a single sequential user process at a time, the disk is
accessed in FCFS manner always. The OS never has a choice to pick an IO from multiple IOs as
there is always one IO at a time
Question 21
Correct
A Unix-style i-node has 10 direct pointers and one single, one double and one triple indirect
pointers. Disk block size is 1 Kbyte, disk block address is 32 bits, and 48-bit integers are used.
What is the maximum possible file size ?
A 224 bytes
B 232 bytes
234 bytes
D 248 bytes
Input Output Systems GATE-CS-2004
Discuss it

Question 21 Explanation:

Image Source: Wiki


Size of Disk Block = 1Kbyte

Disk Blocks address = 32bits,


but 48 bit integers are used for address
Therefore address size = 6 bytes

No of addresses per block = 1024/6 = 170.66


Therefore 170 ≈ 2^8 addresses per block can be stored

Maximum File Size = 10 Direct + 1 Single Indirect +


1 Double Indirect + 1 Triple Indirect
= 10 + 28 + 28*28 + 28*28*28
≈ 224 Blocks

Since each block is of size 210

Maximum files size = 224 * 210


= 234
Question 22
Correct
A hard disk with a transfer rate of 10 Mbytes/ second is constantly transferring data to memory
using DMA. The processor runs at 600 MHz, and takes 300 and 900 clock cycles to initiate and
complete DMA transfer respectively. If the size of the transfer is 20 Kbytes, what is the
percentage of processor time consumed for the transfer operation ?
A 5.0%
B 1.0%
C 0.5%
0.1%
Input Output Systems GATE-CS-2004
Discuss it

Question 22 Explanation:
Transfer rate=10 MB per second Data=20 KB=20* 2 10 So Time=(20 * 2 10)/(10 * 2 20)= 2* 10-3
=2 ms Processor speed= 600 MHz=600 Cycles/sec Cycles required by CPU=300+900 =1200 For
DMA=1200 So time=1200/(600 *10 6)=.002 ms In %=.002/2*100=.1% So (D) is correct
option
Question 23
Correct
Using a larger block size in a fixed block size file system leads to :
better disk throughput but poorer disk space utilization
B better disk throughput and better disk space utilization
C poorer disk throughput but better disk space utilization
D poorer disk throughput and poorer disk space utilization
Input Output Systems GATE-CS-2003
Discuss it

Question 23 Explanation:
Using larger block size makes disk utilization poorer as more space would be wasted for small
data in a block. It may make throughput better as the number of blocks would decrease.
Question 24
Correct
Which of the following requires a device driver?
A Register
B Cache
C Main memory
Disk
Input Output Systems GATE-CS-2001
Discuss it

Question 24 Explanation:

A disk driver is software which enables communication between internal hard disk (or drive) and
computer.
It allows a specific disk drive to interact with the remainder of the computer.

Thus, option (D) is the answer.

Please comment below if you find anything wrong in the above post.
Question 25
Correct
A graphics card has on board memory of 1 MB. Which of the following modes can the card not
support?
A 1600 x 400 resolution with 256 colours on a 17-inch monitor
1600 x 400 resolution with 16 million colours on a 14-inch monitor
C 800 x 400 resolution with 16 million colours on a 17-inch monitor
D 800 x 800 resolution with 256 colours on a 14-inch monitor
Input Output Systems GATE-CS-2000
Discuss it

Question 25 Explanation:
See question 3 of http://www.geeksforgeeks.org/operating-systems-set-1/
Question 26
Correct
Consider the situation in which the disk read/write head is currently located at track 45 (of tracks
0-255) and moving in the positive direction. Assume that the following track requests have been
made in this order: 40, 67, 11, 240, 87. What is the order in which optimised C-SCAN would
service these requests and what is the total seek distance?
A 600
B 810
505
D 550
Input Output Systems GATE-CS-2015 (Mock Test)
Discuss it
Question 26 Explanation:
Source: http://iete-elan.ac.in/SolQP/soln/DC14_sol.pdf
Question 27
Correct
Suppose the following disk request sequence (track numbers) for a disk with 100 tracks is given:
45, 20, 90, 10, 50, 60, 80, 25, 70. Assume that the initial position of the R/W head is on track 50.
The additional distance that will be traversed by the R/W head when the Shortest Seek Time
First (SSTF) algorithm is used compared to the SCAN (Elevator) algorithm (assuming that
SCAN algorithm moves towards 100 when it starts execution) is _________ tracks
A8
B9
10
D 11
Input Output Systems GATE-CS-2015 (Set 1)
Discuss it

Question 27 Explanation:
In Shortest seek first (SSTF), closest request to the current position of the head, and then services
that request next. In SCAN (or Elevator) algorithm, requests are serviced only in the current
direction of arm movement until the arm reaches the edge of the disk. When this happens, the
direction of the arm reverses, and the requests that were remaining in the opposite direction are
serviced, and so on.
Given a disk with 100 tracks

And Sequence 45, 20, 90, 10, 50, 60, 80, 25, 70.

Initial position of the R/W head is on track 50.

In SSTF, requests are served as following

Next Served Distance Traveled


50 0
45 5
60 15
70 10
80 10
90 10
25 65
20 5
10 10
-----------------------------------
Total Dist = 130

If Simple SCAN is used, requests are served as following

Next Served Distance Traveled


50 0
60 10
70 10
80 10
90 10
45 65 [disk arm goes to 100, then to 45]
25 20
20 5
10 10
-----------------------------------
Total Dist = 140

Extra Distance traveled in SSTF = 140 - 120 = -10


If SCAN with LOOK is used, requests are served as following
Next Served Distance Traveled
50 0
60 10
70 10
80 10
90 10
45 45 [disk arm comes back from 90]
25 20
20 5
10 10
-----------------------------------
Total Dist = 120

Extra Distance traveled in SSTF = 130 - 120 = 10


Question 28
Correct
Consider a disk pack with a seek time of 4 milliseconds and rotational speed of 10000 rotations
per minute (RPM). It has 600 sectors per track and each sector can store 512 bytes of data.
Consider a file stored in the disk. The file contains 2000 sectors. Assume that every sector access
necessitates a seek, and the average rotational latency for accessing each sector is half of the time
for one complete rotation. The total time (in milliseconds) needed to read the entire file is
_________.
14020
B 14000
C 25030
D 15000
Input Output Systems GATE-CS-2015 (Set 1)
Discuss it

Question 28 Explanation:
Seek time (given) = 4ms

RPM = 10000 rotation in 1 min [60 sec]


So, 1 rotation will be =60/10000 =6ms [rotation speed]
Rotation latency= 1/2 * 6ms=3ms
# To access a file,
total time includes =seek time + rot. latency +transfer time
TO calc. transfer time, find transfer rate

Transfer rate = bytes on track /rotation speed


so, transfer rate = 600*512/6ms =51200 B/ms

transfer time= total bytes to be transferred/ transfer rate


so, Transfer time =2000*512/51200 = 20ms

Given as each sector requires seek tim + rot. latency


= 4ms+3ms =7ms

Total 2000 sector takes = 2000*7 ms =14000 ms


To read entire file ,total time = 14000 + 20(transfer time)
= 14020 ms
Question 29
Correct
Consider a typical disk that rotates at 15000 rotations per minute (RPM) and has a transfer rate
of 50 × 106 bytes/sec. If the average seek time of the disk is twice the average rotational delay
and the controller’s transfer time is 10 times the disk transfer time, the average time (in
milliseconds) to read or write a 512 byte sector of the disk is _____________
6.1
Input Output Systems GATE-CS-2015 (Set 2)
Discuss it

Question 29 Explanation:
Disk latency = Seek Time + Rotation Time + Transfer Time + Controller Overhead
Seek Time? Depends no. tracks the arm moves and seek speed of disk
Rotation Time? depends on rotational speed and how far the sector is from the
head
Transfer Time? depends on data rate (bandwidth) of disk (bit density) and the
size of request

Disk latency = Seek Time + Rotation Time +


Transfer Time + Controller Overhead

Average Rotational Time = (0.5)/(15000 / 60) = 2 miliseconds


[On average half rotation is made]

It is given that the average seek time is twice the average rotational delay
So Avg. Seek Time = 2 * 2 = 4 miliseconds.

Transfer Time = 512 / (50 × 106 bytes/sec)


= 10.24 microseconds

Given that controller time is 10 times the average transfer time


Controller Overhead = 10 * 10.24 microseconds
= 0.1 miliseconds

Disk latency = Seek Time + Rotation Time +


Transfer Time + Controller Overhead
= 4 + 2 + 10.24 * 10-3 + 0.1 miliseconds
= 6.1 miliseconds
Refer http://cse.unl.edu/~jiang/cse430/Lecture%20Notes/reference-ppt-slides/
Disk_Storage_Systems_2.ppt
Question 30
Correct
Consider a disk queue with requests for I/O to blocks on cylinders 47, 38, 121, 191, 87, 11, 92,
10. The C-LOOK scheduling algorithm is used. The head is initially at cylinder number 63,
moving towards larger cylinder numbers on its servicing pass. The cylinders are numbered from
0 to 199. The total head movement (in number of cylinders) incurred while servicing these
requests is: Note : This question was asked as Numerical Answer Type.
A 346
165
C 154
D 173
Input Output Systems GATE-CS-2016 (Set 1)
Discuss it

Question 30 Explanation:
The head movement would be :
63 => 87 24 movements
87 => 92 5 movements
92 => 121 29 movements
121 => 191 70 movements
191 --> 10 0 movement
10 => 11 1 movement
11 => 38 27 movements
38 => 47 9 movements
Total head movements = 165

Question 31
Correct
Which of the following DMA transfer modes and interrupt handling mechanisms will enable the
highest I/O band-width?
A Transparent DMA and Polling interrupts
B Cycle-stealing and Vectored interrupts
Block transfer and Vectored interrupts
D Block transfer and Polling interrupts

You might also like