0% found this document useful (0 votes)
66 views

Chapter5Solutions 1 .HTML

The document summarizes key concepts about input/output (I/O) hardware and software from Chapter 5. It includes problems and solutions about data transfer rates on a local area network, device independence, I/O software layers, and disk performance metrics like seek time and transfer rates. The maximum data rate a single process can achieve on the network is estimated to be around 148 KB/sec. Device independence means that files and devices are accessed in the same way regardless of their physical nature.

Uploaded by

Sammy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views

Chapter5Solutions 1 .HTML

The document summarizes key concepts about input/output (I/O) hardware and software from Chapter 5. It includes problems and solutions about data transfer rates on a local area network, device independence, I/O software layers, and disk performance metrics like seek time and transfer rates. The maximum data rate a single process can achieve on the network is estimated to be around 148 KB/sec. Device independence means that files and devices are accessed in the same way regardless of their physical nature.

Uploaded by

Sammy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Chapter 5: Input/Output

5.1: Principles of I/O Hardware


Problem: 5.15. A local area network is used as follows. The user issues a system call to write data
packets to the network. The operating system then copies the data to a kernel buffer. Then it copies the
data to the network controller board. When all the bytes are safely inside the controller, they are sent over
the network at a rate of 10 megabits/sec. The receiving network controller stores each bin a microsecond
after it is sent. When the last bit arrives, the destination CPU is interrupted, and the kernel copies the
newly arrived packet to a kernel buffer to inspect it. Once it has figured out which user the packet is for,
the kernel copies the data to the user space. If we assume that each interrupt and its associated processing
takes 1 msec, that packets are 1024 bytes (ignore the headers), and that copying a byte takes 1
microsecond, what is the maximum rate at which one process can pump data to another? Assume that the
sender is blocked until the work is finished at the receiving side and acknowledegment comes back. For
simplicity, assume that the time to get the acknowledgement back is so small it can be ignored.

Solution:

A packet must be copied four times during this process (the sending kernel copies it twice and the
receiving kernel does as well; to see this simply note that the word "copies" appears 4 times in the
problem description), which takes 4.1 msec (1024 bytes/packet * 1us/byte = 1.024msec/packet; 4 copies
is 4.096msec). There are also two interrupts (see below), which account for 2 msec. Finally, the
transmission time is approximately (see below for the correct value) 8*1024/10^7 sec = 0.8196 msec, for
total of 6.92 msec per 1024 bytes.

The maximum data rate is thus 147,977 bytes/sec = 1,183,815 bits/sec, or about 12 percent of the nominal
10 megabit/sec network capacity. If we include protocol overhead, the figures get even worse.

The transmission time actually depends on both the latency (which the problem states is 10^-6sec) and the
bandwidth of 10^7 bits/sec. The first bit arrives after 10^-6 seconds and then each of the following bits
arrives 10^-7 seconds later. Hence the transmission portion of the time is 10^-6+(1024*8-1)/(10^7)
seconds. This slightly different transmission time from that used above does not affect the data rate to the
few digits of precision that we use.

What are the two interrupts? The first is when the sending kernel receives an interrupt from the controller
saying that it has sent the data (so that the kernel knows it can start filling the controller's buffer). The
second is when the receiving controller has received the data. This tells the receiving kernel that it can
now start copying the data from the receiving controller's buffer into the kernel's buffer.

5.2: Principles of I/O Software


Problem: What is device independence?

Solution:

Device independence means that files and devices are accessed the same way, independent of their
physical nature. Systems that have one set of calls for writing on a file, but a different set of calls for
writing on the console (terminal) do not exhibit device independence.

5.3 I/O Software Layers


Problem: 5.14. In which of the four I/O software layers is each of the following done.
This study source was downloaded by 100000866485891 from CourseHero.com on 12-09-2023 13:59:06 GMT -06:00

https://www.coursehero.com/file/27059699/Chapter5Solutions1html/
Solution:

a. Device driver.
b. Device driver.
c. Device-independent software.
d. User-level software.

Problem: 5.16. Why are output files for the printer normally spooled on disk before being printed?

Solution: If the printer were assigned as soon as the output appeared, a process could tie up the printer by
printing a few characters and then going to sleep for a week.

5.4: Disks
Problem: Consider a disk with an average seek time of 5ms, an average rotational latency of 5ms, and a
transfer rate of 40MB/sec.

1. If the block size is 1KB, how long would it take to read a block?
2. If the block size is 100KB, how long would it take to read a block?
3. If the goal is to read 1K, a 1KB block size is better as the remaining 99KB are wasted. If the goal
is to read 100KB, the 100KB block size is better since the 1KB block size needs 100 seeks and
100 rotational latencies. What is the minimum size request for which a disk with a 100KB block
size would complete faster than one with a 1KB block size?

Solution:

1. 5ms + 5ms + 1KB / (40MB/sec) = 10ms + (1/40)ms = 10.025ms.


2. 5ms + 5ms + 100KB / (40MB/sec) = 10ms + 2.5ms 12.5ms.
3. 1KB + 1B. That is, any request larger than one small block would be faster with a large block
since two small I/Os take longer than one large I/O.

This study source was downloaded by 100000866485891 from CourseHero.com on 12-09-2023 13:59:06 GMT -06:00

https://www.coursehero.com/file/27059699/Chapter5Solutions1html/
Powered by TCPDF (www.tcpdf.org)

You might also like