From owner-freebsd-hackers Tue May 19 10:14:11 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA29263 for freebsd-hackers-outgoing; Tue, 19 May 1998 10:14:11 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from bingsun2 (bingsun2.cc.binghamton.edu [128.226.1.6]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id KAA29178 for ; Tue, 19 May 1998 10:13:45 -0700 (PDT) (envelope-from bf20761@binghamton.edu) Received: from localhost (bf20761@localhost) by bingsun2 (SMI-8.6/8.6.9) with SMTP id NAA08683 for ; Tue, 19 May 1998 13:13:41 -0400 Date: Tue, 19 May 1998 13:13:40 -0400 (EDT) From: zhihuizhang X-Sender: bf20761@bingsun2 Reply-To: zhihuizhang To: hackers Subject: Simple Virtual Memory Questions 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 I believe the following VM questions are simple to experts and hope one of them will help me out (simple answer is OK): (1) I think the linked address should be the virtual address. The kernel is linked at virtual address 0xf0100000 (specified by the linker option -T ) and loaded at 0x00100000 (that is the reason why the relocation macro R(foo) works in locore.s). So what is the meaning of KERNBASE (0xf0000000)? The kernel image should start at 0xf0100000, not 0xf0000000. Besides, we have constants like UPT_MIN_ADDRESS and UPT_MAX_ADDRESS which are even less than KERNBASE. Can anyone clarify the use of virtual memory address space in kernel for me? (2) In locore.s, we install a pde for a temporary double map of bottom of VA by the following statements: movl R(_KPTphys), %eax xorl %ebx, %ebx movl $1, %ecx fillkpt(R(_IdlePTD), $PG_RW) The mapping is cleared, if I am correct, in pmap_bootstrap() by the following statement: * (int *) PTD = 0; I have not found any usage of this mapping before it is cleared. Am I wrong? If yes, what is the usage for this temporary mapping? (3) In routine pmap_growkernel(), we have the following statement: *pmap_pde(kernel_pmap, kernel_vm_end) = pdir_pde(PTD, kernel_vm_end); Is this redundant? Because we already have a statement in the same routine (before the above statement) which says: pdir_pde(PTD, kernel_vm_end) = (pd_entry_t)(VM_PAGE_TO_PHYS(nkpg) | PG_V |PG_RW); Thanks a lot. ------------------------------------------------- Zhihui Zhang 100 Roberts Street, Apt #21-6 Binghamton, NY 13901, U.S.A Web Site: http://cs.binghamton.edu/~zzhang ------------------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message