Be sure you have read chapters 5 and 6.
Answer the following questions. You may write out your answers by hand or using a word processor or other program, but please submit hard copy, either in class or in my mailbox in the department office.
 seconds).
	It has 32 CPU registers, and when an interrupt occurs,
	all of them, plus the program counter and the PSW
	are pushed onto the stack (in memory).  
	What is the maximum number of interrupts per second this
	machine can process?
	(Hint:  Observe that after an interrupt is processed,
	the contents of CPU registers, program counter, and PSW 
	must be restored to their pre-interrupt values by popping
	them back off the stack.)
 seconds).
	It has 32 CPU registers, and when an interrupt occurs,
	all of them, plus the program counter and the PSW
	are pushed onto the stack (in memory).  
	What is the maximum number of interrupts per second this
	machine can process?
	(Hint:  Observe that after an interrupt is processed,
	the contents of CPU registers, program counter, and PSW 
	must be restored to their pre-interrupt values by popping
	them back off the stack.)
 seconds) to process,
	would it make sense to use interrupt-driven I/O to write
	to this printer, or would it be better to use programmed I/O?
	Why?  
	(Hint:  How much time is required for interrupt
	processing if the printer is printing at its maximum rate?)
 seconds) to process,
	would it make sense to use interrupt-driven I/O to write
	to this printer, or would it be better to use programmed I/O?
	Why?  
	(Hint:  How much time is required for interrupt
	processing if the printer is printing at its maximum rate?)
Now consider a system with a memory-mapped terminal, and suppose that interrupts take a minimum of 100 nsec to process and copying a byte into the terminal's video RAM takes 10 nsec. Would it make sense to use interrupt-driver I/O to write to the terminal, or would it be better to use programmed I/O? Why?
 bits)
	per second.  The receiving controller
	receives each bit a microsecond after it is sent.
	When the last bit in the packet is received, the destination
	CPU is interrupted, and its operating system copies
	the packet into a kernel buffer, inspects it, and
	copies it into a buffer owned by the application program
	that should receive it.  It then sends back an acknowledgment
	(assume one bit)
	to the sending computer, which interrupts the sending CPU,
	and work can begin on the next packet.  
	How long does it take to send each packet, if it takes
	one millisecond to process an interrupt (on either CPU) and
	one microsecond to copy a byte?  Assume that the time taken
	for the receiving CPU to inspect the packet is negligible.
	What is the effective
	transfer rate (in bits per second) over this connection?
 bits)
	per second.  The receiving controller
	receives each bit a microsecond after it is sent.
	When the last bit in the packet is received, the destination
	CPU is interrupted, and its operating system copies
	the packet into a kernel buffer, inspects it, and
	copies it into a buffer owned by the application program
	that should receive it.  It then sends back an acknowledgment
	(assume one bit)
	to the sending computer, which interrupts the sending CPU,
	and work can begin on the next packet.  
	How long does it take to send each packet, if it takes
	one millisecond to process an interrupt (on either CPU) and
	one microsecond to copy a byte?  Assume that the time taken
	for the receiving CPU to inspect the packet is negligible.
	What is the effective
	transfer rate (in bits per second) over this connection?
(Hints: Notice that some times are per bit and some are per byte. If you think you need to make additional assumptions, do so and explain them. If you show your calculations and briefly explain what you are doing, your odds of getting partial credit are better.)
 seconds)
	per cylinder moved, and the arm is initially at cylinder 20,
	how much seek time is needed to process
	these requests using each of the three scheduling
	algorithms discussed (FCFS, SSF, and elevator)?
	Assume no other requests arrive while these are being
	processed.
 seconds)
	per cylinder moved, and the arm is initially at cylinder 20,
	how much seek time is needed to process
	these requests using each of the three scheduling
	algorithms discussed (FCFS, SSF, and elevator)?
	Assume no other requests arrive while these are being
	processed.
Optionally, do the following programming problems. You will end up with at least one code file per problem. Turn in your code by sending mail to csci4320-homework@cs.trinity.edu, with each of your code files as an attachment. If there's any question of which file(s) correspond to which problems, explain in the body of the mail message. Please use a subject line such as ``homework 4'' or ``hw4''. You can develop your programs on any system that provides the needed functionality, but I will test them on one of the department's Fedora Core 2 Linux machines, so you should probably make sure they work in that environment before turning them in.
 , blocksize
, blocksize  ,
and maximum number of blocks
,
and maximum number of blocks  as command-line arguments
prints out how many files in
 as command-line arguments
prints out how many files in  and its subdirectories 
are of size
 and its subdirectories 
are of size  or less, how many are of size between
 or less, how many are of size between  and
 and  ,
etc., up to size
,
etc., up to size  .
Include directories and symbolic links (but count the size of the link
and not the file/directory it links to).
Here is a sample execution.
.
Include directories and symbolic links (but count the size of the link
and not the file/directory it links to).
Here is a sample execution.
[bmassing@Xena02]$ ./filesizes /var/www 512 20
Unable to open /var/www/HTML-Documents/apache-documentation/manual/search:  Permission denied
Unable to open /var/www/HTML-Documents/About/The_Courses/cs3394.hci/dcernose/javapres/turnin/COM:  Permission denied
Unable to open /var/www/HTML-Documents/About/The_Courses/cs3291.java/dcernose/javapres/turnin/COM:  Permission denied
Unable to open /var/www/accesswatch-1.33:  Permission denied
Results for directory /var/www:
                2339 files of size          1 blocks
                 478 files of size          2 blocks
                 967 files of size          3 blocks
                1192 files of size          4 blocks
                7202 files of size          5 blocks
                9816 files of size          6 blocks
                5804 files of size          7 blocks
                3621 files of size          8 blocks
                1769 files of size          9 blocks
                1013 files of size         10 blocks
                1606 files of size         11 blocks
                 706 files of size         12 blocks
                 430 files of size         13 blocks
                 645 files of size         14 blocks
                 514 files of size         15 blocks
                 525 files of size         16 blocks
                 444 files of size         17 blocks
                 303 files of size         18 blocks
                 303 files of size         19 blocks
                 264 files of size         20 blocks
                6296 files of size         21 blocks or more
(Of course, you won't be able to examine files in directories you
don't have access to.  That's okay; just print error messages as above.)
Hints: Read the man pages for opendir, readdir, and lstat. You might also be interested in the man pages for chdir and strerror.