Machine Problem 2, due Feb 25

Part of the homework for 22C:112, Spring 2008
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

Background: The Unix read() and write() system calls are largely opaque, hiding almost all aspects of the underlying device from the programmer, but they are not entirely opaque. The challenge of this assignment is to drill down through the Unix system calls to the keyboard interface to access the keyboard status and data.

Unix provides access to device dependent behavior through the ioctl() and fcntl() system calls. The man command under the unix shell can be used to see the documentation for these system calls. In the case of read and write, you may have to type man 2 read for example, since read is also the name of a shell command.

The Assignment:

Hints: /dev/tty (if used for input) is the name of the terminal. When you open a file, there is a flag word that can include a flag called O_NONBLOCK.