wm: teppich

Download patch

ref: 48cc33b5b8717b83c4dea9130c4396b451480c56
parent: 683965b944f2e1a922f26c3496e2aae867ca70ec
author: mkf <mkf@cloud9p.org>
date: Mon Dec 4 11:05:59 EST 2023

cons: add defcons

--- a/include/cons.h
+++ b/include/cons.h
@@ -11,9 +11,12 @@
 	void (*scroll)(int lines);
 }consdev_t;
 
-extern consdev_t pccons;
-extern consdev_t bitcons;
-extern consdev_t serialcons;
+extern const consdev_t pccons;
+extern const consdev_t bitcons;
+extern const consdev_t serialcons;
+
+/* points to default console */
+extern consdev_t defcons;
 
 void cons_init(consdev_t cons);
 void cons_clear(consdev_t cons, char c);
--- a/pc/cons.c
+++ b/pc/cons.c
@@ -4,7 +4,7 @@
 #include <bitmap.h>
 #include <com.h>
 
-consdev_t pccons = 
+const consdev_t pccons = 
 {
 	.name = "cons",
 	.init = vga_init,
@@ -15,7 +15,7 @@
 	.scroll = vga_scroll,
 };
 
-consdev_t bitcons =
+const consdev_t bitcons =
 {
 	.name = "bitcons",
 	.init = vga_init,
@@ -26,7 +26,7 @@
 	.scroll = vga_scroll,
 };
 
-consdev_t serialcons =
+const consdev_t serialcons =
 {
 	.name = "serialcons",
 	.init = com_init,
@@ -35,6 +35,8 @@
 	.getc = com_getc,
 	/* .scroll = nil */
 };
+
+consdev_t defcons = pccons;
 
 void
 cons_init(consdev_t cons)