lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

As others have said
Put your scripts in a set of big char arrays and load them from there.
It’s fairly straight forward and works perfectly well.

I suggest generating a hash of the scripts and checking it ... to protect against memory corruption.

We looked at saving compiled byte code vs not compiled. It didn’t seem like a big enough saving.

Compression saves space. But costs time and CPU to load. In our environment we were too cpu/time constrained so didn’t compress. 

And , also as others have said, I can’t go into more details :-(


On Apr 10, 2018, at 12:15 AM, Russell Haley <> wrote:


I've finally managed to get the pieces together to run Lua in the RTEMS operating system. A big shout out to whoever lparam is:

Anyway, now that I can load a hello world string and iterate a table, I was wondering about actually doing something with Lua. For my first attempt I would like to load penlight. I'm using the sparc erc32 (default) build with their emulator and it doesn't have a filesystem. errr... Help?

RTEMS is a little different because it's one big executable. I have a directory full of RTEMS libraries. Lua is just one library that I 'installed' in the library tree. To use Lua, I just link it into an example application and call their build system. Out the other end, I receive an EXE which contains the entire executable image - operating system and all at 5.3MB. (so cool).

I understand I can compile with luac, but I'm not sure how that gets included in the exe (in an *.a file?). I see srlua (thank you lua team) and was going to start playing with that, but thought I'd ask if there is anyone with experience before I go stumbling around the internet? 

To be sure, I have no idea what I'm even looking for. I've asked a similar question on the RTEMS mailing list and there is some information about loading a tar based FS, as well as reading ELF binaries (?Really?). I'll be doing some digging on those items, but any advice would be grand.