[OpenBIOS] [PATCH v2] drivers/escc.c: Add slot-names property to ch-a and ch-b nodes under escc node

Programmingkid programmingkidx at gmail.com
Thu Feb 11 22:55:25 CET 2016


subject: [PATCH v2] drivers/escc.c: Add slot-names property ch-a node under escc

The escc node's ch-a node needs a slot-names property in order to satisfy the
Mac OS X driver's requirements. This patch adds the slot-names property to the
escc/ch-a node. The ch-b node will have a slot-names property set to 0. 

Signed-off-by: John Arbuckle <programmingkidx at gmail.com>

Changes from last patch:

Replaced C code with Forth code. 
Replaced 0001 string with integer 1 value.
Have the ch-b node's property set to just 0 to mirror what real hardware would have.

Notes:
It does look like Mac OS 9 needs a working ESCC in order to run. For an experiment I set the ch-a node's slot-names property to 0 just see what would happen. Mac OS 9 crashed at the same place as usual. 

Index: drivers/escc.c
===================================================================
--- drivers/escc.c	(revision 1378)
+++ drivers/escc.c	(working copy)
@@ -456,6 +456,22 @@
     NEWWORLD(set_property(dnode, "interrupts",
              (char *)&props, 3 * sizeof(cell)));
 
+    if(strcmp(node, "a") == 0) {    /* ch-a */
+        /* Setup the slot-names property - used by Mac OS */
+        fword("1");             /* Bitmask of available slots */
+        fword("encode-int");
+        push_str("Modem");      /* One name is given to each available slot */
+        fword("encode-string");
+        fword("encode+");
+        push_str("slot-names");
+        fword("property");
+    } else {                    /* ch-b */
+        fword("0");             /* Bitmask of available slots */
+        fword("encode-int");
+        push_str("slot-names");
+        fword("property");
+    }
+
     device_end();
 
     if (legacy) {


More information about the OpenBIOS mailing list