]> wirehaze git hosting - MS-DOS.git/blob - v4.0/src/DEV/SMARTDRV/OLI.CMP

wirehaze git hosting

MZ is back!
[MS-DOS.git] / v4.0 / src / DEV / SMARTDRV / OLI.CMP
1 CMP V2.13 Copyright (C) 1984, 1985 by White Heron Corporation
2 All rights reserved
3
4 old: smartdrv.asm (on the left) Note: < marks old lines.
5 new: a:smartdrv.asm (on the right) > marks new lines.
6
7 ===============================================================================
8
9 6<; Will use IBM extended memory on PC-AT or
10 7<; use Above Board on PC, XT, or AT
11 8<;
12 9<;
13 10<; device = SMARTDRV.sys [bbbb] [/a]
14
15 ----> changed to the following:
16
17 6>;; Will use IBM extended memory on PC-AT or
18 7>;; use Above Board on PC, XT, or AT, and
19 8>;; use extended, expanded, or upper extended memory on AT&T 6300 PLUS
20 9>;
21 10>;
22 11>;; device = SMARTDRV.sys [bbbb] [/a] [/u]
23
24 ===============================================================================
25
26 40<;
27
28 ----> changed to the following:
29
30 41>;; /u Specifies that upper extended memory will be used
31 42>;; on the AT&T 6300 PLUS. Upper extended memory
32 43>;; is the memory beginning at FA0000. It is used
33 44>;; to hold the UNIX kernel when the machine is running
34 45>;; Simul-Task. However, when operating as a pure
35 46>;; MS-DOS machine, this 384K of memory is available
36 47>;; for SMARTDRIVE.
37 48>;; Note that it is an error to specify this switch
38 49>;; if the machine is not a 6300 PLUS.
39
40 ===============================================================================
41
42 102>;; ?.?? 7/24/87 WSH Added 6300 PLUS support. This code is marked by
43 103>;; the use of double semi-colons to make it easy to
44 104>;; find.
45
46 ----> inserted before the following old file line:
47
48 93<
49
50 ===============================================================================
51
52 125>
53 126>;; In order to address memory above 1 MB on the AT&T 6300 PLUS, it is
54 127>;; necessary to use the special OS-MERGE hardware to activate lines
55 128>;; A20 to A23. However, these lines can be disabled only by resetting
56 129>;; the processor. The return address offset and segment can be found
57 130>;; at 40:a2, noted here as RealLoc1.
58 131>;;
59 132>BiosSeg segment at 40h ;; Used to locate 6300 PLUS reset address
60 133> org 00a2h
61 134>RealLoc1 dd 0
62 135>BiosSeg ends
63
64 ----> inserted before the following old file line:
65
66 113<
67
68 ===============================================================================
69
70 147>;; The /U configuration using upper extended memory on the
71 148>;; 6300 PLUS is a special case of the type 1 configuration.
72
73 ----> inserted before the following old file line:
74
75 124<;
76
77 ===============================================================================
78
79 327>;; The internal name of the device driver has been changed from SMARTDRV
80 328>;; to SMARTAAR to avoid DOS name conflicts with files named SMARTDRV.*
81 329>;;
82
83 ----> inserted before the following old file line:
84
85 302<INT13DEV LABEL WORD
86
87 ===============================================================================
88
89 307< DB "SMARTDRV" ;Name of device
90
91 ----> changed to the following:
92
93 335> DB "SMARTAAR" ;Name of device
94
95 ===============================================================================
96
97 387>;; Data peculiar to AT&T 6300 PLUS.
98 388>
99 389>S5_FLAG DB 0 ;; If set, computer is a 6300 PLUS
100
101 ----> inserted before the following old file line:
102
103 359<
104
105 ===============================================================================
106
107 3074>;; NOTE: The value at BASE_ADDR is patched during initialization when
108 3075>;; loading a RAMDrive into upper extended memory on a PLUS
109 3076>;;
110
111 ----> inserted before the following old file line:
112
113 3043<BASE_ADDR LABEL DWORD ; 24 bit address of start of this RAMDRV
114
115 ===============================================================================
116
117 3190< MOV AH,0DFH
118
119 ----> changed to the following:
120
121 3224>
122 3225>;;
123 3226>;; Enable address line 20 on the PC AT or activate A20-A23 on the 6300 PLUS.
124 3227>;; The former can be done by placing 0dfh in AH and activating the keyboard
125 3228>;; processor. On the PLUS, 90h goes in AL and the port at 03f20h is written.
126 3229>;; So the combined value of 0df90h can be used for both machines with
127 3230>;; appropriate coding of the called routine A20.
128 3231>;;
129 3232>
130 3233>;; MOV AH,0DFH
131 3234> mov ax,0df90h ;; set up for PLUS or AT
132
133 ===============================================================================
134
135 3248< MOV AH,0DDH
136 3249< CALL A20 ; Disable address line 20
137
138 ----> changed to the following:
139
140 3292>
141 3293>;;
142 3294>;; Reset of line A20 on the PC AT requires writing 0ddh to the keyboard
143 3295>;; processor. On the PLUS, the appropriate value is 00.
144 3296>;;
145 3297>
146 3298>;; MOV AH,0DDH
147 3299> mov ax,0DD00h ;; setup for PLUS or AT. ah for IBM, al for PLUS
148 3300> CALL A20 ; Disable address line 20
149
150 ===============================================================================
151
152 3331>;; CS override needed on S5_FLAG to avoid phase errors on
153 3332>;; forward declaration of this variable.
154 3333> cmp cs:[S5_FLAG],0 ;; test for 6300 PLUS
155 3334> jnz A20S5 ;; yes, do this code
156
157 ----> inserted before the following old file line:
158
159 3280< CLI
160
161 ===============================================================================
162
163 3376>
164 3377>;;* A20S5 - Address enable/disable routine for the 6300 PLUS.
165 3378>;;
166 3379>;; This routine enables lines A20-A23 on the PLUS by writing
167 3380>;; to port 03f20h. Bit 7 turns the lines on, and bit 4 sets
168 3381>;; the power-up bit. To disable the lines, the processor
169 3382>;; must be reset. This is done by saving the world and
170 3383>;; jumping to the ROM 80286 reset code. Since the power-up bit
171 3384>;; is set, the data segment is set to the BiosSeg at 40h
172 3385>;; and a jump is then made to the address at RealLoc1.
173 3386>;; At RealLoc1, one can find the CS:IP where the code
174 3387>;; is to continue.
175 3388>;;
176 3389>;; Uses ax, flags.
177 3390>;; Returns with zero flag set.
178 3391>;;
179 3392>A20S5:
180 3393> cli
181 3394> or al,al ;; if zero, then resetting processor
182 3395> jnz A20S5Next
183 3396> call RSet ;; must return with entry value of ax
184 3397>A20S5Next:
185 3398> push dx ;; set/reset port
186 3399> mov dx,3f20h
187 3400> out dx,al
188 3401> pop dx
189 3402> xor al,al
190 3403> STI
191 3404> RET
192 3405>
193 3406>;;* a20S5BOOT - This code bypasses the processor reset on a reboot
194 3407>;; of the 6300 PLUS. Otherwise the machine hangs.
195 3408>a20s5BOOT: ;; use this code before reboot
196 3409> cli
197 3410> jmp short a20s5next
198 3411>
199 3412>OldStackSeg dw 0 ;; used during PLUS processor reset
200 3413> ;; to save the stack segment
201 3414>
202 3415>;;* Rset - Reset the 80286 in order to turn off the address lines
203 3416>;; on the 6300 PLUS. Only way to do this on the
204 3417>;; current hardware. The processor itself can be
205 3418>;; reset by reading or writing prot 03f00h
206 3419>;;
207 3420>;; Uses flags.
208 3421>;;
209 3422>RSet:
210 3423> pusha ;; save world
211 3424> push ds ;; save segments
212 3425> push es
213 3426> mov ax,BiosSeg ;; point to the bios segment
214 3427> mov ds,ax ;; ds -> 40h
215 3428>assume ds:BiosSeg
216 3429> push word ptr [RealLoc1] ;; save what might have been here
217 3430> push word ptr [RealLoc1+2]
218 3431> mov word ptr [RealLoc1],cs:[offset ReturnBack] ;; load our return address
219 3432> mov word ptr [RealLoc1+2],cs
220 3433>assume ds:nothing
221 3434> mov [OldStackSeg],ss ;; save the stack segment, too
222 3435> mov dx,03f00h ;; reset the processor
223 3436> in ax,dx
224 3437> nop
225 3438> nop
226 3439> nop
227 3440> cli
228 3441> hlt ;; should never get here
229 3442>ReturnBack:
230 3443> mov ss,[OldStackSeg] ;; start the recovery
231 3444>assume ds:BiosSeg
232 3445> pop word ptr [RealLoc1+2]
233 3446> pop word ptr [RealLoc1]
234 3447> pop es
235 3448> pop ds
236 3449> popa
237 3450> ret
238
239 ----> inserted before the following old file line:
240
241 3321<
242
243 ===============================================================================
244
245 3530<; out any dirty tracks take a LONG time, so long that we loose
246
247 ----> changed to the following:
248
249 3660>; out any dirty tracks take a LONG time, so long that we lose
250
251 ===============================================================================
252
253 3652< ; Reset INT 1C vector to trun cache off
254
255 ----> changed to the following:
256
257 3782> ; Reset INT 1C vector to turn cache off
258
259 ===============================================================================
260
261 3732< MOV AH,0DFH
262
263 ----> changed to the following:
264
265 3862>;; MOV AH,0DFH
266 3863> mov ax,0df90h ;; set up for PLUS or AT
267
268 ===============================================================================
269
270 3775< MOV AH,0DDH ; Disable adress line 20
271 3776< CALL A20
272
273 ----> changed to the following:
274
275 3906>;; MOV AH,0DDH ; Disable adress line 20
276 3907> mov ax,0DD00h ;; setup for PLUS or AT. ah for IBM, al for PLUS
277 3908> cmp [S5_FLAG],0
278 3909> jz OFF20A
279 3910> call a20s5boot ;; Don't reset the processor on PLUS, this time
280 3911> jmp short off20b
281 3912>off20a:
282 3913> CALL A20
283 3914>off20b:
284
285 ===============================================================================
286
287 4078>
288 4079>U_SWITCH db 0 ;; upper extended memory requested on 6300 PLUS
289
290 ----> inserted before the following old file line:
291
292 3940<
293
294 ===============================================================================
295
296 4274>
297 4275>;;
298 4276>;; 2.5 Check here for 6300 PLUS machine. First look for Olivetti copyright,
299 4277>;; and if found, check id byte at f000:fffd.
300 4278>;;
301 4279>
302 4280> push es ;; Olivetti Machine?
303 4281> mov ax,0fc00h ;; Look for 'OL' at fc00:50
304 4282> mov es,ax
305 4283> cmp es:[0050h],'LO'
306 4284> jnz notS5 ;; not found
307 4285> mov ax,0f000h
308 4286> mov es,ax
309 4287> cmp word ptr es:[0fffdh],0fc00h ;; look for 6300 plus
310 4288> jnz notS5
311 4289> dec [S5_FLAG] ;; yep, set flag
312 4290>notS5:
313 4291> pop es
314 4292>
315
316 ----> inserted before the following old file line:
317
318 4134<;
319
320 ===============================================================================
321
322 4411>;; Added for /u switch
323 4412> cmp al,'u' ;; Look for U switch for PLUS
324 4413> jnz A_TEST
325 4414> cmp [S5_FLAG],0 ;; No good unless PLUS
326 4415> jz bad_parm
327 4416> TEST [GOTSWITCH],SWITCH_A ;; Already have switch A ?
328 4417> JNZ BAD_PARM
329 4418> cmp [U_SWITCH],0
330 4419> jne bad_parm
331 4420> dec [U_SWITCH]
332 4421> jmp scan_loop
333 4422>A_TEST:
334 4423>;;
335
336 ----> inserted before the following old file line:
337
338 4252< CMP AL,"a"
339
340 ===============================================================================
341
342 4435>;; added for /u switch
343 4436> cmp [U_SWITCH],0
344 4437> jne bad_parm
345 4438>;;
346
347 ----> inserted before the following old file line:
348
349 4263< OR [GOTSWITCH],SWITCH_A
350
351 ===============================================================================
352
353 4847>;; Note: When using upper extended memory on the PLUS, the value
354 4848>;; at BASE_RESET + 2 is patched to FA during initialization.
355 4849>;;
356
357 ----> inserted before the following old file line:
358
359 4671<BASE_RESET LABEL DWORD ; RESMEM driver must patch this value
360
361 ===============================================================================
362
363 5312> cmp U_SWITCH,0 ;; don't do this for at&t 6300 plus
364 5313> jnz ret005
365
366 ----> inserted before the following old file line:
367
368 5133< PUSH AX
369
370 ===============================================================================
371
372 5394>
373 5395>;; If upper extended memory is used on the PLUS, it is necessary to
374 5396>;; patch the values of base_reset and base_addr to get the addressing right.
375 5397>;;
376 5398> cmp [U_SWITCH],0 ;; patch the code for /U option
377 5399> jz AT001A
378 5400> mov ax,00fah
379 5401> mov word ptr [base_reset+2],ax ;; patching upper address
380 5402> mov word ptr [base_addr+2],ax ;; to FA from 10
381 5403>AT001A:
382 5404>
383
384 ----> inserted before the following old file line:
385
386 5213< MOV AX,8800H
387
388 ===============================================================================
389
390 5214< INT 15H ; Get extended memory size
391
392 ----> changed to the following:
393
394 5406> INT 15H ; Get extended memory size
395
396 ===============================================================================
397
398 5410>
399 5411>;; If running on a 6300 PLUS, it is necessary to subtract any upper extended
400 5412>;; memory from the value obtained by int 15 to determine the correct memory
401 5413>;; available for a type /E RAMDrive. If loading a /U RAMDrive, it is necessary
402 5414>;; to find out if there IS any upper extended memory.
403 5415>
404 5416> cmp [U_SWITCH],0 ;; did we ask for upper extended memory
405 5417> jz olstuff ;; no
406 5418> call UpperMemCheck ;; yes, see if anything there
407 5419> jc ERR_RET ;; no, quit
408 5420> mov ax,384 ;; yes, but max allowed is 384K
409 5421> jmp short at001b
410 5422>olstuff:
411 5423> cmp [S5_FLAG],0 ;; if not 6300 PLUS, go on
412 5424> jz at001b
413 5425> call UpperMemCheck ;; yes, see if 384K is there
414 5426> jc at001b ;; no, so int 15h is right
415 5427> sub ax,384 ;; yes, subtract 384K
416 5428>AT001B:
417 5429>
418
419 ----> inserted before the following old file line:
420
421 5218< MOV DX,OFFSET ERRMSG2
422
423 ===============================================================================
424
425 5466>
426 5467>;;* UpperMemCheck - Called by 6300 PLUS to verify existence of
427 5468>;; upper extended memory of 384K at FA0000h
428 5469>;;
429 5470>;; Returns carry set if no upper extended memory.
430 5471>;;
431 5472>;; This routine is called only by a 6300 PLUS, and
432 5473>;; it reads the hardware switch DSW2 to do the job.
433 5474>;;
434 5475>UpperMemCheck:
435 5476> push ax
436 5477> in al,66h
437 5478> and al,00001111b
438 5479> cmp al,00001011b
439 5480> pop ax
440 5481> jnz nomem
441 5482> clc
442 5483> ret
443 5484>nomem:
444 5485> stc
445 5486> ret
446
447 ----> inserted before the following old file line:
448
449 5254<
450
451 ===============================================================================
452
453 6301>s5flagmsg db " = S5 flag",13,10,"$"
454 6302>U_msg db " = U Switch", 13,10,'$'
455
456 ----> inserted before the following old file line:
457
458 6068<ENDIF
459
460 ===============================================================================
461
462 28 discrepancies.
463 File smartdrv.asm has 6075 lines.
464 File a:smartdrv.asm has 6310 lines.