1. Computers
  2. Display Drivers
  3. Graphics Cards
  4. Memory
  5. Motherboards
  6. Processors
  7. Software
  8. Storage
  9. Operating Systems


Facebook RSS Twitter Twitter Google Plus


Phoronix Test Suite

OpenBenchmarking.org

Lua Scripting Support Being Added To NetBSD Kernel

BSD

Published on 14 February 2013 09:24 AM EST
Written by Michael Larabel in BSD
18 Comments

Support for the Lua scripting language is being added to the NetBSD kernel so that it's possible to interact with the BSD kernel's various subsystems using this popular scripting language. With a Lua interpreter being added to the kernel, it's even possible to extend the kernel's subsystems in this scripting language.

Support for NetBSD kernel scripting using Lua has been an ongoing project that dates back to 2010 with the "Lunatik" project originating from that year's Google Summer of Code. The original work involved porting a Lua scripting language interpreter into the NetBSD kernel, a kernel programming interface that supports extending kernel subsystems in Lua, and a interface exposed to user-space for loading Lua scripts inside the kernel. This will certainly spark mixed views on a scripting language for the kernel, aside from security concerns.

From the 2010 work there's a few more details within the SourceForge Luakern project, but is since outdated. Earlier this month at FOSDEM 2013, Marc Balmer talked about Lua for the NetBSD kernel.

The "Lua in the kernel" project fell into an unmaintained state in 2012, but is being revived and will actually be merged. For those not familiar with the Lua programming language, it's a scripting language that's extensible, written in ISO C, and has a fairly straightforward C API. Lua has found itself widely adopted from being used within the VLC Media Player to video games as the scripting language to the Apache HTTP server. Now support is heading into the NetBSD kernel for Lua.

Lua Scripting Support Being Added To NetBSD Kernel

Marc Balmer is a long-time *BSD developer and is the founder of the Swiss-based Micro Systems. His slides about his FOSDEM 2013 presentation of Lua going into the kernel can now be found on FOSDEM.org while embedded below are some of the most interesting points.

Lua Scripting Support Being Added To NetBSD Kernel

Among the expressed ideas for users with Lua in the NetBSD kernel is that "modifying software written in C is hard for users", with this scripting language there's the power for users to better modify and extend their systems, and users can explore the system in an easy way.

Lua Scripting Support Being Added To NetBSD Kernel

For developers, Lua allows for rapid application development approach to driver and kernel developer, modifying the system behavior in real-time, and configuration of kernel sub-systems through the scripts.

Lua Scripting Support Being Added To NetBSD Kernel

Rather than Lua, other language possibilities were Python and Java. Python is not difficult to integrate with C but has problems with being a huge library, memory consumption, and difficult object mapping. Java is easy to write but also poses problems with object mapping and memory might be an issue, but it's worked out before for driver development.

Lua Scripting Support Being Added To NetBSD Kernel

The 2010 GSoC project proved that the Lua virtual machine can run in the NetBSD kernel and the necessary infrastructure was added to the kernel. Support for Lua in the NetBSD kernel is soon to be merged to NetBSD "-current" and it should be part of NetBSD 7. Within the NetBSD user-land has already been Lua scripting support.

Lua Scripting Support Being Added To NetBSD Kernel

When running Lua code in the kernel it ends up being all in one address space and is accessible to all the same memory, but there are locking issues.

Lua Scripting Support Being Added To NetBSD Kernel

A look at how Lua integrates into the NetBSD kernel.

Lua Scripting Support Being Added To NetBSD Kernel

Fortunately, some security features for Lua code in the NetBSD kernel are being worked through.

It will be interesting to see if Lua scripting in the NetBSD kernel ends up being used much or if it is a feature just used as a toy and research. The release of NetBSD 7.0 is likely still more than one year away, but we'll keep monitoring the space of Lua scripting in the NetBSD kernel.

Read more of the Phoronix FOSDEM 2013 coverage.

About The Author
Michael Larabel is the principal author of Phoronix.com and founded the web-site in 2004 with a focus on enriching the Linux hardware experience and being the largest web-site devoted to Linux hardware reviews, particularly for products relevant to Linux gamers and enthusiasts but also commonly reviewing servers/workstations and embedded Linux devices. Michael has written more than 10,000 articles covering the state of Linux hardware support, Linux performance, graphics hardware drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated testing software. He can be followed via and or contacted via .
Latest Linux Hardware Reviews
  1. The Power Consumption & Efficiency Of Open-Source GPU Drivers
  2. AMD R600g/RadeonSI Performance On Linux 3.16 With Mesa 10.3-devel
  3. Intel Pentium G3258 On Linux
  4. SilverStone Precision PS10
Latest Linux Articles
  1. Nouveau vs. Radeon vs. Intel Tests On Linux 3.16, Mesa 10.3-devel
  2. KVM Benchmarks On Ubuntu 14.10
  3. X.Org Server 1.16 Officially Released With Terrific Features
  4. Ubuntu With Linux 3.16 Smashes OS X 10.9.4 On The MacBook Air
Latest Linux News
  1. Linus Torvalds On GCC 4.9: Pure & Utter Crap
  2. Cauldron 2014: GCC & LLVM Will Look To Collaborate More
  3. GCC Receives ACM Programming Languages Software Award
  4. KDE 4.14 Beta 3 Released
  5. A New Video Has Us Real Excited About The New UT For Linux
  6. CoreOS Experiences Its First Stable Release
  7. GNOME 3.13.4 Continues Working On Wayland & More
  8. Wine 1.7.23 Has Initial Support For 64-bit Android Builds
  9. FreeBSD Developing A New Automounter, Other Features
  10. Guix 0.7 Can Now Install The GNU Operating System
Latest Forum Discussions
  1. Updated and Optimized Ubuntu Free Graphics Drivers
  2. Debian + radeonsi
  3. How To Setup Radeon DPM On Ubuntu Linux
  4. Open-source drivers on ATI R7 260X
  5. New build, first Linux PC, what could go wrong? ;)
  6. AMD "Hawaii" Open-Source GPU Acceleration Still Not Working Right
  7. Radeon related kernel bug??
  8. how the US intellegentia operates: