Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Nov 2006 18:43:51 +0300
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        freebsd-stable@FreeBSD.org, Stefan Bethke <stb@lassitu.de>, John Baldwin <jhb@FreeBSD.org>, Bruce Evans <bde@FreeBSD.org>
Subject:   Re: Still possible to directly boot without loader?
Message-ID:  <20061101154351.GB2247@rambler-co.ru>
In-Reply-To: <20061102001337.D31271@delplex.bde.org>
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>

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

--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 - <File off> for at least this kernel.  boot2 now
> loads the text section from file offset <File off> 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061101154351.GB2247>