Midterm II
Part of
materials for 22C:50, Summer 2003
|
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).
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)
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)
_________________________________________________________ _________________________________________________________ _________________________________________________________
_________________________________________________________ _________________________________________________________ _________________________________________________________ _________________________________________________________
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)
_________________________________________________________ _________________________________________________________ _________________________________________________________
setenv TESTVAR value_of_TESTVAR tcsh -c $argv eval echo $TESTVARThe -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)
_________________________________________________________