LKL.js: Running Linux Kernel on JavaScript Directly

LKL.js is Linux Kernel Library ported to JavaScript using Emscripten. Unlike JSLinux, LKL.js includes a Linux kernel fully written in JavaScript and runs without emulators. For more details, read my blog post

LKL.js just boots Linux kernel and still completely useless. It shows how Emscripten is powerful and how Linux kernel is flexible.

Demo

LKL.js requires SharedArrayBuffer for pthread support. SharedArrayBuffer is disabled by default due to Spectre mitigation in Mozilla Firefox. Please enable it. (javascript.options.shared_memory in Mozilla Firefox) The link below is boot.js demo site.

Downloads

liblkl.js is a JavaScript version of liblkl.a and liblkl.min.js is a compressed version of liblkl.js.

boot.js is a JavaScript version of tools/lkl/tests/boot and boot.min.js is a compressed version of boot.js

*.min.js is generated by using Google Closure Compiler.

Source code

The source code is available at retrage/linux branch retrage/em-v2.