Re: ACPI panic on boot with new Lua loader and other minor issues

From: Devin Teske <dteske_at_freebsd.org>
Date: Mon, 19 Feb 2018 20:23:47 -0600
> On Feb 19, 2018, at 4:32 PM, Warner Losh <imp_at_bsdimp.com> wrote:
> 
> 
> 
>> On Mon, Feb 19, 2018 at 2:57 PM, Devin Teske <dteske_at_freebsd.org> wrote:
>> 
>> 
>> > On Feb 19, 2018, at 2:21 PM, Kyle Evans <kevans_at_freebsd.org> 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_at_ 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_at_ [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.
> 

What is actually going on is that when the “boot” function is compiled, the reference to “boot” inside it is to the already-existing word defined previously. Forth allows you to have multiply-defined names. The “boot” command inside the “boot” function is replaced with the address of previous boot during function compilation because the function is m not defined and given an address in the dictionary until it is completed (last line compiled).
— 
Devin
Received on Tue Feb 20 2018 - 01:23:54 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:15 UTC