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. MSI X99S SLI PLUS On Linux
  2. NVIDIA GeForce GTX 970 Offers Great Linux Performance
  3. CompuLab Intense-PC2: An Excellent, Fanless, Mini PC Powered By Intel's i7 Haswell
  4. From The Atom 330 To Haswell ULT: Intel Linux Performance Benchmarks
Latest Linux Articles
  1. Open-Source Radeon 2D Performance Is Better With Ubuntu 14.10
  2. RunAbove: A POWER8 Compute Cloud With Offerings Up To 176 Threads
  3. 6-Way Ubuntu 14.10 Linux Desktop Benchmarks
  4. Ubuntu 14.10 XMir System Compositor Benchmarks
Latest Linux News
  1. Dead Island GOTY Now Available On Linux/SteamOS
  2. Ubuntu 14.04 In The Power8 Cloud From RunAbove
  3. KDE With Theoretical Client-Side Decorations, Windows 10 Influence
  4. Sandusky Lee: Great Cabinets For Storing All Your Computer Gear
  5. Fedora 21 Beta & Final Release Slip Further
  6. Mesa 10.3.2 Has A Couple Bug-Fixes
  7. RadeonSI/R600g HyperZ Support Gets Turned Back On
  8. openSUSE Factory & Tumbleweed Are Merging
  9. More Fedora Delays: Fedora 21 Beta Slips
  10. Mono Brings C# To The Unreal Engine 4
Latest Forum Discussions
  1. Looking for a Open-Source AMD experienced Linux mentor
  2. Users/Developers Threatening Fork Of Debian GNU/Linux
  3. Updated and Optimized Ubuntu Free Graphics Drivers
  4. HOPE: The Ease Of Python With The Speed Of C++
  5. Use Ubuntu MATE 14.10 Make it an official distro.
  6. Debian Is Back To Discussing Init Systems, Freedom of Choice
  7. AMD Radeon VDPAU Video Performance With Gallium3D
  8. Ubuntu 16.04 Might Be The Distribution's Last 32-Bit Release