Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Jul 2022 21:12:18 -0700
From:      Kyle Evans <kevans@freebsd.org>
To:        Obsto Clades <obsto.clades@zohomail.com>
Cc:        hackers@freebsd.org
Subject:   Re: lua loader
Message-ID:  <CACNAnaEPwNv9bBWjHyMZ-bS=Y0jGi8dthvyxiBg0e-wRTc0uJw@mail.gmail.com>
In-Reply-To: <5a874623-76e4-7fd6-2e81-2aed51f07cbd@zohomail.com>
References:  <F50628CB-1100-4EB6-8682-4B42B1B15800@chrisbowman.com> <5a874623-76e4-7fd6-2e81-2aed51f07cbd@zohomail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jul 29, 2022 at 6:06 PM Obsto Clades <obsto.clades@zohomail.com> wr=
ote:
>
> On 7/29/22 14:26, Christopher Bowman wrote:
> > I=E2=80=99ve been looking through the lua code in /boot/loader/lua I ca=
n=E2=80=99t really say I understand how the FDT gets loaded or even find th=
e code that does but I am able to load a DTB using:
> >
> > load -t dtb /boot/dtb/foo.dtb
> >
> > It doesn=E2=80=99t see that overlays are supported (at least in the lua=
 loader).  I have a fdt_overlay=3D=E2=80=9Coverlay.dtb=E2=80=9D statement i=
n my loader.conf but I don=E2=80=99t see it being honored.
> > Am I correct in understanding that?
> >
> > If I=E2=80=99m not correct could someone point me at the code that does=
 the overlay loading so I could look at it?
> > Thanks
> > Christopher
>
>
> I am also interesting in learning more about the lua loader.  So, if
> anybody replies to Christopher's question, could you please include me
> in your replies.
>

Hey,

I ended up reaching out to Christopher out-of-band (IRC) after
identifying them from a question they had asked a couple days ago. The
answer to this particular question is that fdt_overlays doesn't
require any real interpreter support -- it's all implemented in C
(see: stand/fdt/fdt_loader_cmd.c; I had gotten the path wrong both in
IRC and another e-mail I sent not too long ago. D'oh!). The
interpreted scripts will read loader.conf and stuff (most) of the
contents into the loader environment, which is how the C part
understands that it needs to apply some overlay(s). A couple of
different actions will trigger overlay application; it should happen
automatically at or maybe a little after loadelf (lualoader's term for
it) but before jumping to the kernel, or you can drop to the loader
prompt and trigger it manually by trying to inspect the loaded FDT
with the fdt command.

Thanks,

Kyle Evans



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACNAnaEPwNv9bBWjHyMZ-bS=Y0jGi8dthvyxiBg0e-wRTc0uJw>