Hey,<p>The manpages for lua(4) and luactl(8) may be of help.<p>lua(4) is the device driver which allows you manage Lua states in the kernel through an ioctl interface. With luactl(8) you can create and destroy states, load and execute scripts, and require modules.<p>Example:<p>1. Load lua(4) driver
   modload lua
2. Create a Lua state in the kernel
   luactl create s0
3. Load and execute a script named hello.lua
   luactl load s0 .&#x2F;hello.lua
4. dmesg<p>A Lua state is created empty. In order to load the standard libs (base, string, table, ...) into that state you&#x27;d need to do a luaL_openlibs(). Even though the libs are compiled into lua(4), you can&#x27;t easily load them with luactl. [1] is a patch that adds a &#x27;openlibs&#x27; command to luactl. After you apply it and recompile luactl, you can do that:<p>luactl openlibs s0<p>Btw, we&#x27;ve ported Lua test suite to the NetBSD kernel in this year&#x27;s GSoC. Part of the work was on porting parts of the standard libraries which were not available in kernel Lua (e.g., os, io, math). Take a look at [2].<p>Let me know if you need any help. My email address is my HN username at gmail.com<p>---- 
[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;gmesalazar&#x2F;kerneltest&#x2F;blob&#x2F;master&#x2F;kernel&#x2F;patches&#x2F;luactl-openlibs.patch" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gmesalazar&#x2F;kerneltest&#x2F;blob&#x2F;master&#x2F;kernel&#x2F;...</a>
[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;gmesalazar&#x2F;kerneltest&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gmesalazar&#x2F;kerneltest&#x2F;</a>