Midterm II

Part of materials for 22C:50, Summer 2003
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

 

Name: ________________________________________________

ID Number: ___________________

Please write your answers in the space provided! Make sure your name is in the same form as it appears on your University ID card! Illegible and excessively long answers will be penalized! This exam is open-book, open-notes, closed neighbor! This exam is worth 1/10 of the final grade (10 points; allocate 4-5 minutes per point).

 

  1. A problem: Hand assemble, link, relocate and load the following bits of EAL code, showing only the values that are eventually loaded into memory. Assume that the initial relocation base for linking and loading is 10016. Give all addresses and values in hexadecimal. (2 points)
    				Location     Value
    	; File A
    	      INT ASYM		________   __________
    	      EXT BSYM
    	; commentary		________   __________
    	ASYM: W  #FFFF
    	      W   ASYM		________   __________
    	      W   BSYM
    				________   __________
    
    				________   __________
    	; File B
    	      INT BSYM		________   __________
    	      EXT ASYM
    	BSYM  =   .+2		________   __________
    	      W   BSYM
    	      W   ASYM+#0002	________   __________
    
    				________   __________
    

    For a bit more credit, circle the values that were relocated as they were loaded into memory. (0.5 points)

     
     
     
     
     
     
     

     
     
     
     
     
     
     

     

  2. Background: An 8-megabit flash EEPROM chip has the following characteristics:

    a) Why 1056 bytes instead of 1024 bytes? What is the most important system data you might want stored in the extra 32 bytes? (0.5 points)

    	_________________________________________________________
    

    b) What delays can be thought of, by the author of the I/O driver for this flash EEPROM, as being comparable to the various latency times for a disk? (0.5 points)

    	_________________________________________________________
    

    c) Assuming main memory uses 50 ns RAM, and that the DMA controller gathers groups of 4 bytes into 32-bit words for access to main memory, what fraction of the memory cycles are consumed by DMA operations while a transfer is being made to or from one of the flash EEPROM's internal buffers? (0.5 points)

    	_________________________________________________________
    

    d) Is there any reason to use (or not to use) anything analogous to a disk scheduler with this flash EPROM device? Explain! (0.5 points)

    	_________________________________________________________
    
    	_________________________________________________________
    
    	_________________________________________________________
    

  3. Background: Consider two identical computer systems running identically the same operating system, differing only in the applications that are running. Performance measurements indicate that the disk is busy almost all the time on both, yet system B completes well over twice as many disk operations per second as system A. Explain the likely cause of this! Focus on disk characteristics I/O driver features that might explain it. (1 point)
    	_________________________________________________________
    
    	_________________________________________________________
    
    	_________________________________________________________
    
    	_________________________________________________________
    

     

  4. Background: A typical device driver consists of an interrupt handler for that device, a set of interface routines allowing higher level code to access the device, and a queue (sometimes queues) between the interrupt handler and the interface routines.

    a) Usually, when the interrupt service routine returns, the interrupt enable bit in the device is left on, but sometimes, when it is turned off when the interrupt service routine returns. Why? (1 point)

    	_________________________________________________________
    
    	_________________________________________________________
    
    	_________________________________________________________
    

    b) Most systems have a global interrupt-enable bit as well as interrupt-enable bits for each device. Part a asked about the latter. Explain the need for the former! (1 point)

    	_________________________________________________________
    
    	_________________________________________________________
    
    	_________________________________________________________
    

    c) When the queue in a device driver is a request queue, each entry holds several administrative items such as a disk address or a pointer to the done flag for the device. What items are central to each queue entry that were not mentioned here? (1 point)

    	_________________________________________________________
    
    	_________________________________________________________
    
    	_________________________________________________________
    

     
     
     
     
     
     
     

     
     
     
     
     
     
     

     
     
     
     
     
     
     

     
     
     
     
     

  5. Background: Under the example shell for MP4, I wanted to run a test of the setenv command I had just added. The first half of the test was easy, using setenv to set a variable. The second half was a mess, because the example shell didn't have any tools for printing variables from the environment. Here is my really awful solution:
    setenv TESTVAR value_of_TESTVAR
    tcsh -c $argv eval echo $TESTVAR
    
    The -c option on the tcsh shell causes it to interpret its next argument as a command. The $ prefix causes the shell to hunt for the argument in its pool of named local variables and in the environment passed to it. The named local variable argv contains the entire argument string to the shell (excepting shell options and their arguments). The eval command is a built-in in tcsh that evaluates its argument list as if it was a shell command; this is useful when you want to do macro substitution on a shell command and then execute the result.

    a) Given the above, what is the value of $argv on entry to tcsh on the second line of the above script? (0.5 points)

    	_________________________________________________________
    

    b) Given the above, what is the argument list that eval executes as a command line? (0.5 points)

    	_________________________________________________________
    

    c) Given the above, what is the argument list that echo sees as its input? (0.5 points)

    	_________________________________________________________