History log of /freebsd-14.2/stand/common/interp_lua.c (Results 1 – 19 of 19)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: release/13.4.0-p5, release/13.5.0-p1, release/14.2.0-p3, release/13.5.0, release/14.2.0-p2, release/14.1.0-p8, release/13.4.0-p4, release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3, release/14.2.0, release/13.4.0, release/14.1.0, release/13.3.0
# c05fe06a 22-Feb-2024 Warner Losh <[email protected]>

libsa: Remove redundant sys/cdefs.h

Sponsored by: Netflix

(cherry picked from commit 3e15b01d6914c927e37d1699645783acf286655c)


# 94e1374b 16-Feb-2024 Warner Losh <[email protected]>

loader: Move to using linker sets to bring in optional bits

The graphics stuff is optional. When it is pulled into the system, we
use a linker set to initialize the lua bindings for it now.

Sponsor

loader: Move to using linker sets to bring in optional bits

The graphics stuff is optional. When it is pulled into the system, we
use a linker set to initialize the lua bindings for it now.

Sponsored by: Netflix
Reviewed by: kevans, jhb
Differential Revision: https://reviews.freebsd.org/D43906

(cherry picked from commit 0921a771da8a9117edf26352a8a047bacbfcee45)

show more ...


# 73fac51c 16-Feb-2024 Warner Losh <[email protected]>

loader: Create new gfx table

Create a new gfx global table. Put into it all the graphics bindings
that we have in loader today. For now, have compatability binding for
loader. Remove them from loade

loader: Create new gfx table

Create a new gfx global table. Put into it all the graphics bindings
that we have in loader today. For now, have compatability binding for
loader. Remove them from loader.

Sponsored by: Netflix
Reviewed by: kevans, jhb
Differential Revision: https://reviews.freebsd.org/D43902

(cherry picked from commit 9b16231032ddb40be282d76ec0d82b3a0ec96d60)

show more ...


# 8ea26f32 14-Feb-2024 Warner Losh <[email protected]>

loader: Fetch initial script from loader_lua env

Sometimes it is nice to override the initial script that we run. Make it
possible by fetching loader_lua from the env and using that instead of
the d

loader: Fetch initial script from loader_lua env

Sometimes it is nice to override the initial script that we run. Make it
possible by fetching loader_lua from the env and using that instead of
the default if prsent.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D43819

(cherry picked from commit cd147a2a024301a796f307c7bae686305d2bf302)

show more ...


Revision tags: release/14.0.0
# 1d386b48 16-Aug-2023 Warner Losh <[email protected]>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


Revision tags: release/13.2.0, release/12.4.0, release/13.1.0, release/12.3.0
# 313724ba 31-May-2021 Colin Percival <[email protected]>

loader: Use tslog to instrument some functions

In my initial testing, these are the functions which showed up as
being worth instrumenting. More may be added later.

common/console.c: cons_probe
co

loader: Use tslog to instrument some functions

In my initial testing, these are the functions which showed up as
being worth instrumenting. More may be added later.

common/console.c: cons_probe
common/gfx_fb.c: read_list, insert_font, autoload_font
common/interp.c: interact
common/interp_lua.c: interp_init, interp_run
efi/libefi/efipart.c: efipart_readwrite
i386/libi386/biosdisk.c: bd_init, bd_open, bd_edd_io, bd_chs_io, bd_io
libsa/open.c: open
libsa/read.c: read
libsa/twiddle.c: twiddle

Note that profiling interp_run may be of questionable utility as it
may depend on user behaviour (e.g. pressing keys).

Reviewed by: kevans (earlier version)

show more ...


Revision tags: release/13.0.0
# 0a0d522b 12-Dec-2020 Kyle Evans <[email protected]>

stand: liblua: add a pager module

This is nearly a 1:1 mapping of the pager API from libsa. The only real
difference is that pager.output() will accept any number of arguments and
coerce all of the

stand: liblua: add a pager module

This is nearly a 1:1 mapping of the pager API from libsa. The only real
difference is that pager.output() will accept any number of arguments and
coerce all of them to strings for output using luaL_tolstring (i.e. the
__tostring metamethod will be used).

