UEFI Bindings for JavaScript (Proof of Concept)
- C 69.7%
- Makefile 21.4%
- TypeScript 3.4%
- JavaScript 2.9%
- Shell 2.6%
| src | ||
| .gitignore | ||
| get-deps | ||
| GNUmakefile | ||
| LICENSE | ||
| promethee.jpeg | ||
| README.md | ||
| script.js | ||
| types.ts | ||
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
-
Fetch dependencies: ./get-deps
-
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.
