This preview shows page 1. Sign up to view the full content.
Unformatted text preview: data) unused loaded from the executable file 0x08048000 0 Figure 10.10: The memory image of a Linux process. Programs always start at virtual address 0x08048000. The user stack always starts at virtual address 0xbfffffff. Shared objects are always loaded in the region beginning at virtual address 0x40000000. However, in some instances it is desirable for processes to share code and data. For example, every process must call the same operating system kernel code, and every C program makes calls to routines in the standard C library such as printf. Rather than including separate copies of the kernel and standard C library in each process, the operating system can arrange for multiple processes to share a single copy of this code by mapping the appropriate virtual pages in different processes to the same physical pages. 10.4.3 Simplifying Memory Allocation
Virtual memory provides a simple mechanism for allocating additional memory to user processes. When a program running in a user process requests additional heap space (e.g., as a result of calling malloc), the operating system allocates an appropriate number, say , of contiguous virtual memory pages, and maps them to arb...
View Full Document