
A rectangular box has two partitions: The upper partition is labeled User Space, and the lower partition is labeled Kernel space (Operating system). The upper partition consists of Library procedure read and User program calling read. The Library procedure read has three sections labeled return to the caller, trap to the kernel, and Put code for reading in R A X reg. The User program calling read has five sections labeled (next instruction), call read, put n bytes in R D X register, Put buffer in R S I register, and Put fd in R D I register. Put n bytes in R D X register, Put buffer in R S I register, and Put fd in R D I register are labeled 3 to 1 respectively. Kernel space has three sections labeled Dispatch, the center section is marked with horizontal lines and the right section is labeled Sys call handler. An arrow labeled 7 from the first section connects the center section. Another arrow labeled 8 from the center section connects the right section. An arrow labeled 4 from call read points to put code for reading in R A X reg. An arrow labeled 6 from trap to kernel points to Dispatch. An arrow labeled 9 from the sys call handler to return to the caller. An arrow labeled 10 from the return to a caller that points to the next instruction.
Back