1 CMP V2.13 Copyright (C) 1984, 1985 by White Heron Corporation
4 old: smartdrv.asm (on the left) Note: < marks old lines.
5 new: a:smartdrv.asm (on the right) > marks new lines.
7 ===============================================================================
9 6<; Will use IBM extended memory on PC-AT or
10 7<; use Above Board on PC, XT, or AT
13 10<; device = SMARTDRV.sys [bbbb] [/a]
15 ----> changed to the following:
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
22 11>;; device = SMARTDRV.sys [bbbb] [/a] [/u]
24 ===============================================================================
28 ----> changed to the following:
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
37 48>;; Note that it is an error to specify this switch
38 49>;; if the machine is not a 6300 PLUS.
40 ===============================================================================
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
46 ----> inserted before the following old file line:
50 ===============================================================================
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.
59 132>BiosSeg segment at 40h ;; Used to locate 6300 PLUS reset address
64 ----> inserted before the following old file line:
68 ===============================================================================
70 147>;; The /U configuration using upper extended memory on the
71 148>;; 6300 PLUS is a special case of the type 1 configuration.
73 ----> inserted before the following old file line:
77 ===============================================================================
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.*
83 ----> inserted before the following old file line:
85 302<INT13DEV LABEL WORD
87 ===============================================================================
89 307< DB "SMARTDRV" ;Name of device
91 ----> changed to the following:
93 335> DB "SMARTAAR" ;Name of device
95 ===============================================================================
97 387>;; Data peculiar to AT&T 6300 PLUS.
99 389>S5_FLAG DB 0 ;; If set, computer is a 6300 PLUS
101 ----> inserted before the following old file line:
105 ===============================================================================
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
111 ----> inserted before the following old file line:
113 3043<BASE_ADDR LABEL DWORD ; 24 bit address of start of this RAMDRV
115 ===============================================================================
119 ----> changed to the following:
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.
131 3234> mov ax,0df90h ;; set up for PLUS or AT
133 ===============================================================================
136 3249< CALL A20 ; Disable address line 20
138 ----> changed to the following:
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.
147 3299> mov ax,0DD00h ;; setup for PLUS or AT. ah for IBM, al for PLUS
148 3300> CALL A20 ; Disable address line 20
150 ===============================================================================
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
157 ----> inserted before the following old file line:
161 ===============================================================================
164 3377>;;* A20S5 - Address enable/disable routine for the 6300 PLUS.
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.
176 3389>;; Uses ax, flags.
177 3390>;; Returns with zero flag set.
181 3394> or al,al ;; if zero, then resetting processor
183 3396> call RSet ;; must return with entry value of ax
185 3398> push dx ;; set/reset port
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
197 3410> jmp short a20s5next
199 3412>OldStackSeg dw 0 ;; used during PLUS processor reset
200 3413> ;; to save the stack segment
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
210 3423> pusha ;; save world
211 3424> push ds ;; save segments
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
228 3441> hlt ;; should never get here
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]
239 ----> inserted before the following old file line:
243 ===============================================================================
245 3530<; out any dirty tracks take a LONG time, so long that we loose
247 ----> changed to the following:
249 3660>; out any dirty tracks take a LONG time, so long that we lose
251 ===============================================================================
253 3652< ; Reset INT 1C vector to trun cache off
255 ----> changed to the following:
257 3782> ; Reset INT 1C vector to turn cache off
259 ===============================================================================
263 ----> changed to the following:
266 3863> mov ax,0df90h ;; set up for PLUS or AT
268 ===============================================================================
270 3775< MOV AH,0DDH ; Disable adress line 20
273 ----> changed to the following:
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
279 3910> call a20s5boot ;; Don't reset the processor on PLUS, this time
280 3911> jmp short off20b
285 ===============================================================================
288 4079>U_SWITCH db 0 ;; upper extended memory requested on 6300 PLUS
290 ----> inserted before the following old file line:
294 ===============================================================================
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.
302 4280> push es ;; Olivetti Machine?
303 4281> mov ax,0fc00h ;; Look for 'OL' at fc00:50
305 4283> cmp es:[0050h],'LO'
306 4284> jnz notS5 ;; not found
309 4287> cmp word ptr es:[0fffdh],0fc00h ;; look for 6300 plus
311 4289> dec [S5_FLAG] ;; yep, set flag
316 ----> inserted before the following old file line:
320 ===============================================================================
322 4411>;; Added for /u switch
323 4412> cmp al,'u' ;; Look for U switch for PLUS
325 4414> cmp [S5_FLAG],0 ;; No good unless PLUS
327 4416> TEST [GOTSWITCH],SWITCH_A ;; Already have switch A ?
329 4418> cmp [U_SWITCH],0
336 ----> inserted before the following old file line:
340 ===============================================================================
342 4435>;; added for /u switch
343 4436> cmp [U_SWITCH],0
347 ----> inserted before the following old file line:
349 4263< OR [GOTSWITCH],SWITCH_A
351 ===============================================================================
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.
357 ----> inserted before the following old file line:
359 4671<BASE_RESET LABEL DWORD ; RESMEM driver must patch this value
361 ===============================================================================
363 5312> cmp U_SWITCH,0 ;; don't do this for at&t 6300 plus
366 ----> inserted before the following old file line:
370 ===============================================================================
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.
376 5398> cmp [U_SWITCH],0 ;; patch the code for /U option
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
384 ----> inserted before the following old file line:
388 ===============================================================================
390 5214< INT 15H ; Get extended memory size
392 ----> changed to the following:
394 5406> INT 15H ; Get extended memory size
396 ===============================================================================
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.
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
411 5423> cmp [S5_FLAG],0 ;; if not 6300 PLUS, go on
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
419 ----> inserted before the following old file line:
421 5218< MOV DX,OFFSET ERRMSG2
423 ===============================================================================
426 5467>;;* UpperMemCheck - Called by 6300 PLUS to verify existence of
427 5468>;; upper extended memory of 384K at FA0000h
429 5470>;; Returns carry set if no upper extended memory.
431 5472>;; This routine is called only by a 6300 PLUS, and
432 5473>;; it reads the hardware switch DSW2 to do the job.
437 5478> and al,00001111b
438 5479> cmp al,00001011b
447 ----> inserted before the following old file line:
451 ===============================================================================
453 6301>s5flagmsg db " = S5 flag",13,10,"$"
454 6302>U_msg db " = U Switch", 13,10,'$'
456 ----> inserted before the following old file line:
460 ===============================================================================
463 File smartdrv.asm has 6075 lines.
464 File a:smartdrv.asm has 6310 lines.