Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Jul 2008 15:36:22 +0200
From:      Max Laier <max@love2party.net>
To:        freebsd-hackers@freebsd.org
Cc:        FreeBSD Hackers <ml.freebsd.hackers@gmail.com>
Subject:   Re: General questions about virtual memory
Message-ID:  <200807301536.23274.max@love2party.net>
In-Reply-To: <591f70e00807300459j74aac11eob0bea7cdf4b4dcd4@mail.gmail.com>
References:  <591f70e00807300459j74aac11eob0bea7cdf4b4dcd4@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

On Wednesday 30 July 2008 13:59:53 FreeBSD Hackers wrote:
> Examples of some specific questions that I have include:
>
> WRT translation of virtual addresses to physical addresses, where does the
> hardware stop and the software begin?  Explanation: who determines the
> format of the page tables (CPU or OS)?  Who populates and maintains the
> page tables?  Where does the translation lookaside buffer reside?  Who
> maintains the TLB?

it depends ... different architectures use different models.  In i386 most of 
the above is done by hardware aided by software (i.e. the software has to 
flush the hardware TLB when it knows that the entries are no longer up to date 
...)

> Also WRT page tables, how does the OS and the MMU adjust for different
> sizes of physical RAM?  Wouldn't the page tables for a system with 512 MB
> of RAM will be fewer than the page tables for a system with 2 GB of RAM? 
> How does the CPU know how many page table entries there are?

This suggest that you don't understand virtual memory at all.  Go back to the 
start of the chapter and re-read.  The page directories and page tables 
describe a *virtual* address space.  For a given architecture the *virtual* 
address space has a fixed size (4GB for i386), so the page table structure is 
always the same size (though it might be sparsely populated).  Inside the page 
table you store *physical* addresses, the size of which is defined by the 
hardware.  Also note that the physical addresses of your RAM might not 
necessarily start at zero and go for XX MB ... you need additional bookkeeping 
to track that (see core map, free lists, ...).  The size of the PTE is defined 
by hardware and doesn't change at runtime.

> I have a few more questions, but for starters this is the kind of
> information I'm seeking.  I'm just not getting a clear enough picture from
> the textbook I'm reading now.  (It makes me wish I was still in college so
> I could dump my questions on my college professor. :)
>
> If anyone is willing to help me understand this, I would greatly appreciate
> it.  I would also value your input if there are other resources (people,
> mailing lists, books, web pages, etc.) that you want to recommend instead
> of taking some time to help teach me.

google, wikipedia, the FreeBSD articles, ... all there at your fingertips.

-- 
/"\  Best regards,                      | mlaier@freebsd.org
\ /  Max Laier                          | ICQ #67774661
 X   http://pf4freebsd.love2party.net/  | mlaier@EFnet
/ \  ASCII Ribbon Campaign              | Against HTML Mail and News



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200807301536.23274.max>