Get premium membership and access questions with answers, video lessons as well as revision papers.

Using a simple system call as an example (e.g. getpid, or uptime), describe what is generally involved in providing the result, from the point of...

      

Using a simple system call as an example (e.g. getpid, or uptime), describe what is
generally involved in providing the result, from the point of calling the function in the C
library to the point where that function returns

  

Answers


Faith
A system call is completed as follows:
- As the function is called, an interrupt of the type “software exception” is placed on the processor,
causing a Context Switch to take place between the calling function and the kernel.
- The exception handler will clear out and save user registers to the kernel stack so that control may be
passed on to the C function corresponding to the syscall.
- The syscall is executed.
- The value(s) returned by the syscall is placed into the correctly corresponding registers of the CPU (the
same ones that a user function normally places its return values in).
- The handler takes this value, restores user registers and returns said value to the user programme that
called it.
Titany answered the question on April 25, 2022 at 13:34


Next: Describe the two general roles of an operating system, and elaborate why these roles are important
Previous: Widespread investment company Ltd. is planning to develop and market product “X”. Annual cash flows associated with the project are as follows: The company will have...

View More Operating Systems Questions and Answers | Return to Questions Index


Learn High School English on YouTube

Related Questions