The only consumer planned at this time is the upcoming "show-module-options"
implementation.

MFC after: 1 week

show more ...


Revision tags: release/12.2.0, release/11.4.0
# 48260b4b 03-Jun-2020 Kyle Evans <[email protected]>

lualoader: drop the filename and word "LUA" from errors

The filename is nearly always wrong since it's /boot/lua/loader.lua, which
is not useful for diagnostics. The actual errmsg will include a lua

lualoader: drop the filename and word "LUA" from errors

The filename is nearly always wrong since it's /boot/lua/loader.lua, which
is not useful for diagnostics. The actual errmsg will include a lua filename
if this is relevant.

Dropping "LUA" while we're here because that's almost universally
irrelevant to whatever error follows, unless the error states that it's
actually a lua problem.

Both of these are minor nits that just detract from identifying the
pertinent information.

MFC after: 3 days

show more ...


# 8e173ae7 12-Feb-2020 Kyle Evans <[email protected]>

interp_lua: fix bogus indentation, NFC


# 17f0dc77 12-Feb-2020 Kyle Evans <[email protected]>

lualoader: disable autoboot on high-level interpreter errors

If we hit an error at this level, we are almost certainly not in any kind
of sane state where autoboot can do the right thing. Instead of

lualoader: disable autoboot on high-level interpreter errors

If we hit an error at this level, we are almost certainly not in any kind
of sane state where autoboot can do the right thing. Instead of letting it
try and probably failing, disable autoboot so they immediately get kicked
into a loader prompt for manual remediation/diagnosis.

Reviewed by: tsoome
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D23611

show more ...


# ee74c236 02-Nov-2019 Kyle Evans <[email protected]>

stand: consolidate knowledge of lua path

Multiple places coordinate to 'know' where lua scripts are installed. Knock
this down to being formally defined (and overridable) in exactly one spot,
defs.m

stand: consolidate knowledge of lua path

Multiple places coordinate to 'know' where lua scripts are installed. Knock
this down to being formally defined (and overridable) in exactly one spot,
defs.mk, and spread the knowledge to loaders and liblua alike. A future
commit will expose this to lua as loader.lua_path, so it can build absolute
paths to lua scripts as needed.

MFC after: 1 week

show more ...


Revision tags: release/12.1.0, release/11.3.0, release/12.0.0
# d3d381b2 01-Sep-2018 Kyle Evans <[email protected]>

userboot: handle guest interpreter mismatches more intelligently

The switch to lualoader creates a problem with userboot: the host is
inclined to build userboot with Lua, but the host userboot's int

userboot: handle guest interpreter mismatches more intelligently

The switch to lualoader creates a problem with userboot: the host is
inclined to build userboot with Lua, but the host userboot's interpreter
must match what's available on the guest. For almost all FreeBSD guests in
the wild, Lua is not yet available and a Lua-based userboot will fail.

This revision updates userboot protocol to version 5, which adds a
swap_interpreter callback to request a different interpreter, and tries to
determine the proper interpreter to be used based on how the guest
/boot/loader is compiled. This is still a bit of a guess, but it's likely
the best possible guess we can make in order to get it right. The
interpreter is now embedded in the resulting executable, so we can open
/boot/loader on the guest and hunt that down to derive the interpreter it
was built with.

Using -l with bhyveload will not allow an intepreter swap, even if the
loader specified happens to be a userboot with the wrong interpreter. We'll
simply complain about the mismatch and bail out.

For legacy guests without the interpreter marker, we assume they're 4th.
For new guests with the interpreter marker, we'll read it and swap over
to the proper interpreter if it doesn't match what the userboot we're using
was compiled with.

Both flavors of userboot are installed by default, userboot_4th.so and
userboot_lua.so. This fixes the build WITHOUT_FORTH as a coincidence, which
was broken by userboot being forced to 4th.

Reviewed by: imp, jhb, araujo (earlier version)
Approved by: re (gjb)
Differential Revision: https://reviews.freebsd.org/D16945

show more ...


# 2ac6dfb0 31-Aug-2018 Kyle Evans <[email protected]>

