From owner-freebsd-current@freebsd.org Mon Feb 19 22:44:30 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0074F05F17 for ; Mon, 19 Feb 2018 22:44:30 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33E5670B26; Mon, 19 Feb 2018 22:44:30 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f44.google.com with SMTP id y19so1587390lfd.4; Mon, 19 Feb 2018 14:44:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=+Xx/Zr4EliR/j1MlnQ92nNfpm14jG1DteXXFDy9bhbw=; b=NDMA5wG0yJWzrb+ILSyyaUtzmZxPvuWOvTaXOeOdzv8wCKh4oCdSIc4kDr0Kpse7NZ Q+vBRWnbS03dj8aRjSDCMkXbs6Vrs8rJBtrJDGeWnJiSjw6I+HRQxFRkNixP8RFKuHDV poes1TQfaEn9dV57GOU/2TzWkm0ptHdbaoOP2K7XYN4IYXrnFPzAAvj7Y8WaBp2D8lp8 PcdEYpNZN5CdRnfqjSlRu9raCZ2uuhmq008r/EhD1eil8N0Lmi7WsnQf3gangAB5n82f ewoy2Ulj5gpJWlGunJQ/7ZnmVVP4RZ729NwFaf78DNiTk8OPXE2Srajqlg+baCu+LbGy t9KQ== X-Gm-Message-State: APf1xPBl5XpsMrycE/VxOh709/C1/FB/IMVASRqNl9yA7nVP+XWrIKs0 3E97bD10JKVvjJJxm5Ov1g/lkIKz X-Google-Smtp-Source: AH8x226LjHwe6mNjgPHg8nNzbOs3bUzB5pR2ZmqFjW3AXOayIC/HfVRbxVpk7ZR1a7wmpP/cq1nyTA== X-Received: by 10.46.125.3 with SMTP id y3mr5190773ljc.23.1519079901283; Mon, 19 Feb 2018 14:38:21 -0800 (PST) Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com. [209.85.215.49]) by smtp.gmail.com with ESMTPSA id 65sm4611232lfa.77.2018.02.19.14.38.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Feb 2018 14:38:21 -0800 (PST) Received: by mail-lf0-f49.google.com with SMTP id j193so1588294lfe.0; Mon, 19 Feb 2018 14:38:21 -0800 (PST) X-Received: by 10.46.88.84 with SMTP id x20mr11121712ljd.44.1519079900882; Mon, 19 Feb 2018 14:38:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.106.8 with HTTP; Mon, 19 Feb 2018 14:38:00 -0800 (PST) In-Reply-To: References: <2AFF3AE4-8740-4776-9D8D-7D709EE051C6@gmail.com> <1b9e58fe-2616-b04b-13c2-fee78a33ad6e@club.fr> <6EB9705C-92AC-4952-B1F6-642DCD4701F1@freebsd.org> From: Kyle Evans Date: Mon, 19 Feb 2018 16:38:00 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: ACPI panic on boot with new Lua loader and other minor issues To: Warner Losh Cc: Devin Teske , =?UTF-8?Q?Juan_Ram=C3=B3n_Molina_Menor?= , FreeBSD Current Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Feb 2018 22:44:30 -0000 On Mon, Feb 19, 2018 at 4:32 PM, Warner Losh wrote: > > > On Mon, Feb 19, 2018 at 2:57 PM, Devin Teske wrote: >> >> >> >> > On Feb 19, 2018, at 2:21 PM, Kyle Evans wrote: >> > >> > It seems that the Forth loader might be doing something sneaky and >> > replacing the standard common "boot" with a Forth boot that handles >> > this a lot better. CC'ing dteske@ so they can confirm. >> >> I can indeed confirm this as fact. >> >> Not able to help much because I am driving cross-country (San Francisco to >> Orlando) right now with the spouse and dog. >> >> We get back March 3rd, but I will be checking-in from time to time for >> sporadic responses during downtime. > > > The command in loader.4th is defined as: > > : boot > 0= if ( interpreted ) get_arguments then > > \ Unload only if a path was passed > dup if > >r over r> swap > c@ [char] - <> if > 0 1 unload drop > else > s" kernelname" getenv? if ( a kernel has been loaded ) > try-menu-unset > bootmsg 1 boot exit > then > load_kernel_and_modules > ?dup if exit then > try-menu-unset > bootmsg 0 1 boot exit > then > else > s" kernelname" getenv? if ( a kernel has been loaded ) > try-menu-unset > bootmsg 1 boot exit > then > load_kernel_and_modules > ?dup if exit then > try-menu-unset > bootmsg 0 1 boot exit > then > load_kernel_and_modules > ?dup 0= if bootmsg 0 1 boot then > ; > > The thing to know here is when you see 'boot' as part of above script, it's > calling the 'boot' cli command, not itself recursively. > > I can help do more interpretation of the details if you need Kyle. Not sure > how much to spell out, but the brief pseudo code is: > > If there were any arguments that didn't start with '-', unload. > otherwise if kernelname is in in the environment, run the 'menu-unset' > forth word if it exists, print the boot message and boot. > Otherwise load the kernel and modules, run the 'menu-unset' forth word (if > it exists), print the boot message and boot with kernelname > Otherwise load the kernel and modules, run the 'menu-unset' forth word (if > it exists), print the boot message and boot with kernelname > if all that fails, load the kernel and modules and if that works boot them. > Yeah, we have something like this on the lua side. Unfortunately, it's going to wreck people's muscle memory- dropping to the loader prompt and typing "boot [x]" will never work as expected because lua won't recognize that as a function call due to spaces as delimiters. We'd need some shim that takes "cmd [x]" and tries it as "cmd([x])" (for some [x] that could be multiple space-delimited arguments) before falling back to the originally typed "cmd [x]" if we want Lua to have any chance to intercept it and adds its own salt and pepper like Forth does.