From owner-freebsd-hackers Fri Sep 18 15:43:08 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA19896 for freebsd-hackers-outgoing; Fri, 18 Sep 1998 15:43:08 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from artemis.syncom.net (artemis.syncom.net [206.64.31.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA19707 for ; Fri, 18 Sep 1998 15:42:04 -0700 (PDT) (envelope-from cyouse@artemis.syncom.net) Received: from localhost (localhost [[UNIX: localhost]]) by artemis.syncom.net (8.8.8/8.8.8) with SMTP id SAA09452; Fri, 18 Sep 1998 18:53:51 -0400 (EDT) Date: Fri, 18 Sep 1998 18:53:50 -0400 (EDT) From: Charles Youse To: zhihuizhang cc: hackers Subject: Re: PC memory usage (what is PIC?) In-Reply-To: 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 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