Problems in address allocation????

From: jeng (jeng@ccit.edu.tw)
Date: Mon Feb 21 2000 - 04:38:04 EST


Dear all

The following macro definition is from Linux 2.2.5 Kernel.
The file name is pgtable.h
The path is:
linux-2.2.5/include/asm-i386/

/* Find an entry in the third-level page table.. */
define pte_offset(pmd, address) \
((pte_t *) (pmd_page(*pmd) + ((address>>10) & ((PTRS_PER_PTE-1)<<2))))

Then, the referenced entry in the thid-level page table will refer to a page
frame in physical memory.
For example, assume that pmd=xxxx and address=yyyy, and the return value
from the macro definition is ffff, i.e., pte_offset(xxxx,yyyy) = ffff
Once again, memory address ffff will finally refer to a physical address
zzzz. zzzz will be an address of a page frame in the physical memory.

My problem is:

1. How does kenel allocate the physical address to the refered entry in the
third-level page table?
    In other words, how does ffff refer to zzzz?
    Where is the source code for this address allocation?

2. How does Kernel make sure that the allocated physical address is
available?
   In other words, how does kernel make sure that zzzz is available?

David

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Feb 23 2000 - 21:00:27 EST