How are you handling libc? you have your own (or is this even an issue with Lua)? I've been thinking of putting a Common Lisp implementation on bare metal (initially thinking of SBCL, but I think MKCL may be a easier challenge), but haven't found the time to start yet.
I've grabbed the missing routines from musl libc (and culled some parts of the Lua standard library for the sake of reducing the number of requirements, e.g. io.*), and used venerable Doug Lea's malloc for memory allocations.
The stock Lua 5.1 has the least number of dependencies, so I picked it - the idea is to practice and then to eventually have LuaJIT run on bare metal.
You can use the NetBSD rump kernel [1] to do this relatively easily - I have run LuaJIT on Xen using this and there is now a bare metal implementation too.
https://github.com/ayourtch/ayos
a little experiment of my own to see what happens if I put Lua on bare metal (currently KVM-only) in x86_64 mode.
Lots of fun to toy with, though it does not do much yet.