Lua Scripting Support Added To NetBSD Kernel
Earlier in the year I wrote about an initiative to bring Lua scripting support to the NetBSD kernel. With a Lua interpreter within the kernel, it would be easy to extend kernel subsystems, prototype new features, and lower the barrier to entry for NetBSD development. Well, that support for Lua has now been officially added to the NetBSD kernel.
While many would be appalled by the idea of having a scripting language interpreter within kernel-space from a security and performance perspective, the NetBSD developers think this approach will work. For the uninformed, Lua is a scripting language that's cross-platform that's fairly easy to use and is supported by a wide variety of applications and use-cases from video games to enterprise software.
The NetBSD kernel isn't going to be rewritten in Lua, but as a way to load scripts from user-space for interacting with various subsystems for prototyping features, debugging, and allow enthusiasts who may not be experts in C to more easily explore the inner-workings of their system.
For increasing the security, new Lua states are empty, there is no access to kernel memory, and functions are accessed through predefined bindings. There's also support for detecting potentially dangerous code at by the byte-code level.
Marc Balmer, the BSD developer that originally talked about NetBSD Lua support back at FOSDEM in February, sent in a note to Phoronix today about the Lua code having been merged. This change by Balmer adds a Lua driver that can create and control Lua states inside the kernel, this change adds the core Lua code to the kernel, and this change adds a "luactl" command for user-space to control the Lua support within the kernel (e.g. loading new code to the kernel).
Hopefully this easier learning curve into NetBSD kernel development will lead more new programmers into toying with its kernel and ideally furthering some of their agendas like making NetBSD as a desktop OS.
While many would be appalled by the idea of having a scripting language interpreter within kernel-space from a security and performance perspective, the NetBSD developers think this approach will work. For the uninformed, Lua is a scripting language that's cross-platform that's fairly easy to use and is supported by a wide variety of applications and use-cases from video games to enterprise software.
The NetBSD kernel isn't going to be rewritten in Lua, but as a way to load scripts from user-space for interacting with various subsystems for prototyping features, debugging, and allow enthusiasts who may not be experts in C to more easily explore the inner-workings of their system.
For increasing the security, new Lua states are empty, there is no access to kernel memory, and functions are accessed through predefined bindings. There's also support for detecting potentially dangerous code at by the byte-code level.
Marc Balmer, the BSD developer that originally talked about NetBSD Lua support back at FOSDEM in February, sent in a note to Phoronix today about the Lua code having been merged. This change by Balmer adds a Lua driver that can create and control Lua states inside the kernel, this change adds the core Lua code to the kernel, and this change adds a "luactl" command for user-space to control the Lua support within the kernel (e.g. loading new code to the kernel).
Hopefully this easier learning curve into NetBSD kernel development will lead more new programmers into toying with its kernel and ideally furthering some of their agendas like making NetBSD as a desktop OS.
10 Comments