Getting Started
Prerequisites
- Node.js 18+
- npm 9+
- QEMU (for running kernels):
brew install qemu(macOS) orsudo apt install qemu-system-aarch64
Install
Clone the monorepo and install dependencies:
sh
git clone https://github.com/krushndayshmookh/yog
cd yog
npm installWrite your first Yog program
Create hello.yog:
ts
function main(): void {
uart_init();
uart_print("Hello, World!\n");
}Compile
sh
node yogc/src/index.js hello.yog hello.imgOutput:
[yogc] OK hello.yog → hello.img
[yogc] 472 bytes (118 ARM64 instructions)
[yogc] Load address: 0x80000 Entry: kernel_mainRun in QEMU
sh
qemu-system-aarch64 -M raspi3b -kernel hello.img -serial stdio -display noneExpected output:
Hello, World!Press Ctrl-A X to quit QEMU.
Using run.sh
The repo includes a convenience script that compiles and boots in one command:
sh
./run.shOr to compile only without launching QEMU:
sh
./run.sh --build-only