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 MSI X99S SLI PLUS Is Working & Running Well On Linux
  2. NVIDIA GeForce GTX 980: The Best GPU For Linux Gamers
  3. ROCCAT LUA: A Linux-Friendly Gaming Mouse
  4. Cheetah Mounts: The Affordable Way To Put Your TV On The Wall
Latest Linux Articles
  1. Preview: Radeon Gallium3D Performance For CS:GO On Linux
  2. XWayland Linux Gaming Performance With GNOME Wayland On Fedora 21
  3. EXT4/Btrfs/XFS/F2FS Benchmarks On Linux 3.17
  4. Fedora 21 Alpha First Impressions: It's Great
Latest Linux News
  1. VA-API Gallium3D State Tracker Added Back To Mesa
  2. Radeon DRM Gets New Information Ioctl Queries
  3. Mir 0.8 Works On Less ABI Breakage, Touchspots, Responsiveness
  4. CS:GO For Linux Gains Better Stability, Community Server Support
  5. NVIDIA Issues Updated 340.46 Long-Lived Driver Release
  6. KDE Plasma 5.1 Now In Beta
  7. Systemd & Debian Were Most Popular In September
  8. Microsoft Announces... Windows 10 With A Start Menu
  9. Borderlands 2 Launches On Steam For Linux
  10. Debian Jessie Might Get Rid Of The kFreeBSD Port
Latest Forum Discussions
  1. Take the Steam Survey results with a grain of salt. It is flawed.
  2. X.Org Is Looking For Some Female Help
  3. Microsoft Announces... Windows 10 With A Start Menu
  4. NVIDIA Alerts Nouveau: They're Starting To Sign/Validate GPU Firmware Images
  5. Updated and Optimized Ubuntu Free Graphics Drivers
  6. Nero CD/DVD Burning Software On Linux Is Dead
  7. New Group Calls For Boycotting Systemd
  8. FSF Issues Statement On Shellshock Bash Vulnerability