13 lines
931 B
Plaintext
13 lines
931 B
Plaintext
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.
|