12. we know process has 2 stacks kernel stack & user stack in the frame of user stack there are parameters of called function , so using user stack pointer it adds or subtracts an offset & get the parameters of system call.
13.
14. algorithm : syscall /* from invocation of system call * input : system call number (takes from “trap”) { find entry in “system call table” corresponding to system call number; determine number of parameters to the system call; copy parameters from “user address space” to U area; save current context for abortive return; invoke the code of system call reside in kernel; if(error during execution of system call) { set register 0 in “register context” to the error number; turn on “carry bit” in “process status” register in register context; } else /* success */ set register 0 and 1 in “register context” to return values of system call; } output : result of system call.