System Calls
API that programmers use to interact with OS
Special instructions that transfer control to the kernel
- similar to a function call
## Goal:
- Execute functions that the app cannot do in unprivileged mode
System Call Interface
Kernel mode vs. User mode
Interrupts & Exceptions
System Call Order
System calls are performed by using the T_SYS exception vector
- App loads the system call arguments into appropriate registers
- Load system call number in to
%rdi
- Execute
int 60
instruction
int
for interrupt, 60 corresponds to T_SYS
- Processor looks up the interrupt vector in a table
- Jumps to that address
- When done, return to userspace and user mode using
iret