PettyJSOS is a toy/proof-of-concept OS, kernel and bootloader written 100% in JavaScript just for the fun of it to prove that, despite claims to the contrary, you really can write an entire operating system using only JavaScript, even though you really shouldn't. The build script (also written in JavaScript) uses TS2C to transpile the JavaScript code before using Clang and LLD to compile and link the final binary. Between transpilation and compilation, the build script handles fixing the entry point and the implementation of a new function, __inline_asm, which enables JavaScript to have inline assembly similar to how C or Rust do.
-
With Docker setup, run
docker run -v pettyjsos:/pettyjsos:ro --rm -it alpine /bin/sh -c "apk add --no-cache npm;ash"to open a shell -
Run
npm --prefix /pettyjsos run buildto build
Within the shell, run npm --prefix /pettyjsos run boot to boot the EFI bin in qemu