Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Aug 2022 11:01:50 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        Warner Losh <imp@freebsd.org>, src-committers <src-committers@freebsd.org>,  "<dev-commits-src-all@freebsd.org>" <dev-commits-src-all@freebsd.org>, dev-commits-src-main@freebsd.org
Subject:   Re: git: e2295b911723 - main - stand: i386/amd64: Always use elf format for /boot/loader and pxeldr
Message-ID:  <CANCZdfppNvgWuXghkmcWY81AwhupYmfud7SrT83WJau7Jg_K3w@mail.gmail.com>
In-Reply-To: <f44dddfc-80df-fbfd-f6b1-4bafae4b9580@FreeBSD.org>
References:  <202208110331.27B3VZj9007311@gitrepo.freebsd.org> <f44dddfc-80df-fbfd-f6b1-4bafae4b9580@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000c3dbbd05e5fa1f24
Content-Type: text/plain; charset="UTF-8"

Hey John,

On Thu, Aug 11, 2022 at 10:44 AM John Baldwin <jhb@freebsd.org> wrote:

> On 8/10/22 8:31 PM, Warner Losh wrote:
> > The branch main has been updated by imp:
> >
> > URL:
> https://cgit.FreeBSD.org/src/commit/?id=e2295b9117233d8248fe919c6b28ef1d44a8950d
> >
> > commit e2295b9117233d8248fe919c6b28ef1d44a8950d
> > Author:     Warner Losh <imp@FreeBSD.org>
> > AuthorDate: 2022-08-11 03:18:32 +0000
> > Commit:     Warner Losh <imp@FreeBSD.org>
> > CommitDate: 2022-08-11 03:28:22 +0000
> >
> >      stand: i386/amd64: Always use elf format for /boot/loader and pxeldr
> >
> >      The first level boot blocks have understood how to load ELF code
> since
> >      1999. Switch /boot/loader and /boot/pxeldr over to being ELF format
> so
> >      that in-tree tools can examine them more closely. In addition, one
> >      could, in theory, now have a 'lo-mem' and a 'hi-mem' segment
> (though a
> >      lot of work would need to be done with bounce buffers, btx, code
> segment
> >      marking, etc for an arrangement like that to work).
> >
> >      As far as I can tell, this is the last a.out binary in the tree.
> There
> >      are several raw binaries left, but everything else is ELF.
>
> Unfortunately not all of our boot blocks are ready for this.
>
> pxeboot consists of pxldr.S glued in front of a /boot/loader binary and
> pxeldr.S
> assumes an a.out header which it parses to know how large /boot/loader is
> how
> to relocate it and it's nested BTX kernel.
>

OK. I'll have to revert this and this size change then. I'll take your
suggestion
from IRC and move the size check against loader.bin and reduce the limit
by 3,000 or so bytes. I should have checked this...


> Similarly, cdboot.S used for booting of ISO images reads /boot/loader
> directly
> off of an ISO and also assumes an a.out header for /boot/loader.
>

Yea, I'd thought cdboot.S was pc98 only, but I see that's incorrect.

Warner

--000000000000c3dbbd05e5fa1f24
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">Hey John,<br></div><br><div class=3D"gmai=
l_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Thu, Aug 11, 2022 at 10:4=
4 AM John Baldwin &lt;<a href=3D"mailto:jhb@freebsd.org">jhb@freebsd.org</a=
>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px=
 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On =
8/10/22 8:31 PM, Warner Losh wrote:<br>
&gt; The branch main has been updated by imp:<br>
&gt; <br>
&gt; URL: <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3De2295b911723=
3d8248fe919c6b28ef1d44a8950d" rel=3D"noreferrer" target=3D"_blank">https://=
cgit.FreeBSD.org/src/commit/?id=3De2295b9117233d8248fe919c6b28ef1d44a8950d<=
/a><br>
&gt; <br>
&gt; commit e2295b9117233d8248fe919c6b28ef1d44a8950d<br>
&gt; Author:=C2=A0 =C2=A0 =C2=A0Warner Losh &lt;imp@FreeBSD.org&gt;<br>
&gt; AuthorDate: 2022-08-11 03:18:32 +0000<br>
&gt; Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh &lt;imp@FreeBSD.org&gt;<br>
&gt; CommitDate: 2022-08-11 03:28:22 +0000<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 stand: i386/amd64: Always use elf format for /boot=
/loader and pxeldr<br>
&gt;=C2=A0 =C2=A0 =C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 The first level boot blocks have understood how to=
 load ELF code since<br>
&gt;=C2=A0 =C2=A0 =C2=A0 1999. Switch /boot/loader and /boot/pxeldr over to=
 being ELF format so<br>
&gt;=C2=A0 =C2=A0 =C2=A0 that in-tree tools can examine them more closely. =
In addition, one<br>
&gt;=C2=A0 =C2=A0 =C2=A0 could, in theory, now have a &#39;lo-mem&#39; and =
a &#39;hi-mem&#39; segment (though a<br>
&gt;=C2=A0 =C2=A0 =C2=A0 lot of work would need to be done with bounce buff=
ers, btx, code segment<br>
&gt;=C2=A0 =C2=A0 =C2=A0 marking, etc for an arrangement like that to work)=
.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 As far as I can tell, this is the last a.out binar=
y in the tree. There<br>
&gt;=C2=A0 =C2=A0 =C2=A0 are several raw binaries left, but everything else=
 is ELF.<br>
<br>
Unfortunately not all of our boot blocks are ready for this.<br>
<br>
pxeboot consists of pxldr.S glued in front of a /boot/loader binary and pxe=
ldr.S<br>
assumes an a.out header which it parses to know how large /boot/loader is h=
ow<br>
to relocate it and it&#39;s nested BTX kernel.<br></blockquote><div><br></d=
iv><div>OK. I&#39;ll have to revert this and this size change then. I&#39;l=
l take your suggestion</div><div>from IRC and move the size check against l=
oader.bin and reduce the limit</div><div>by 3,000 or so bytes. I should hav=
e checked this...</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pad=
ding-left:1ex">
Similarly, cdboot.S used for booting of ISO images reads /boot/loader direc=
tly<br>
off of an ISO and also assumes an a.out header for /boot/loader.<br></block=
quote><div><br></div><div>Yea, I&#39;d thought cdboot.S was pc98 only, but =
I see that&#39;s incorrect.</div><div><br></div><div>Warner</div></div></di=
v>

--000000000000c3dbbd05e5fa1f24--



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