[OpenBIOS] patch to allow Mac OS 9 to boot

Programmingkid programmingkidx at gmail.com
Tue Feb 2 05:08:56 CET 2016


http://www.openfirmware.info/pipermail/openbios/2015-June/008722.html

diff --git a/openbios-devel/forth/bootstrap/interpreter.fs b/openbios-devel/forth/bootstrap/interpreter.fs
index 5187058..74a109f 100644
--- a/openbios-devel/forth/bootstrap/interpreter.fs
+++ b/openbios-devel/forth/bootstrap/interpreter.fs
@@ -163,7 +163,7 @@ defer outer-interpreter
 : evaluate ( str len -- ?? )
   2dup + -rot
   over + over do 
-    i c@ 0a = if 
+    i c@ dup 0a = swap 0d = or if 
       i over - 


This is most of the patch that is needed to make OpenBIOS successfully boot Mac OS 9. From the bootstrap.fs file, the 0a means linefeed. The file also says the 0d means carret '^'? If this patch is to look for linefeeds and carriage returns, why use the carret character here? 

This is a solution I came up with to fix incompatibility with other operating systems and still be able to boot Mac OS 9. The adler32 word is only used on Mac OS 9, so what if it sets a flag variable to indicate Mac OS 9 is being used. Then OpenBIOS uses that flag to determine which line of code should be used. Here is the pseudo-code:

In adler32....
   set using_mac_os_9 = true

In the evaluate word:

if (using_mac_os_9 == true)
{
    i c@ dup 0a = swap 0d = or if 
}

else
{
    i c@ 0a = if 
}

Does this sound good? 


More information about the OpenBIOS mailing list