From owner-freebsd-stable@FreeBSD.ORG Wed Nov 1 15:43:52 2006 Return-Path: X-Original-To: freebsd-stable@FreeBSD.org Delivered-To: freebsd-stable@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4C82316A403; Wed, 1 Nov 2006 15:43:52 +0000 (UTC) (envelope-from ru@rambler-co.ru) Received: from relay0.rambler.ru (relay0.rambler.ru [81.19.66.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id B400743D55; Wed, 1 Nov 2006 15:43:51 +0000 (GMT) (envelope-from ru@rambler-co.ru) Received: from relay0.rambler.ru (localhost [127.0.0.1]) by relay0.rambler.ru (Postfix) with ESMTP id 5AFC15FD2; Wed, 1 Nov 2006 18:43:50 +0300 (MSK) Received: from edoofus.park.rambler.ru (unknown [81.19.65.108]) by relay0.rambler.ru (Postfix) with ESMTP id 39D865F98; Wed, 1 Nov 2006 18:43:50 +0300 (MSK) Received: (from ru@localhost) by edoofus.park.rambler.ru (8.13.8/8.13.8) id kA1Fhpau020497; Wed, 1 Nov 2006 18:43:51 +0300 (MSK) (envelope-from ru) Date: Wed, 1 Nov 2006 18:43:51 +0300 From: Ruslan Ermilov To: Bruce Evans Message-ID: <20061101154351.GB2247@rambler-co.ru> References: <3A8131D4-881E-4873-A682-543A1A88C063@lassitu.de> <200610261542.35322.jhb@freebsd.org> <20061026195419.GA2972@rambler-co.ru> <200610301518.20175.jhb@freebsd.org> <20061102001337.D31271@delplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qjNfmADvan18RZcF" Content-Disposition: inline In-Reply-To: <20061102001337.D31271@delplex.bde.org> User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: No virus found Cc: freebsd-stable@FreeBSD.org, Stefan Bethke , John Baldwin , Bruce Evans Subject: Re: Still possible to directly boot without loader? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Nov 2006 15:43:52 -0000 --qjNfmADvan18RZcF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 02, 2006 at 12:44:56AM +1100, Bruce Evans wrote: > The masking hack is probably only needed for aout. For elf, > objdump -h /kernel says: >=20 > % Sections: > % Idx Name Size VMA LMA File off Algn > % ... > % CONTENTS, ALLOC, LOAD, READONLY, DATA > % 4 .text 002853e0 c043b510 c043b510 0003b510 2**4 >=20 > so KERNBASE =3D LMA - for at least this kernel. boot2 now > loads the text section from file offset to address LMA(masked). > I think it just needs to load at an address that is the same mod > PAGE_SIZE as LMA or VMA (these must agree mod PAGE_SIZE), provided it > adjusts the entry address to match. >=20 It isn't generally: : LINT/kernel: file format elf32-i386-freebsd :=20 : Sections: : Idx Name Size VMA LMA File off Algn : [...] : 4 .text 009c589c bf490e60 bf490e60 00090e60 2**4 : CONTENTS, ALLOC, LOAD, READONLY, CODE But: : $ nm LINT/kernel | grep kernbase : bf000000 A kernbase The "paddr" of the first loadable segment is KERNBASE + KERNLOAD, and KERNLOAD is always 2M for PAE and 4M for non-PAE. (Please see my other private email I just sent that goes into more detail about this, and provides one possible formulae to compute the KERNBASE from "paddr".) Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --qjNfmADvan18RZcF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFFSMC3qRfpzJluFF4RAjH/AJ0Tn7djdmy8yY1bUZiDfucu+cwl4gCdFyE/ pyp162Q+OwAayELO3LeE4ls= =etmQ -----END PGP SIGNATURE----- --qjNfmADvan18RZcF--