From 5e04fb305ea3eb2aa6dd6bea3a35f5892ae5e56b Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Mon, 6 May 2019 22:22:13 -0700 Subject: [PATCH] Add answers for lab3 part A --- answers-lab3.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 answers-lab3.txt diff --git a/answers-lab3.txt b/answers-lab3.txt new file mode 100644 index 0000000..51cfee0 --- /dev/null +++ b/answers-lab3.txt @@ -0,0 +1,12 @@ +1. Some interrupts receive a different "shape" of stack frame - the kernel pushes +an error code for some, but not for the others. We thus need individual handlers +that would make sure that what we have on the stack is consistent, and +then call one centralized function for that. The handlers additionally +are able to pass in a trap number to that centrallized function. This way, a lot +of code can be re-used. + +Conceptually, each trap has a different semantic meaning. Thus, it makes no sense +to perform the same action for both traps - they don't mean the same thing. + +2. The general protection fault occurs when a process can access memory, but not do something else with it. We do not want page faults to be trigger-able by users (this is the case for many other traps). Thus, when the user tries to invoke int 14, +it's not allowed to execute it from userspace, so it is thrown a general protection fault, which it then prints.