This preview shows page 1. Sign up to view the full content.
Unformatted text preview: e contents of kernel data structures. The /proc ﬁlesystem exports the contents of many kernel data structures as a hierarchy of ASCII ﬁles that can read by user programs. For example, you can use the Linux proc ﬁlesystem to ﬁnd out general system attributes such as CPU type (/proc/cpuinfo), or the memory segments used by a particular process (/proc/<process id>/maps). 8.2.4 Context Switches
The operating system kernel implements multitasking using a higher-level form of exceptional control ﬂow known as a context switch. The context switch mechanism is built on top of the lower-level exception mechanism that we discussed in Section 8.1. The kernel maintains a context for each process. The context is the state that the kernel needs to restart a preempted process. It consists of the values of objects such as the general-purpose registers, the ﬂoatingpoint registers, the program counter, user’s stack, status registers, kernel’s stack, and various kernel data structures such as a page table that characterizes the address...
View Full Document
- Spring '10
- The American