From owner-freebsd-questions Sun Jun 13 12:17:19 1999 Delivered-To: freebsd-questions@freebsd.org Received: from ucsu.Colorado.EDU (ucsu.Colorado.EDU [128.138.129.83]) by hub.freebsd.org (Postfix) with ESMTP id C4E9614EDB for ; Sun, 13 Jun 1999 12:17:17 -0700 (PDT) (envelope-from doranj@ucsu.Colorado.EDU) Received: (from doranj@localhost) by ucsu.Colorado.EDU (8.9.3/8.9.3/ITS-5.0/standard) id NAA15776 for freebsd-questions@freebsd.org; Sun, 13 Jun 1999 13:17:16 -0600 (MDT) From: Jonathon Doran Message-Id: <199906131917.NAA15776@ucsu.Colorado.EDU> Subject: Re: Memory and Addressing Protection To: freebsd-questions@freebsd.org Date: Sun, 13 Jun 1999 13:17:16 -0600 (MDT) X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > My CD-ROM Drive is broken, and as a result, I can't get FreeBSD source onto > my home PC to analyze it. :( Could you please give me a technical overview > of how FreeBSD Memory Protection works? If you're busy, you can delay > answering this message for a few weeks, but I would appreciate a reply some > time this month if at all possible. This is probably beyond the scope of this list. But there is a short answer which will get you started. Look at "The Design and Implementation of the 4.4BSD Unix Operating System" (I have the 4.3 book, so I'm guessing at the title a bit). There is a chapter on memory management in my copy which does a good job of covering the fundamentals. Basically, when an address is used the memory management hardware (on the processor) checks that the page is loaded into the page table. If not, a page fault is generated. FreeBSD traps it, loads the page into memory (overwriting one of the older pages), and updates the TLB. The instruction causing the fault is re-executed (or restarted, in the case of a string instruction which can generate multiple faults during execution). This is pretty vanilla demand-paging. However, BSD has an unusual "clock" algorithm which cheaply estimates the least recently used page. (I said estimates, since it samples memory usage, and can miss things). PS: you can always install FreeBSD over the net, or copy the distribution to an msdos partition :-) Jon Doran To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message