lualoader: Print error messages from command failures at the prompt

Previously lualoader would remain silent, rather than printing
command_errmsg or noting that a command had failed or was not found

lualoader: Print error messages from command failures at the prompt

Previously lualoader would remain silent, rather than printing
command_errmsg or noting that a command had failed or was not found.

Approved by: re (gjb)

show more ...


Revision tags: release/11.2.0
# bef6cd49 11-Mar-2018 Kyle Evans <[email protected]>

stand/interp_lua: correct errorr => error


# f91f3926 20-Feb-2018 Conrad Meyer <[email protected]>

loader.lua: Expose errno table to lua

Reviewed by: kevans
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14454


# afad05b2 20-Feb-2018 Kyle Evans <[email protected]>

lualoader: Add ability to intercept cli commands

If we failed to execute the input line as pure lua, run the command through
parse for consistent argument parsing. Pass the parsed arguments through

lualoader: Add ability to intercept cli commands

If we failed to execute the input line as pure lua, run the command through
parse for consistent argument parsing. Pass the parsed arguments through to
a global "cli_execute" written in Lua, which is expected to either handle it
or pass it back through to interp_builtin_cmd (via loader.command).

lua-handled cli commands will then exist as globals in whatever module they
most belong in, and invocations at the loader prompt will magically dispatch
to them if they exist.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D14450

show more ...


# 77d4be50 18-Feb-2018 Conrad Meyer <[email protected]>

Lua loader: Add barebones "lfs" module

Add a Lua FileSystem module, an emulation of a subset of the permissively
licensed (MIT) Lua library of the same name[0], to our loader's Lua
environment.

[0]

Lua loader: Add barebones "lfs" module

Add a Lua FileSystem module, an emulation of a subset of the permissively
licensed (MIT) Lua library of the same name[0], to our loader's Lua
environment.

[0]: https://github.com/keplerproject/luafilesystem/

Reviewed by: kevans
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14418

show more ...


# 6771d4a8 18-Feb-2018 Conrad Meyer <[email protected]>

interp_lua: Register io/loader with regular Lua module system

Reviewed by: kevans
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D14421


# 7cafeaa1 12-Feb-2018 Warner Losh <[email protected]>

Add Lua as a scripting langauge to /boot/loader

liblua glues the lua run time into the boot loader. It implements all
the runtime routines that lua expects. In addition, it has a few
standard 'C' he

Add Lua as a scripting langauge to /boot/loader

liblua glues the lua run time into the boot loader. It implements all
the runtime routines that lua expects. In addition, it has a few
standard 'C' headers that nueter various aspects of the LUA build that
are too specific to lua to be in libsa. Many refinements from the
original code to improve implementation and the number of included lua
libraries. Use int64_t for lua_Number. Have "/boot/lua" be the default
module path. Numerous cleanups from the original GSoC project,
including hacking libsa to allow lua to be built with only one change
outside luaconf.h.

Add the final bit of lua glue to bring in liblua and plug into the
multiple interpreter framework, previously committed.

Add LOADER_LUA option, currently off by default.

Presently, this is an experimental option. One must opt-in to using
this by defining WITH_LOADER_LUA and WITHOUT_FORTH. It's been
lightly tested, so keep a backup copy of your old loader handy.
The menu code, coming in the next commit, hasn't been exhaustively
tested. A LUA boot loader is 60k larger than a FORTH one, which is
80k larger than a no-interpreter one. Subtle changes in size
may tip things past some subtle limit (the binary is ~430k now
when built with LUA). A future version may offer coexistance.

Bump FreeBSD version to 1200058 to mark the milestone.

Pedro Souza's 2014 Summer of Code project. Rui Paulo, Pedro Arthur,
Zakary Nafziger and Wojciech A. Koszek also contributed. Warner Losh
reworked it extensively into its current form.

Obtained from: https://wiki.freebsd.org/SummerOfCode2014/LuaLoader
Sponsored by: Google Summer of Code
Relnotes: Yes
MFC After: 1 month
Differential Review: https://reviews.freebsd.org/D14295

show more ...