]> git.saurik.com Git - apple/system_cmds.git/blob - nvram.tproj/nvram/PowerSurge
system_cmds-175.tar.gz
[apple/system_cmds.git] / nvram.tproj / nvram / PowerSurge
1 ##
2 # Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3 #
4 # @APPLE_LICENSE_HEADER_START@
5 #
6 # "Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7 # Reserved. This file contains Original Code and/or Modifications of
8 # Original Code as defined in and that are subject to the Apple Public
9 # Source License Version 1.0 (the 'License'). You may not use this file
10 # except in compliance with the License. Please obtain a copy of the
11 # License at http://www.apple.com/publicsource and read it before using
12 # this file.
13 #
14 # The Original Code and all software distributed under the License are
15 # distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 # EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 # INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 # FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19 # License for the specific language governing rights and limitations
20 # under the License."
21 #
22 # @APPLE_LICENSE_HEADER_END@
23 ##
24 # Version: 1.2.0 Date: 8-17-2000
25 use-nvramrc? true
26 load-base 600000
27 diag-device
28 nvramrc hex\
29 : $C $call-method ;\
30 : $D find-device ;\
31 : $E device-end ;\
32 : $x execute ;\
33 : $F $D " open" $find drop ;\
34 : $p 0 to my-self property ;\
35 : $a " /chosen" $D $p $E ;\
36 : R BRpatch ; : L BLpatch ;\
37 : q over + ;\
38 : g code! ;\
39 : & get-token drop ;\
40 6ED & $x\
41 0 value mi\
42 : mmr " map-range" mi if my-self $C else $call-parent then ;\
43 89B & ' mmr R\
44 : mcm -1 to mi $C 0 to mi ;\
45 8CB & 1E na+ ' mcm L\
46 : maa -1 to mi 1D swap ;\
47 8C9 & 5 na+ ' maa L\
48 8C9 & 134 + ' 1 L\
49 8CD & 184 + 14 q dup @ 6 << 6 >>a -4 and + R\
50 8C6 & 7C + ' u< L\
51 0 value yn\
52 : y yn 0= if dup @ to yn then ;\
53 8CB & ' y R\
54 ' y 28 + 8CB & 8 + R\
55 : z yn ?dup if over ! 0 to yn then ;\
56 8CC & ' z R\
57 ' z 2C + 8CC & 8 + R\
58 @startvec BC + @ 40820014 over 88 + g 41820010 swap E0 + g\
59 0 @startvec 5C + @ 1D8 + g\
60 dev /packages/mac-parts\
61 400000 ' load 14 + g\
62 : m1 400000 do-unmap ;\
63 ' load 8 + ' m1 L\
64 ' load 160 + ' 0 L\
65 : &r1 4+ dup 8000 alloc-mem 7F00 + swap ! 4+ F8 ;\
66 ' load 2AC - ' &r1 L\
67 $E\
68 4180FFF0 ' msr! 44 + g\
69 dev /packages/xcoff-loader\
70 : p&+ ['] open 600 - + ;\
71 : p1 { _a _s } _a -1000 and _a _s + over - FFF ;\
72 60000000 dup 8 p&+ g C p&+ g\
73 18 p&+ ' p1 L\
74 $E\
75 " enet" $F dup\
76 1D8 - 24 q ['] or L $x\
77 248 - @ 6 encode-bytes 2dup\
78 " local-mac-address" $p\
79 $E\
80 " mac-address" $a\
81 10 buffer: km\
82 dev kbd\
83 get-key-map km swap move\
84 $E\
85 : ck 0 do swap dup 3 >> km + c@ 1 rot 7 and << and or loop ;\
86 : bootr 0d word count encode-string " machargs" $a\
87 0 0 1 ck if 0 and else dup 1 = if 3d 0 1 else f 3d 0 2 then ck if 40 or then then\
88 40 and if bye else 1e 0 do ['] boot catch drop 1f4 ms loop then bye ;\
89 : &SI\
90 " scsi-int" open-dev\
91 " open" 2 pick 4+ @ find-method drop\
92 2c q ['] 2 L 848 -\
93 8 q 1C q R\
94 88 q 4 q R\
95 $x " close" rot $C ;\
96 &SI\
97 dev /packages/obp-tftp\
98 : O ['] open + ;\
99 : M dup 24 - -18E0 O $X 6 move 14 + ;\
100 684 O ['] drop L\
101 -63C O ' M L\
102 $E\
103 unselect-dev