From owner-freebsd-current@freebsd.org Tue Feb 20 03:05:12 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 C4322F1DFC0 for ; Tue, 20 Feb 2018 03:05:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x231.google.com (mail-io0-x231.google.com [IPv6:2607:f8b0:4001:c06::231]) (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 53FFD7C696 for ; Tue, 20 Feb 2018 03:05:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x231.google.com with SMTP id l12so7629299ioc.10 for ; Mon, 19 Feb 2018 19:05:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=P4868rLOMeGfuUo7e2SGDb9dLz7J/ksTdqlS1zYom/Q=; b=Y97DbwKDE6u6sY6lQZo8nyos6kQdbWwIQw2pzmxXgQTxYFw/jM3d5l3hJ8TB4KXC9T ZMBAhFVj4+xaU0hBwR/rZ7q3Mq9Q4xZycU8gscnGyDv6a7Qud95qwYjtHk2YqB3k+Wyz QbOa/O6stcQHs6ZXzFS3lcBgRPOdrHIeV0IPU0WjuF7Xu6p01yD2qzjU6lH5xBF5vUTY tDgiucrO2iKbkRylpgsKJXVC4TxlhFsuOjv6Ip8sZFXpe/kwp1FIo4UFCqn6d6XkM2aq sXW7LJN+lOWTdsonHX/WPUaD8SbSLpdTJ1r8W2kVI8S8rsa6cqFjOBZ1NA7ilgjHqmr6 fusA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=P4868rLOMeGfuUo7e2SGDb9dLz7J/ksTdqlS1zYom/Q=; b=l07qzcfuOVaOotwbnnDwqEBd6CTTYWUD7RhD+ap4vbWsg9gAxjfTcD5o3Q9n6RhCzO i+XdGDpUSPViAT90F53FZigF7Cf3kWtVrC/VKA0lLXdEcUW9+MpB+tVPEA1ArnoQsGqB KKy7hzSjS7oJtMkP7rAIwqo+HNUUHY1oMSnBgSTOHEMa+RLaOkaU3Mol1WPXrcUIKJkB XAHBpfKNJh51qIciE6wKl/M6T5TTZPMas3iKJxJ4/L/T6g+7h9W1mCoh2anIpM19bKTF fCzajpdnO9vhgM2xlN2Ln6jh/RxYD0YI839Z1X3W3kxXUOQWsPNIeMLdy3jucKbtZNnj 101Q== X-Gm-Message-State: APf1xPAF1+dGkcVvjoQxcwiLR9GVKs/wkhCKdJbXiy1VrGuYiw7OXF0/ oLu6sWqPYJHhpaDG+S1mz4XA1Eua//bOH5tRHi4L5Q== X-Google-Smtp-Source: AH8x226MxjSYOeu7tdB3TF7f9BSFOa01Y6j6TiecvXx8phaDFjiA7sy9Sz0o918lAmnVccFaAX2Kg7cmlXHVOnGdJSs= X-Received: by 10.107.188.65 with SMTP id m62mr21485608iof.39.1519095910507; Mon, 19 Feb 2018 19:05:10 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Mon, 19 Feb 2018 19:05:09 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:9198:c568:89aa:9c67] Received: by 10.79.201.67 with HTTP; Mon, 19 Feb 2018 19:05:09 -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: Warner Losh Date: Mon, 19 Feb 2018 20:05:09 -0700 X-Google-Sender-Auth: TDo-xWlxLQ81mF24Zdth5kLtl3M Message-ID: Subject: Re: ACPI panic on boot with new Lua loader and other minor issues To: Kyle Evans Cc: Devin Teske , =?UTF-8?Q?Juan_Ram=C3=B3n_Molina_Menor?= , FreeBSD Current Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 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: Tue, 20 Feb 2018 03:05:12 -0000 On Feb 19, 2018 3:38 PM, "Kyle Evans" wrote: 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. Forth has a framework for making all commands forth words. It leverages that to run the intercept. We already have the intercept in place with a stupidly simple policy. We totally can do something generic that would solve this and maybe other problems. Let's chat online tomorrow about a couple of possibilities we can choose from. Warner