Lab 9: Memory Mapped I/O

In this lab, we will learn about techniques available to application programmers for using logical address spaces that are not as widely known or used as they probably should be.

Issues addressed by this lab include:


Lab Materials
  1. Slides
  2. Lab Files

For this lab, you should complete the implementation of the memmap program. This program should create a memory mapping of the source and destination files. Copy the source file using memory operations and compare this approach to the read/write system call approach taken by the read_write program. Use the time command in comparing the work done by the two approaches under different operating conditions.

We should be able to build the your solution memmap program using the Makefile submitted in your solution TAR file.


What to Hand in

After you have finished your implementation, you need to complete a short report that answers the following questions:

  1. The time required to copy the file using read_write varies with the size of the buffer specified. Smaller buffer sizes take longer. The time required for memmap varies much less regardless of how you perform the copy. Discuss why this is, and in your discussion consider the influence of: (1) the overhead of the read() and write() system calls and (2) the number of times the data is copied under the two methods. This question is worth 20 points.
  2. When you use the read_write command as supplied, the size of the copied file varies with the size of the buffer specified. When you use the memmap command implemented the size of the source and destination files will match exactly. This is because there is a mistake in the read_write code. What is the mistake, and how can it be corrected?

Once you are done with the lab, Modify the Makefile as per your student ID and use the zip target to create an archive for submission on blackboard.


< Back to the Lab Home Page