From 9ae4315557c894b211e1d47e77a846066ebff5bb Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 30 Sep 2025 20:45:13 -0400 Subject: kern: Add initial pirho compiler sources The pirho compiler is a ring-0 compiler used to compile core parts of the kernel during updates and installs from the initramfs. Signed-off-by: Ian Moffett --- src/sys/np/sample/rev-0.np | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/sys/np/sample/rev-0.np (limited to 'src/sys/np/sample/rev-0.np') diff --git a/src/sys/np/sample/rev-0.np b/src/sys/np/sample/rev-0.np new file mode 100644 index 0000000..c3f781f --- /dev/null +++ b/src/sys/np/sample/rev-0.np @@ -0,0 +1,21 @@ +;; +;; Program entrypoint +;; +proc +main(u8 argc, u8 **argv) -> i8 +begin + u8 *vga = ptr(0x8B000) + + if argc < 2 begin + return -1 + end + + ;; Draw '*' chars + for [i=0 : i<8 : i += 2] begin + vga[i + 0] = '*' ;; char '*' + vga[i + 1] = 0x07 ;; red + end + + return 0 +end + -- cgit v1.2.3