From owner-freebsd-hackers Mon Jul 27 09:33:57 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA16324 for freebsd-hackers-outgoing; Mon, 27 Jul 1998 09:33:57 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from ultra3 (ultra3.cc.binghamton.edu [128.226.4.23]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id JAA16314 for ; Mon, 27 Jul 1998 09:33:51 -0700 (PDT) (envelope-from bf20761@binghamton.edu) Received: from localhost (bf20761@localhost) by ultra3 (SMI-8.6/8.6.9) with SMTP id MAA00424; Mon, 27 Jul 1998 12:33:13 -0400 Date: Mon, 27 Jul 1998 12:33:11 -0400 (EDT) From: zhihuizhang X-Sender: bf20761@ultra3 To: David Greenman cc: hackers Subject: Re: APTDpde question (pmap) In-Reply-To: <199807262229.PAA16544@implode.root.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, 26 Jul 1998, David Greenman wrote: > >In pmap.c module, we set PTDPTDI entry of the page directory page to point > >to itself. So PTDpde and PTmap works well. However, I do not find a > >similar setting of APTDTDI (=1023) in pmap.c. My question is how APTDpde > >and the alternate address space it's supposed to relate to (APTmap) are > >used. (has something to do with pmap copy?) > > The alternate page table map is used when the kernel wants to access the > page tables of a non-current process. The page directory of the target > process is mapped at PTD offset 1023, which causes the target process's page > tables to become accessable in the final 4MB of the current address space. > (Please note that PTDPTDI = 959) I read the get_ptbase() again. The way it judges whether we are current address space is by comparing pmap->pm_pdir[PTDPTDI] & PG_FRAME and (((unsigned) PTDpde) & PG_FRAME). The value of pmap->pm_pdir[PTDPTDI] & PG_FRAME is the physical address of the page directory page of the pmap (set up by pmap_pinit()). But I am confused with the meaning of (((unsigned)PTDpde) & PG_FRAME). I thought the value of PTDpde (and similar things happen for APTDpde) is fixed as 959|959|959 (I divide the linear address into three parts, separating them by "|"). But the address, not the value, of the PTDpde should be 959|959|959 to make things work, because I believe that the way to determine that we are the current address space is to make sure that we are using the same page directory page. So I go to locore.s where PTDpde is defined. locore.s uses the .set directive. I guess the .set directive is not equal to assignment statement in C programming language. I looked the info file and find the following: "The value of a symbol is (usually) 32 bits. For a symbol which labels a location in the text, data, bss or absolute sections the value is the number of addresses from the start of that section to the label. Naturally for text, data and bss sections the value of a symbol changes as `ld' changes section base addresses during linking. Absolute symbols' values do not change during linking: that is why they are called absolute." So for assembly, the *value* of the absolute symbol PTDpde (actually _PTDpde) is 959|959|959. But for C, PTDpde has the address (not the value) of 959|959|959. Am I right? Please clarify this for me. Thanks for your help. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message