diff user/screen.c3 @ 315:084cccaa5deb

Added console and screen
author Windel Bouwman
date Sat, 21 Dec 2013 10:03:01 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/user/screen.c3	Sat Dec 21 10:03:01 2013 +0100
@@ -0,0 +1,35 @@
+module screen;
+
+import ipc;
+
+const int num_cols = 80;
+const int num_rows = 25;
+
+var int* vidmem;
+
+function void clear()
+{
+    var int row, col;
+
+    for (row = 0; row < num_rows; rows++)
+    {
+        for (col = 0; col < num_cols; cols=cols+1)
+        {
+            *vidmem = 0x20;
+        }
+    }
+}
+
+function void main()
+{
+    // Initialize display
+
+    clear();
+
+    while (true)
+    {
+        var ipc.Msg msg;
+        ipc.receive_message(&msg);
+    }
+}
+