Question: 12. Consider the code. How is the system call number (read into num) first loaded into curproc->tf->eax? void syscall(void) { int num; struct proc *curproc

 12. Consider the code. How is the system call number (read

12. Consider the code. How is the system call number (read into num) first loaded into curproc->tf->eax? void syscall(void) { int num; struct proc *curproc = myproc(); 13 it is saved onto the kernel stack by the hardware as part of the int instruction behav num = curproc->tf->eax; if(num > 0 && num tf->eax = syscalls[num](); } else { cprintf("%d %s: unknown sys call %d ", curproc->pid, curproc->name, num); curproc->tf->eax = -1; } } the user places the argument to the system call here before calling int the kernel saves all the general purpose registers onto the kernel stack as part of th the kernel copies it there as a result of a preceding call to argint

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!