Learning Goal: I’m working on a operating systems question and need support to help me learn.
1.How does OS/161 uses the struct trapframe?
2.In which directory is the trapframe defined (i.e., where is the header file that defines the trapframe)?
3.What do the fields of the trapframe represent?
4.What information is stored in the following fields of the trapframe?
5.Where is the OS/161’s trapframe first filled in when a context switch takes place? Write the name of the file (program) and the code extract of the part of the program that stores the trapframe.
6.Traps and interrupts are mechanisms used to transfer control between user-level processes and the operating system. Tell us where we can find the first C-language function of OS/161 that is executed when a trap occurs. Then, tell us where control gets transferred to from that point (i.e., what function services the trap). Be sure to describe the control flow for each type of trap that may occur (e.g., system calls, VM faults, and hardware interrupts).
7.Each OS/161 exception has its own code. What are the exception codes for the exceptions: interrupt, system call, and arithmetic overflow?
8.What is the name of the c-language function that plays the role of the system-call handler in OS/161? In which directory is this function implementation located?
9.In the system-call handler of OS/161, Lines 108 and 109 implement the call for the system call sys___time. What is the meaning of the arguments tf->tf_a0 and tf->tf_a1 in that implementation?
10.In which file is the system call int sys___time implemented?
11.Why does the function int sys___time returns zero upon its completion? What happens if the function returns a non-zero value?