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/5 of the final grade (10 points; allocate 4 minutes per point).
For a bit more credit, circle the line numbers of the lines that would cause problems for relocation bases over 256 (approximately). (0.5 points)line hexadecimal source loc reloc val reloc text 1 ______ ___ ______ ___ B 22 symbol table symbol value reloc 2 ______ ___ ______ ___ X: B #22 ______ ______ ___ 3 ______ ___ ______ ___ B X ______ ______ ___ 4 ______ ___ ______ ___ ; Commentary ______ ______ ___ 5 ______ ___ ______ ___ B Y ______ ______ ___ 6 ______ ___ ______ ___ B Z 7 ______ ___ ______ ___ Y = 10 8 ______ ___ ______ ___ Z:
a) 10 sectors long? __________
b) 100 sectors long? __________
c) 1000 sectors long? __________
/space/jones/.public-html/syssoft/hw/mid2.htmlAs above, assume that opening a file reads that file's i-node into main memory, but does not read any sectors of that file; also assume that the i-node for the root directory of the file system is read into RAM when the system is started. Assume that each directory requires under 5120 bytes, that the average directory requires 1024 bytes, and by chance, each i-node is in a different disk sector. (1.8 points)
a) How many low-level files would the directory manager need to read in order to open this file? ____________
b) How many i-nodes would be read by the directory manager as it opens this file? ____________
c) How many disk read operations would you expect to be required in order to open this file? ____________
a) How long will it take to read the following sequence of disk addresses, from the start of data transfer for the first read to the end of data transfer for the last. Measure all times in units of 1/64 second, assuming that the read of sector 0 cylinder 0 begins at time 0.
transfer number cyl sect begin time end time 1 0 0 0 1 2 1 3 _____ _____ 3 5 4 _____ _____ 4 4 5 _____ _____ 5 0 1 _____ _____b) How many sectors will move past the head in the time it takes the head to seek n cylinders, for n = 1 to 7? Rough estimates are acceptable!
distance moved time distance moved time 0 0 4 ________ 1 ________ 5 ________ 2 ________ 6 ________ 3 ________ 7 ________
Suppose we wanted to use the mouse to imitate a touch screen, with the mouse buttons used to indicate touch pressure using some sensible scheme. Assume you already have a working touch screen input driver that expects to use the following interface registers.
8-bit interface registers ___________ PDX |_____X_____| Top 8 bits of the X coordinate PDXY |__X__|__Y__| Bottom 4 bits of X, top 4 bits of Y PDY |_____Y_____| Bottom 8 bits of the Y coordinate PDP |/////|__P__| 4 bits giving finger pressureWhat minimal changes would you make to the code for the touch screen input driver and what code would you write for the asynchronous input interrupt service routine connected to the mouse to make a mouse driver that would behave (to user software) as if it was a touch screen driver. Write concisely. (2.2 points)
______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________