Connecting the Kernel View to the Process View

   

We are finally ready to tie the process logical view to the kernel virtual view. To review what we have seen so far, as a process is initialized, the system creates a linked list of pregion structures in accordance with header information stored in the program file. This information was created and placed in the executable file header by the linking-loader that built the program file. As Figure 6-12 shows, each program's logical pregions are linked to an underlying kernel region structure.

Figure 6-12. The Process View Meets the Kernel View

graphics/06fig12.gif


It is at this level of addressing abstraction that the first level of memory sharing may occur. If two instances of the same program are given process status on the system, they may both share pointers to the same text region. In addition, shared library objects may be mapped by many simultaneous processes. Another level of sharing may occur at the physical level; this is called virtual address aliasing. To understand this feature, we turn our attention to the physical page management features of the HP-UX kernel.

Managing Page Frames: Many Points of View

As we see in Figure 6-13, there are many ways to view a page frame. It all depends upon whether you are approaching memory from the kernel or a process point of view. So far in this chapter, we have concentrated on the logical and virtual aspects of memory management. Now we get down to the nitty-gritty of managing physical memory.

Figure 6-13. Managing Page Frames

graphics/06fig13.gif


Our first challenge is simply to know how many physical pages there are, which pages are free, and which have been allocated for use either by a user process or the kernel. To serve this need, HP-UX uses a modified version of an age-old structure called the page free data table, or pfdat. The pfdat structure has been around in concept since very early UNIX versions, even as far back as Bell Lab System (BLS) releases.

This table is part of the kernel's hardware-independent layer and is not directly connected to the virtual memory translation system. The kernel must manage physical pages and map them to the virtual memory space in alignment with the requirements of the kernel and its processes.



HP-UX 11i Internals
HP-UX 11i Internals
ISBN: 0130328618
EAN: 2147483647
Year: 2006
Pages: 167

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net