Back Original

UEFI Bindings for JavaScript

Promethee

What this is

UEFI Bindings for JavaScript

How it works

Promethee loads script.js from the boot volume and runs it. That script is your bootloader. If you can do it with UEFI services, you can do it in JavaScript.

Quick start

  1. Fetch dependencies: ./get-deps

  2. Build and run in QEMU: make run

Your entrypoint is script.js. The run target copies it to the UEFI FAT volume as \script.js.

Tiny example

In script.js:

var gop = efi.SystemTable.BootServices.LocateProtocol(efi.guid.GraphicsOutput);
if (gop) {
    var red = { r: 255, g: 0, b: 0 };
    gop.Blt(red, 'EfiBltVideoFill', 0, 0, 50, 50, 200, 120, 0);
}

Notes

  • Duktape tooling requires Node.js (used to generate sources).
  • The build is freestanding; only minimal libc stubs are provided.
  • If this makes you grin, you are probably holding the torch.