Page MenuHomeFreeBSD

LUA-Bootloader
Needs ReviewPublic

Authored by howard0su_gmail.com on Dec 14 2015, 2:20 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 12, 6:46 AM
Unknown Object (File)
Thu, Dec 12, 5:53 AM
Unknown Object (File)
Thu, Dec 12, 3:46 AM
Unknown Object (File)
Thu, Dec 12, 12:41 AM
Unknown Object (File)
Mon, Dec 9, 3:57 PM
Unknown Object (File)
Mon, Dec 9, 3:57 PM
Unknown Object (File)
Sat, Dec 7, 9:30 PM
Unknown Object (File)
Sat, Dec 7, 5:28 AM

Details

Reviewers
imp
Group Reviewers
manpages
Summary

Merge the patch to latest -Current.
Integrate lua with uboot
Add build script support for other platforms (not tested, ppc, mips, etc)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 1634
Build 1640: arc lint + arc unit

Event Timeline

howard0su_gmail.com retitled this revision from to LUA-Bootloader.
howard0su_gmail.com updated this object.
howard0su_gmail.com edited the test plan for this revision. (Show Details)
howard0su_gmail.com added reviewers: imp, rpaulo.

A couple of questions:

Are you planning on importing sys/contrib/lua into vendor somewhere and then copying to sys/contrib/lua and then applying local changes (if any)?

I've looked at a smattering of the makefiles, and they perpetuate the mess. They both include a Makefile.inc
and include a lot of junk inline. Can't we include Makefile.inc for conf, forth and lua unconditionally and move
the conditionals there (as well as the CFLAGS adjustments). This would make the changes mostly the same
for all the Makefiles and cutdown the duplication. I think you can even move the .PATH statements into
these as well.

The MK_FORTH changes seem to be unrelated. Or at least orthogonal and can be done in a commit. That likely
can be done ASAP as well, before lua may be ready.

Is this code in the svn projects/lua-boot branch? If so, I can start to cherry pick stupid things like this
into the base to reduce the diff.

sys/boot/powerpc/ofw/Makefile
122

Here, and elsewhere, make MK_FORTH optional. I suspect that would be a better separate change for bisectability.

sys/boot/sparc64/loader/Makefile
68

Why have both BOOT_LUA and MK_LUA? Seems redundant to me.

In D4550#95983, @imp wrote:

A couple of questions:

Are you planning on importing sys/contrib/lua into vendor somewhere and then copying to sys/contrib/lua and then applying local changes (if any)?

I should make the change more readable and clean to submit code review. I think we should do that. And we may want to import latest LUA as well.

I've looked at a smattering of the makefiles, and they perpetuate the mess. They both include a Makefile.inc
and include a lot of junk inline. Can't we include Makefile.inc for conf, forth and lua unconditionally and move
the conditionals there (as well as the CFLAGS adjustments). This would make the changes mostly the same
for all the Makefiles and cutdown the duplication. I think you can even move the .PATH statements into
these as well.

I agree. I didn't do big change. My main goal for last two days is getting this change from projects/lua-bootloader branch to HEAD,
and make it build. this is result.

my mainly change besides the change in that branch:

  1. Some Makefile change to make it build, some recent change in boot break diff.
  2. Create a folder called conf to put loader.rc as shared between FORTH and LUA
  3. Make uboot/arm work with LUA

The MK_FORTH changes seem to be unrelated. Or at least orthogonal and can be done in a commit. That likely
can be done ASAP as well, before lua may be ready.

Is this code in the svn projects/lua-boot branch? If so, I can start to cherry pick stupid things like this
into the base to reduce the diff.

yes. it is. Feel free to go ahead.

Some additional notes when I work on this:

  1. missing features, like ACPI, PCI stuffs are interesting for PNP support are missing in LUA. loader only exposed a very small set of functions to lua.
  2. LUA needs float support, which is pretty painful for ARM. i looked at a LUA fork called eLUA, which has feature to disable float at all. Need more time to dig it out.
  1. LUA needs float support, which is pretty painful for ARM. i looked at a LUA fork called eLUA, which has feature to disable float at all. Need more time to dig it out.

How much float? I know a really good soft-float library that we can easily integrate, I think. It should only be an issue, however, for armv4/5 systems. But it will also be an issue for MIPS, so we need a unified plan.

In D4550#95987, @imp wrote:
  1. LUA needs float support, which is pretty painful for ARM. i looked at a LUA fork called eLUA, which has feature to disable float at all. Need more time to dig it out.

How much float? I know a really good soft-float library that we can easily integrate, I think. It should only be an issue, however, for armv4/5 systems. But it will also be an issue for MIPS, so we need a unified plan.

LUA don't have type of INT or FLOAT. Instead, it uses Number as universe type for both float and int. Internally, it support use float, double and long double to represent number, which I don't think it is good design. So if we want have LUA, we either use a soft float or we need hack quite a bit code to work around. I would prefer integrate a soft-float lib. what's the license of the lib you mentioned?

sys/boot/sparc64/loader/Makefile
68

BOOT_LUA is just a code #define. It probably doesn't need to be set in the Makefile.

In D4550#95983, @imp wrote:

A couple of questions:

Are you planning on importing sys/contrib/lua into vendor somewhere and then copying to sys/contrib/lua and then applying local changes (if any)?

Lua is already in vendor.

rpaulo removed a reviewer: rpaulo.