[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Running old (1.3.2) MCL on a Quadra

>Date: Thu, 4 Feb 93 20:53 EST
>From: ELIOT@cs.umass.EDU
>Subject: Running old (1.3.2) MCL on a Quadra
>To: info-mcl@cambridge.apple.COM
>Our group wants to demo an old program next week and the demo site only
>has Quadras for us to use.  Unfortunately, we don't primarily have Quadras
>and this old program is no longer under development or support (the author
>graduated and no one else knows the code).  The program requires MCL
>version 1.3.2 which seems to exit immediately when I start it on a Quadra.
>Is there any possible (simple?) way to make this old version of MCL
>run on the Quadra.  I have turned off VM and 32 bit addressing, but
>I do not know how to disable the 68040 instruction cache so I have
>not tried that. How do you, and will this help?
>If anyone can tell me how to make V1.3.2 work on a Quadra then great,
>or if someone can make a definitive statement that it is impossible that
>will also be useful (worse for the group, but less work for me! :-))
>Thanks in advance for any help.
>Chris Eliot

In general, you can disable the 040 cache using a control panel that's in the
system folder of every Quadra (unless of course someone threw it away).

Here's a message that might also be of help (noting that Quadras also 
require system 7 - you're asking for double trouble here)...

Date: Tue, 25 Aug 1992 14:54:35 -0500
To: molinari%executioner@ee.pitt.edu (Bert Molinari)
From: bill@cambridge.apple.com (Bill St. Clair)
Subject: Re: Sys 7.0 compatability for v1.3.2
Cc: wilcox@cmns.think.com, info-mcl

>Sorry if this is a FAQ, but is there any generalized means of making an
>application created with mcl 1.3.2 compatable with sys7?  Unfortunately I
>don't know what the exact problems are, but i've been told that after opening
>the application, the intro-window appears (that contains the name of the
>app), and the machine goes into gc and just crashes.

Gary Byers sent out a patch quite a while ago that fixes one of the
problems and explains why MCL 1.3.2 is generally not compatible with
system 7. Others who have had problems have discovered that you need

I know that Greg Wilcox <wilcox@cmns.think.com> played with running
1.3.2 under System 7 for a while. He may have a few more pointers.

Here's Gary's explanation and patch:

1.3.2 is generally -not- compatible with System 7:

  1) It won't work at all in 32-bit mode; it assumes a 24-bit memory manager.

  2) The entire Multifinder partition has to reside in the first 8MB of
     memory.  With VM enabled, Multifinder may try to load the lisp into
     higher addresses; one may have to launch other applications first and/or
     adjust the lisp's suggested memory size in order to ensure that the lisp
     loads into the low 8MB.

  3) Most seriously, the lisp's "growzone" function - the function which the
     Mac Memory Manager calls when it can't otherwise satisfy a memory
     allocation request - erroneously assumes that it doesn't need to
     preserve the registers that it modifies.  (Prior to System 7.0, the
     Memory Manager code that called an application's "growzone" function
     saved and restored all registers around the call, but that doesn't seem
     to have been its documented behavior.)

     The enclosed patch seems to fix this problem, which would seem to
     be responsible for the "crashes sometimes during GC" behavior you
     reported.  The patch assumes version 1.3.2; I'm not sure whether
     it would work in older versions, and it has nothing to do with 2.0.

  4) There are almost certainly other bugs; those that I'm aware of are more
     cosmetic than fatal (e.g., drawing into the wrong grafport when windoids
     are active.)

It's unfortunate that whatever claims of 1.3.2's 7.0 compatibility have been
made were based on misinformation.

(in-package :ccl)
(eval-when (compile eval)
  (require "TRAPS"))

(defun fix-sys7-growzone ()
  (let* ((code '(#x202F #x4             ; move.l 4(sp),d0
                 #x48E7 #x1F3E          ; movem.l d3-d7/a2-a6,-(sp)
                 #x2F38 #x904           ; move.l currentA5,-(sp)
                 #x42A7                 ; clr.l -(sp)
                 #x2F00                 ; move.l d0,-(sp)
                 #x2A7C #x123 #x4567    ; move.l #$01234567,a5 (fixed below)
                 #x21CD #x904           ; move.l a5,currentA5
                 #x4EAD #x1112          ; jsr lispgrowzone(a5)
                 #x201F                 ; move.l (sp)+,d0
                 #x21df #x904           ; move.l (sp)+,currentA5
                 #x4CDF #x7CF8          ; movem.l (sp)+,d3-d7/a2-a6
                 #x205F                 ; move.l (sp)+,a0
                 #x584F                 ; addq #4,sp
                 #x2E80                 ; move.l d0,(sp)
                 #x4ED0))               ; jmp (a0)
         (code-length (length code))
         (ptr (_NewPtr :errchk :d0 (* 2 code-length) :a0))
         (a5Now (%get-ptr (%int-to-ptr #x904))))
    (dotimes (i code-length)
      (%put-word ptr (pop code) (+ i i)))
; Fix the reference to A5
    (%put-ptr ptr a5now 18)             ; replace #x01234567 with "real" A5
    (_SetGrowZone :a0 ptr)))

; Install the growzone patch, unless it's already there.  Make sure it's run
; whenever a saved image is restored.

(unless (member 'fix-sys7-growzone *restore-lisp-functions*
                :key #'ccl::function-name)
  (push #'fix-sys7-growzone *restore-lisp-functions*)