summaryrefslogtreecommitdiff
path: root/src/sys/np/sample
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-09-30 20:45:13 -0400
committerIan Moffett <ian@osmora.org>2025-09-30 20:54:02 -0400
commit9ae4315557c894b211e1d47e77a846066ebff5bb (patch)
treeb2fea372da42f6bafa7f585c23dba177c7053324 /src/sys/np/sample
parentd5884fab8d7f0556db4d1f0635107238be82c0dc (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.np21
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
+