diff options
author | Ian Moffett <ian@osmora.org> | 2025-09-30 20:45:13 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-09-30 20:54:02 -0400 |
commit | 9ae4315557c894b211e1d47e77a846066ebff5bb (patch) | |
tree | b2fea372da42f6bafa7f585c23dba177c7053324 /src/sys/np/sample | |
parent | d5884fab8d7f0556db4d1f0635107238be82c0dc (diff) |
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 <ian@osmora.org>
Diffstat (limited to 'src/sys/np/sample')
-rw-r--r-- | src/sys/np/sample/rev-0.np | 21 |
1 files changed, 21 insertions, 0 deletions
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 + |