Mercurial > hg > Members > kono > nitros9-code
comparison level1/cmds/cobbler.asm @ 168:3a847d2b4492
Cobbler, OS9Gen and format are all hardware dependent.
author | roug |
---|---|
date | Thu, 11 Jul 2002 18:57:35 +0000 |
parents | 6b992a305a29 |
children | 1cd7548b534f |
comparison
equal
deleted
inserted
replaced
167:51cb8573849f | 168:3a847d2b4492 |
---|---|
3 * | 3 * |
4 * $Id$ | 4 * $Id$ |
5 * | 5 * |
6 * Ed. Comments Who YY/MM/DD | 6 * Ed. Comments Who YY/MM/DD |
7 * ------------------------------------------------------------------ | 7 * ------------------------------------------------------------------ |
8 * 5 Original Microware distribution version | 8 * 5 Original Dragon Data distribution version |
9 | 9 |
10 nam Cobbler | 10 nam Cobbler |
11 ttl Make a bootstrap file | 11 ttl Make a bootstrap file |
12 | 12 |
13 * Disassembled 02/04/03 23:11:02 by Disasm v1.6 (C) 1988 by RML | 13 * Disassembled 02/04/03 23:11:02 by Disasm v1.6 (C) 1988 by RML |
18 tylg set Prgrm+Objct | 18 tylg set Prgrm+Objct |
19 atrv set ReEnt+rev | 19 atrv set ReEnt+rev |
20 rev set $01 | 20 rev set $01 |
21 mod eom,name,tylg,atrv,start,size | 21 mod eom,name,tylg,atrv,start,size |
22 u0000 rmb 1 | 22 u0000 rmb 1 |
23 u0001 rmb 3 | 23 DevFd rmb 3 |
24 u0004 rmb 1 | 24 BTLSN rmb 1 |
25 u0005 rmb 2 | 25 u0005 rmb 2 |
26 u0007 rmb 2 | 26 BtSiz rmb 2 |
27 u0009 rmb 20 | 27 sttbuf rmb 20 |
28 u001D rmb 2 | 28 u001D rmb 2 |
29 u001F rmb 10 | 29 u001F rmb 10 |
30 u0029 rmb 2 | 30 u0029 rmb 2 |
31 u002B rmb 32 | 31 devnam rmb 32 |
32 u004B rmb 16 | 32 u004B rmb 16 |
33 u005B rmb 1 | 33 u005B rmb 1 |
34 u005C rmb 7 | 34 u005C rmb 7 |
35 u0063 rmb 682 | 35 u0063 rmb 682 |
36 size equ . | 36 size equ . |
55 L00B6 fcb C$LF | 55 L00B6 fcb C$LF |
56 fcc "Error - OS9boot file fragmented" | 56 fcc "Error - OS9boot file fragmented" |
57 fcb C$LF | 57 fcb C$LF |
58 fcc " This disk will not bootstrap." | 58 fcc " This disk will not bootstrap." |
59 fcb C$CR | 59 fcb C$CR |
60 L00F6 fcc "OS9Boot " | 60 BfNam fcc "OS9Boot " |
61 fcb $FF | 61 fcb $FF |
62 start equ * | 62 start equ * |
63 clrb | 63 clrb |
64 lda #$2F | 64 lda #'/ |
65 cmpa ,x | 65 cmpa ,x |
66 lbne L0237 | 66 lbne Usage |
67 os9 F$PrsNam | 67 os9 F$PrsNam |
68 lbcs L0237 | 68 lbcs Usage |
69 lda #$2F | 69 lda #'/ |
70 cmpa ,y | 70 cmpa ,y |
71 lbeq L0237 | 71 lbeq Usage |
72 leay <u002B,u | 72 leay <devnam,u |
73 L011A sta ,y+ | 73 L011A sta ,y+ |
74 lda ,x+ | 74 lda ,x+ |
75 decb | 75 decb |
76 bpl L011A | 76 bpl L011A |
77 sty <u0029 | 77 sty <u0029 |
78 lda #$40 | 78 lda #'@ |
79 ldb #$20 | 79 ldb #$20 |
80 std ,y++ | 80 std ,y++ |
81 leax <u002B,u | 81 leax <devnam,u |
82 lda #$03 | 82 lda #UPDAT. |
83 os9 I$Open | 83 os9 I$Open |
84 sta <u0001 | 84 sta <DevFd |
85 lbcs L0237 | 85 lbcs Usage |
86 ldx <u0029 | 86 ldx <u0029 |
87 leay >L00F6,pcr | 87 leay >BfNam,pcr |
88 lda #$2F | 88 lda #'/ |
89 L0140 sta ,x+ | 89 L0140 sta ,x+ |
90 lda ,y+ | 90 lda ,y+ |
91 bpl L0140 | 91 bpl L0140 |
92 lda <u0001 | 92 lda <DevFd |
93 pshs u | 93 pshs u |
94 ldx #$0000 | 94 ldx #$0000 |
95 ldu #$0015 probably DD.BT | 95 ldu #$0015 probably DD.BT |
96 os9 I$Seek | 96 os9 I$Seek |
97 puls u | 97 puls u |
98 lbcs Exit | 98 lbcs Exit |
99 leax u0004,u | 99 leax BTLSN,u |
100 ldy #$0005 | 100 ldy #$0005 |
101 os9 I$Read Read bootstrap sector + size = 5 bytes | 101 os9 I$Read Read bootstrap sector + size = 5 bytes |
102 lbcs Exit | 102 lbcs Exit |
103 ldd <u0007 | 103 ldd <BtSiz |
104 beq L017B | 104 beq L017B |
105 leax <u002B,u | 105 leax <devnam,u |
106 os9 I$Delete | 106 os9 I$Delete |
107 clra | 107 clra |
108 clrb | 108 clrb |
109 sta <u0004 | 109 sta <BTLSN |
110 std <u0005 | 110 std <u0005 |
111 std <u0007 | 111 std <BtSiz |
112 lbsr L0261 | 112 lbsr UpLSN0 |
113 L017B lda #$02 | 113 L017B lda #WRITE. |
114 ldb #$03 | 114 ldb #UPDAT. |
115 leax <u002B,u | 115 leax <devnam,u |
116 os9 I$Create | 116 os9 I$Create |
117 sta <u0000 | 117 sta <u0000 |
118 lbcs Exit | 118 lbcs Exit |
119 ldd >$0068 | 119 ldd >$0068 |
120 subd >$0066 | 120 subd >$0066 |
121 tfr d,y | 121 tfr d,y |
122 std <u0007 | 122 std <BtSiz |
123 ldx >$0066 | 123 ldx >$0066 |
124 lda <u0000 | 124 lda <u0000 |
125 os9 I$Write | 125 os9 I$Write |
126 lbcs Exit | 126 lbcs Exit |
127 leax u0009,u | 127 leax sttbuf,u |
128 ldb #$00 | 128 ldb #SS.OPT |
129 os9 I$GetStt | 129 os9 I$GetStt |
130 lbcs Exit | 130 lbcs Exit |
131 lda <u0000 | 131 lda <u0000 |
132 os9 I$Close | 132 os9 I$Close |
133 lbcs L0237 | 133 lbcs Usage |
134 pshs u | 134 pshs u |
135 ldx <u001D,u | 135 ldx <u001D,u |
136 lda <u001F,u | 136 lda <u001F,u |
137 clrb | 137 clrb |
138 tfr d,u | 138 tfr d,u |
139 lda <u0001 | 139 lda <DevFd |
140 os9 I$Seek | 140 os9 I$Seek |
141 puls u | 141 puls u |
142 lbcs Exit | 142 lbcs Exit |
143 leax <u004B,u | 143 leax <u004B,u |
144 ldy #$0100 | 144 ldy #$0100 |
145 os9 I$Read | 145 os9 I$Read |
146 lbcs Exit | 146 lbcs Exit |
147 ldd <u0063,u | 147 ldd <u0063,u |
148 lbne L024C | 148 lbne Fragd |
149 ldb <u005B,u | 149 ldb <u005B,u |
150 stb <u0004 | 150 stb <BTLSN |
151 ldd <u005C,u | 151 ldd <u005C,u |
152 std <u0005 | 152 std <u0005 |
153 lbsr L0261 | 153 lbsr UpLSN0 |
154 lbsr L0228 | 154 lbsr SkLSN1 |
155 leax <u004B,u | 155 leax <u004B,u |
156 ldy #$0100 | 156 ldy #$0100 |
157 os9 I$Read | 157 os9 I$Read |
158 bcs wrerr | 158 bcs wrerr |
159 lda ,x | 159 lda ,x |
160 anda #$3F | 160 anda #$3F |
161 eora #$3F | 161 eora #$3F |
162 bne L025A | 162 bne NotAllo |
163 lda $01,x | 163 lda $01,x |
164 eora #$FF | 164 eora #$FF |
165 bne L025A | 165 bne NotAllo |
166 lda $02,x | 166 lda $02,x |
167 anda #$90 | 167 anda #$90 |
168 eora #$90 | 168 eora #$90 |
169 bne L025A | 169 bne NotAllo |
170 ldx #$F000 | 170 ldx #$F000 Address of kernel in RAM |
171 ldy #$0F00 | 171 ldy #$0F00 Amount to write |
172 lda <u0001 | 172 lda <DevFd |
173 os9 I$Write | 173 os9 I$Write |
174 bcs L0253 | 174 bcs ETrack |
175 os9 I$Close | 175 os9 I$Close |
176 bcs Exit | 176 bcs Exit |
177 clrb | 177 clrb |
178 bra Exit | 178 bra Exit |
179 L0228 pshs u | 179 |
180 lda <u0001 | 180 SkLSN1 pshs u |
181 lda <DevFd | |
181 ldx #$0000 | 182 ldx #$0000 |
182 ldu #$0100 | 183 ldu #$0100 |
183 os9 I$Seek | 184 os9 I$Seek Seek to allocation map at LSN 1 |
184 puls pc,u | 185 puls pc,u |
185 L0237 leax >L0015,pcr | 186 |
187 Usage leax >L0015,pcr | |
186 wrerr pshs b | 188 wrerr pshs b |
187 lda #$02 | 189 lda #$02 |
188 ldy #$0100 | 190 ldy #$0100 |
189 os9 I$WritLn | 191 os9 I$WritLn |
190 comb | 192 comb |
191 puls b | 193 puls b |
192 Exit os9 F$Exit | 194 Exit os9 F$Exit |
193 L024C leax >L00B6,pcr | 195 |
196 Fragd leax >L00B6,pcr | |
194 clrb | 197 clrb |
195 bra wrerr | 198 bra wrerr |
196 L0253 leax >L004E,pcr | 199 |
200 ETrack leax >L004E,pcr | |
197 clrb | 201 clrb |
198 bra wrerr | 202 bra wrerr |
199 L025A leax >L006A,pcr | 203 * |
204 * Write warning | |
205 NotAllo leax >L006A,pcr | |
200 clrb | 206 clrb |
201 bra wrerr | 207 bra wrerr |
202 L0261 pshs u | 208 * |
209 * Update the identification sector on LSN 0 | |
210 * | |
211 UpLSN0 pshs u | |
203 ldx #$0000 | 212 ldx #$0000 |
204 ldu #$0015 | 213 ldu #$0015 probably DD.BT |
205 lda <u0001 | 214 lda <DevFd |
206 os9 I$Seek | 215 os9 I$Seek |
207 puls u | 216 puls u |
208 bcs Exit | 217 bcs Exit |
209 leax u0004,u | 218 leax BTLSN,u |
210 ldy #$0005 | 219 ldy #$0005 |
211 os9 I$Write | 220 os9 I$Write |
212 bcs Exit | 221 bcs Exit |
213 rts | 222 rts |
214 emod | 223 emod |