Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 May 1998 13:13:40 -0400 (EDT)
From:      zhihuizhang <bf20761@binghamton.edu>
To:        hackers <freebsd-hackers@FreeBSD.ORG>
Subject:   Simple Virtual Memory Questions
Message-ID:  <Pine.SOL.L3.93.980519113903.5341A-100000@bingsun2>

next in thread | raw e-mail | index | archive | help

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.L3.93.980519113903.5341A-100000>