Subject: Re: Getting Started, again
To: Michael Wolfson <mw34@cornell.edu>
From: Monroe Williams <monroe@pobox.com>
List: port-macppc
Date: 03/21/2000 11:05:44
on 3/21/00 7:35 AM, Michael Wolfson at mw34@cornell.edu wrote:

> Could someone more knowledgable in Forth than me comment on whether these
> patches are included in the nvram patches created by the System Disk
> utility?
> 
> ftp://ftp.apple.com/developer/macosxserver/utilities/SystemDisk2.3.1.smi.bin
> 
> One would hope that Apple included known problems like these in their
> System Disk utility and that we would only have to bother with one set of
> nvram patches for all machines.
> 
> Particularly, since this one is quite a pain to install.
> 
> -- MW

I don't think the functionality is included, but it's almost trivial to
add it.

The forth code for the patches that the System Disk program applies is in
resources.  Apple was even nice enough to include ResEdit templates for the
resource types involved.  I just tried appending the part of the unofficial
patch which fixes the video setup problem to the appropriate resource, and
it works!  Now, if someone would just figure out the OF code to set
/chaos/control to 1024x768x75hz...

The patches are in the System Disk applicaion in resources of type
'OFpt'.  Mappings of which machines get which patches seem to be
in resources of type 'OFtb' and 'OFtc'.  Here's the one that gets
applied to the 7500 (yes, the copyright notice is embedded):

--------
##
# Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
#
# @APPLE_LICENSE_HEADER_START@
# 
# "Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
# Reserved.  This file contains Original Code and/or Modifications of
# Original Code as defined in and that are subject to the Apple Public
# Source License Version 1.0 (the 'License').  You may not use this file
# except in compliance with the License.  Please obtain a copy of the
# License at http://www.apple.com/publicsource and read it before using
# this file.
# 
# The Original Code and all software distributed under the License are
# distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
# EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
# INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
# License for the specific language governing rights and limitations
# under the License."
# 
# @APPLE_LICENSE_HEADER_END@
##
# Version: 1.1.2  Date: 4-8-99
use-nvramrc? true
load-base 600000
diag-device 
nvramrc hex\
: $C $call-method ;\
: $D find-device ;\
: $E device-end ;\
: $x execute ;\
: $F $D " open" $find drop ;\
: $p 0 to my-self property ;\
: $a " /chosen" $D $p $E ;\
: R BRpatch ; : L BLpatch ;\
: q over + ;\
: g code! ;\
: & get-token drop ;\
6ED & $x\
0 value mi\
: mmr " map-range" mi if my-self $C else $call-parent then ;\
89B & ' mmr R\
: mcm -1 to mi $C 0 to mi ;\
8CB & 1E na+ ' mcm L\
: maa -1 to mi 1D swap ;\
8C9 & 5 na+ ' maa L\
8C9 & 134 + ' 1 L\
8CD & 184 + 14 q dup @ 6 << 6 >>a -4 and + R\
8C6 & 7C + ' u< L\
0 value yn\
: y yn 0= if dup @ to yn then ;\
8CB & ' y R\
' y 28 + 8CB & 8 + R\
: z yn ?dup if over ! 0 to yn then ;\
8CC & ' z R\
' z 2C + 8CC & 8 + R\
@startvec BC + @ 40820014 over 88 + g 41820010 swap E0 + g\
0 @startvec 5C + @ 1D8 + g\
dev /packages/mac-parts\
400000 ' load 14 + g\
: m1 400000 do-unmap ;\
' load 8 + ' m1 L\
' load 160 + ' 0 L\
: &r1 4+ dup 8000 alloc-mem 7F00 + swap ! 4+ F8 ;\
' load 2AC - ' &r1 L\
$E\
4180FFF0 ' msr! 44 + g\
dev /packages/xcoff-loader\
: p&+ ['] open 600 - + ;\
: p1 { _a _s } _a -1000 and _a _s + over - FFF ;\
60000000 dup 8 p&+ g C p&+ g\
18 p&+ ' p1 L\
$E\
" enet" $F dup\
1D8 - 24 q ['] or L $x\
248 - @ 6 encode-bytes 2dup\
" local-mac-address" $p\
$E\
" mac-address" $a\
10 buffer: km\
dev kbd\
get-key-map km swap move\
$E\
: ck 0 do swap dup 3 >> km + c@ 1 rot 7 and << and or loop ;\
: bootr 0d word count encode-string " machargs" $a\
0 0 1 ck if 0 and else f 3d 0 2 ck if 40 or then then\
if bye else 1e 0 do ['] boot catch drop 1f4 ms loop then bye ;\
: &SI\
" scsi-int" open-dev\
" open" 2 pick 4+ @ find-method drop\
2c q ['] 2 L 848 -\
8 q 1C q R\
88 q 4 q R\
$x " close" rot $C ;\
&SI\
dev /packages/obp-tftp\
: O ['] open + ;\
: M dup 24 - -18E0 O $X 6 move 14 + ;\
684 O ['] drop L\
-63C O ' M L\
$E\
unselect-dev
--------

I just appended the unofficial patch to the end of this whole mess
(with the proper backslash quoting for newlines), pasted it back
into the resource, and it worked.  My video now comes up at 60Hz
every time.  (Flicker, flicker...).

-- monroe
------------------------------------------------------------------------
Monroe Williams                                         monroe@pobox.com