Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Sep 1998 18:53:50 -0400 (EDT)
From:      Charles Youse <cyouse@artemis.syncom.net>
To:        zhihuizhang <bf20761@binghamton.edu>
Cc:        hackers <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: PC memory usage (what is PIC?)
Message-ID:  <Pine.NEB.3.96.980918183750.9143A-100000@artemis.syncom.net>
In-Reply-To: <Pine.SOL.L3.93.980918172000.16483A-100000@bingsun1>

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

On Fri, 18 Sep 1998, zhihuizhang wrote:

> Since it has been linked for another (high) address, it will have to 
> execute PIC until the page table and page directory stuff is setup properly, 
> at which point paging will be enabled and the kernel will finally run at 
> the address for which it was linked.
> 
> Can anyone explain to me what is PIC and the two different linked
> addresses mentioned here?

PIC refers to Position-Independent Code, which requires that all
references to memory be relative to the IP register.  Code written in this
way will execute correctly no matter where it is loaded into the address
space.

Because the kernel is linked to run at a different address than it's
loaded, references to absolute addresses will fetch invalid data from a
[nonexistent] random memory location.  The solution is to restrict the
kernel to PIC (which has no such absolute references) until the vm
subsystem is initialized to redirect those absolute [virtual] addresses to
the proper physical addresses.

It's actually much easier to understand than it is to explain ;) 

Chuck Youse
cyouse@syncom.net



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.NEB.3.96.980918183750.9143A-100000>