E the process that created the calling process

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: uction. The most important use of traps is to provide a procedurelike interface between user programs and the kernel known as a system call. User programs often need to request services from the kernel such as reading a file ( read), creating a new process (fork), loading a new program (execve), or terminating the current process (exit). To allow controlled access to such kernel services, processors provide a special “syscall Ò” instruction that user programs can execute when they want to request service Ò. Executing the syscall instruction causes a trap to an exception handler that decodes the argument and calls the appropriate kernel routine. Figure 8.6 summarizes the processing for a system call. From a programmer’s perspective, a system call is identical (1) Application syscall makes a Inext system call (2) control passes to handler (3) trap handler runs (4) handler returns to instruction following the syscall Figure 8.6: Trap handling. The trap handler returns control to the next instruction in the application program’s control flow. to a regular function call. However, their implementations are quite different. Regular functions run in 396 CHAPTE...
View Full Document

Ask a homework question - tutors are online