q1_fall02_sol

q1_fall02_sol - Department of Electrical Engineering and...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Department of Electrical Engineering and Computer Science MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.097 Operating System Engineering: Fall 2002 Quiz I All problems are open-ended questions. In order to receive credit you must answer the question as precisely as possible. You have 80 minutes to answer this quiz. Write your name on this cover sheet AND at the bottom of each page of this booklet. Some questions may be much harder than others. Read them all through first and attack them in the order that allows you to make the most progress. If you find a question ambiguous, be sure to write down any assumptions you make. Be neat. If we can’t understand your answer, we can’t give you credit! THIS IS AN OPEN BOOK, OPEN NOTES QUIZ. 1 (xx/35) 2 (xx/20) 3 (xx/25) 4 (xx/15) 5 (xx/5) Total (xx/100) Name:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
I 6.097 FALL 2002, Quiz 1 Page 2 of 7 Traps/Interrupts 1. [15 points]: Draw a picture of the kernel stack after the following events have happened: (1) the icode program has called the exec system call; and (2) a clock interrupt handler has interrupted exec() at line 3027; and (3) the clock handler just finished executing line 3739? For each entry on the stack describe what that entry represents. You may ignore local variables. (Draw high addresses high.) The kernel stack starts off empty. A system call must be the first thing on a trap frame at this point — if any interrupts happened before, they would not have had any other process to switch to on the return path. in trap PSW from icode PC of icode’s SYS instruction r0 of icode PSW after trap (br7 + 6) r1 of icode SP of icode masked PSW after trap (6) return address for call1 return (line 786) in trap saved r5 saved r4 saved r3 saved r2 &cret &exec (an argument to trap1) return address in trap (line 2772) in trap1 saved r5/r4/r3/r2 + &cret return address in trap1 (line 2848) in exec saved r5/r4/r3/r2 + &cret CLOCK interrupt PSW from exec PC from exec (line 3027) r0 from exec PSW after interrupt (br6) r1 from exec sp (same as sp now) masked PSW return address in trap (line 800) in clock saved r5/r4/r3/r2 + &cret Name:
Background image of page 2
6.097 FALL 2002, Quiz 1 Page 3 of 7 2. [5 points]: Which kernel stack is the one you drew in response to question 1? Kernel stack 0? Kernel stack 1? (Explain your answer briefly) Kernel Stack 1 is used. Process 1 (icode) was executing at the time of the trap and so its kernel stack is used. If the machine is already in kernel mode when an interrupt happens, the current kernel stack is used. 3. [5 points]:
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/29/2010 for the course 6 828 taught by Professor Guy during the Spring '08 term at MIT.

Page1 / 7

q1_fall02_sol - Department of Electrical Engineering and...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online