[OpenBIOS] [commit] r1346 - trunk/openbios-devel/arch/ppc/qemu

repository service svn at openbios.org
Sun Jun 21 20:52:51 CEST 2015


Author: mcayland
Date: Sun Jun 21 20:52:51 2015
New Revision: 1346
URL: http://tracker.coreboot.org/trac/openbios/changeset/1346

Log:
ppc: add Apple copyright injection to adler32

Since Mac OS 9 and BootX are the only known users of the adler32 word, we use
the word to add an Apple copyright message to the device tree in order to
allow OS 9 to boot.

Signed-off-by: Cormac O'Brien <i.am.cormac.obrien at gmail.com>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>

Modified:
   trunk/openbios-devel/arch/ppc/qemu/init.c
   trunk/openbios-devel/arch/ppc/qemu/qemu.fs

Modified: trunk/openbios-devel/arch/ppc/qemu/init.c
==============================================================================
--- trunk/openbios-devel/arch/ppc/qemu/init.c	Sun Jun 21 20:52:47 2015	(r1345)
+++ trunk/openbios-devel/arch/ppc/qemu/init.c	Sun Jun 21 20:52:51 2015	(r1346)
@@ -1006,7 +1006,7 @@
     bind_func("filll", ffilll);
 
     /* Implementation of adler32 word (required by OS 9, BootX) */
-    bind_func("adler32", adler32);
+    bind_func("(adler32)", adler32);
     
     bind_func("platform-boot", boot);
     bind_func("(go)", go);

Modified: trunk/openbios-devel/arch/ppc/qemu/qemu.fs
==============================================================================
--- trunk/openbios-devel/arch/ppc/qemu/qemu.fs	Sun Jun 21 20:52:47 2015	(r1345)
+++ trunk/openbios-devel/arch/ppc/qemu/qemu.fs	Sun Jun 21 20:52:51 2015	(r1346)
@@ -93,3 +93,31 @@
 :noname
   set-defaults
 ; PREPOST-initializer
+
+\ -------------------------------------------------------------------------
+\ Adler-32 wrapper
+\ -------------------------------------------------------------------------
+
+: adler32 ( adler buf len -- checksum )
+  \ Since Mac OS 9 is the only system using this word, we take this
+  \ opportunity to inject a copyright message that is necessary for the
+  \ system to boot.
+  " Copyright 1983-2001 Apple Computer, Inc. THIS MESSAGE FOR COMPATIBILITY ONLY"
+  encode-string " copyright"
+  " /" find-package if
+    " set-property" $find if
+      execute
+    else
+      3drop drop
+    then
+  then
+
+  ( adler buf len )
+
+  " (adler32)" $find if
+    execute
+  else
+    ." Can't find " ( adler32-name ) type cr
+    3drop 0
+  then
+;



More information about the OpenBIOS mailing list