If we are talking about actual 32 bit x86 (rather than some hypothetical architecture) the two common layouts (with and without PAE) are:
The top of the structure is a "Page Directory Pointers Table". That table has 4 eight-byte entries, each of which gives the page directory for one quarter of the address space. In your example, with top and bottom of the 32-bit address space used, the first and last of those four pointers must point to valid page directories.
Each page directory has 512 eight-byte entries for page tables.
Each page table has 512 eight-byte entries for pages.
The top of the structure is a single page directory
The page directory has 1024 four-byte entries for page tables.
Each page table has 1024 four-byte entries for pages.
Originally Posted by jimwarlock
Each page table is 4KB in size, with a 32-bit address space required for each page. ie every 4KB page takes up 32-bit of main memory in addressing space.
Am I on the right track here??
Not quite. First error is that an entry may be 32-bits or 64-bits depending on whether PAE (what you instructor is calling "3-level") is enabled. Second error is that you need to allocate entire page tables and entire page directories. So counting entries is wrong. Figure out how many page tables and how many page directories you need and add up all that memory.
How much main memory is needed for the page table
I find that phrase ambiguous. Maybe it means "page tables
" so you would ignore the page directories and Page Directory Pointers Table. But more likely it means "page table structure" including the page directories and even the 32 byte Page Directory Pointers Table.
I'm also confused with the significance of each block of data being designated virtual addresses. Does that affect the amount of main memory used
Because you work with whole page tables and whole page directories, the alignment matters.
In the 3-level structure, each page directory can map 1GB of virtual space. You want to map far less than 1GB virtual, so ignoring the designated addresses you would think one page directory is enough. But the designated addresses make you need a small part of each of two different page directories. You can't have part of a page directory, so if you need part of one you must have the whole thing.
In the 2-level structure, you need 14.5 page tables for the initial 58MB and you need 17.5 page tables for the final 70MB. If there were no addresses designated you could add 14.5 to 17.5 to get the number of page tables needed. But with the designated address those two half page tables can't be merged.