From c5163e4a4244c5834971bd2b285205205439dbd3 Mon Sep 17 00:00:00 2001 From: Robert Morris Date: Fri, 2 Aug 2019 16:22:56 -0400 Subject: [PATCH] nits --- labs/syscall.html | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/labs/syscall.html b/labs/syscall.html index 26cb573..835e510 100644 --- a/labs/syscall.html +++ b/labs/syscall.html @@ -287,7 +287,7 @@ use only one CPU, which you can do by running are passing test0(), and should proceed to the next section. do they need to make sure at this point that they see multiple alarm! printouts? or is it OK if they see one alarm! and -then a crash? +then a crash? may need to fix the sample ...alarm! output shown above @@ -301,35 +301,33 @@ about it, and hint or say why they are not done even though test0() works.

Test0 doesn't test whether the handler returns correctly to - the interrupted instruction. If you didn't get this right, it - is likely that test1 will fail (the program crashes or the program + the user instruction that was interrupted by the timer. + The previous section didn't require you to get this right. + If you didn't, test0 will probably succeed anyway, but + test1 will likely fail (the program crashes or the program goes into an infinite loop). - -

A main challenge is to arrange that when the handler returns, it - returns to the instruction where the program was interrupted. Which - register contains the return address of a function? When the kernel - receives an interrupt, which register contains the address of the - interrupted instruction? + Another challenge is that the register contents need to be + correct when control returns to the interrupted user instruction.

Your solution is likely to require you to save and restore registers---what registers do you need to save and restore to resume the interrupted code correctly? (Hint: it will be many). There are - several ways to do this, but one convenient way is to add another + several ways to restore the registers; one convenient plan is to add another system call sigreturn that the handler calls when it is - done. Your job is to arrange that sigreturn returns to the - interrupted code. + done, and which restores registers and returns to the original + interrupted user instruction. Some hints:

Once you pass test0 and test1, run usertests to