[OpenBIOS] [PATCHv2 6/6] ppc: move copyright property hooks from adler32 word

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Sat Feb 13 17:11:02 CET 2016


Instead insert the copyright property if we detect the /rom/macos device
generated by the MacOS boot loader just before we call the client with
go and remove it before control is returned back to the interpreter.

This effectively hides the property from everyone except for MacOS bootloaders.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
---
 openbios-devel/arch/ppc/qemu/init.c  |    5 +++++
 openbios-devel/arch/ppc/qemu/qemu.fs |   12 +++++-------
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/openbios-devel/arch/ppc/qemu/init.c b/openbios-devel/arch/ppc/qemu/init.c
index 2b5b8e1..b76c570 100644
--- a/openbios-devel/arch/ppc/qemu/init.c
+++ b/openbios-devel/arch/ppc/qemu/init.c
@@ -601,6 +601,11 @@ go(void)
 {
     ucell addr;
 
+    /* Insert copyright property for MacOS 9 and below */
+    if (find_dev("/rom/macos")) {
+        fword("insert-copyright-property");
+    }
+    
     feval("saved-program-state >sps.entry @");
     addr = POP();
 
diff --git a/openbios-devel/arch/ppc/qemu/qemu.fs b/openbios-devel/arch/ppc/qemu/qemu.fs
index a34a31e..3d99a34 100644
--- a/openbios-devel/arch/ppc/qemu/qemu.fs
+++ b/openbios-devel/arch/ppc/qemu/qemu.fs
@@ -121,18 +121,16 @@ variable keyboard-phandle 0 keyboard-phandle !
   active-package!
 ;
 
+: (exit)
+  \ Clean up before returning to the interpreter
+  delete-copyright-property
+;
+
 \ -------------------------------------------------------------------------
 \ 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.
-  insert-copyright-property
-
-  ( adler buf len )
-
   " (adler32)" $find if
     execute
   else
-- 
1.7.10.4




More information about the OpenBIOS mailing list