首页 > 试题广场 >

Program binaries in many syste

[问答题]
Program binaries in many systems are typically structured as follows. Code is stored starting with a small fixed virtual address such as 0. The
code segment is followed by the data segment that is used for storing the program variables. When the program starts executing, the stack is
allocated at the other end of the virtual address space and is allowed to grow towards lower virtual addresses. What is the significance of the
above structure on the following schemes:
a. contiguous-memory allocation
b. pure segmentation
c. pure paging
推荐
1) Contiguous-memory allocation requires the operating system to allocate the entire extent of the virtual address space to the program when it starts executing. This could be much higher than the actual memory requirements of the process.
2) Pure segmentation gives the operating system flexibility to assign a small extent to each segment at program startup time and extend the segment if required.
3) Pure paging does not require the operating system to allocate the maximum extent of the virtual address space to a process at startup time, but it still requires the operating system to allocate a large page table spanning all of the program's virtual address space.
When a program needs to extend the stack or the heap, it needs to allocate a new page but the corresponding page table entry is preallocated.
发表于 2018-03-23 21:56:41 回复(0)