From nobody Sun Jul 31 04:12:18 2022 X-Original-To: hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4LwSW973pnz4XslL for ; Sun, 31 Jul 2022 04:11:49 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LwSW96fR0z3nXf for ; Sun, 31 Jul 2022 04:11:49 +0000 (UTC) (envelope-from kevans@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659240709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZFvIqr8uyme7BBUfwMqpgPzPHE8x5MnDyqcmRnNMDtg=; b=quimJ6OyNp7wqdkdjwi9B+ivMcXYTKt7XwaGP0nFrm5KF3salPIy7njw0TF+yU8+Ix17NY ed6kKJppg0YOxYRMZjv5+Db9hrRWDuZ6wKy3nNEPZ3iDwEAuxmWPxUBcJAe7WqzRS9x8k4 h0L8nYxVwr1dGq6Wkj7dzGkosEhzAlWSeLgJjmysxhOpviRyPXoqK+n8X9mgcIEA7NI6Qc FrQ7VX6Z8yIwnZt+CigZCwArHjKviEY6F87PmTm8I5sIgIEkR6J3Lv0FznbC0OCNJWhVPE IfQWGvfURzQlaWbi7eClHs2saSZOa/UILP6TEuSwcK5EZHKojMbw0my69VaFIA== Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 4LwSW95HhNz1QKh for ; Sun, 31 Jul 2022 04:11:49 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-ej1-f54.google.com with SMTP id kb8so231166ejc.4 for ; Sat, 30 Jul 2022 21:11:49 -0700 (PDT) X-Gm-Message-State: AJIora+eUzlLqc4fUeYGfHm8VUKblDwF03oE7kwGlVRkC2G7Sqeixw8y ZIwLBtl35IHDz1DSBiiQcOZwd35uEotv4X0p5B4= X-Google-Smtp-Source: AGRyM1uuYb0OvHiiNJ+GTBGGW6s2cOfAAL7sZxuBQrqbpZJL3EyH9laR+uby4qXJe9FN2KqDbtNBpaOSwfWhPEKyi4Y= X-Received: by 2002:a17:906:8477:b0:72b:3e65:55c5 with SMTP id hx23-20020a170906847700b0072b3e6555c5mr7731567ejc.255.1659240708665; Sat, 30 Jul 2022 21:11:48 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 References: <5a874623-76e4-7fd6-2e81-2aed51f07cbd@zohomail.com> In-Reply-To: <5a874623-76e4-7fd6-2e81-2aed51f07cbd@zohomail.com> From: Kyle Evans Date: Sat, 30 Jul 2022 21:12:18 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: lua loader To: Obsto Clades Cc: hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659240709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZFvIqr8uyme7BBUfwMqpgPzPHE8x5MnDyqcmRnNMDtg=; b=wGsCdryVdoT6VVvGKmIvvznvLVNVSKDy37m4sgpZNVdV+6JcPnS2xyjP2lzeSbLCpVZH36 ryoKD7B3NHjRmhrzE06sXHKsjViOxiDLdd1bSR2aYOxnFy/stU2dmNV8NTTG2n9ytzok+9 0vB2Qmd9bdG5LO8V5ZBWYtLDdXZVxG/mRKJck/JOMGKbCikNwYzVN//7D1FyB4vir4aEop 1xQ40FBwoABmA+N/Yf4Hn486YY5O6IrFqLOPpVtNKc0pl3BRT+rylSunbY1k+r+cLkMgFB wpZHAa+C7nWrYNL7XkNAm7TPjrKh0GT4IZBs3FoL0EgWyZxVGc7BblGgJx6LPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659240709; a=rsa-sha256; cv=none; b=PkMrOTIQMfsgBxITRqSlyrAV/PYA1gOaTbpBAqu1MAgRGvFXETvThmgVfcnIKVxL+0G7ZP cn0Fqc7gSEzlZwOzIO4/ODxDJqvYNzRVEY5s/JiKvZsiGYC2i6NiWGz5j4b+jz7kHRsVRd I5cOeA1HKmubWTG761kOHGnY0hQzZNiCRvsy2v6DqGrK5kDB3z7r3gC83r5Re1qu/KB3Yp XiYr7MrGWQTzbyj+WaOKSlv9zR3P8j2ss0vTs3LazxTITBYGWeHV+K8sObsHjLsPIa+9QI f7LDee672YW91zqtwHgsivbvYLa+Q5BlBhMbc8l/hd62NPni1nJSlJM8I3eErA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On Fri, Jul 29, 2022 at 6:06 PM Obsto Clades 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