Skip to content

Commit 7e51e42

Browse files
committed
v4.01: Reverse-engineer bugfixes between v4.00 and v4.01.
1 parent c42c7d0 commit 7e51e42

File tree

9 files changed

+153
-37
lines changed

9 files changed

+153
-37
lines changed

v4.0/dist/README.TXT

Lines changed: 117 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
README.TXT
2-
October 12, 1988
2+
December 1, 1988
33

44
This document covers topics not included in MS-DOS printed documentation.
55
It also lists a small number of corrections.
66

7+
78
DEVICE DRIVERS
89
--------------
910

@@ -43,7 +44,6 @@ please see the Microsoft MS-DOS User's Reference.
4344

4445
HIMEM.SYS--Installable Device Driver for Extended Memory
4546
---------------------------------------------------------
46-
4747
Capabilities
4848
------------
4949

@@ -64,6 +64,7 @@ If you are loading other extended memory programs which do not use the XMS
6464
interface to manage the extended memory, they should be configured to
6565
leave at least 64K of extended memory free.
6666

67+
6768
System Requirements
6869

6970
To use HIMEM.SYS with your computer, you need the following:
@@ -72,6 +73,7 @@ o An IBM PC/AT, PS/2 (except models 25 and 30), or compatible computer
7273

7374
o Extended memory
7475

76+
7577
Installing HIMEM.SYS
7678

7779
To install HIMEM.SYS, include the following command line in your
@@ -125,6 +127,7 @@ will be displayed:
125127

126128
n extended memory handles available.
127129

130+
128131
Examples
129132

130133
The following command line shows the most common configuration of HIMEM.SYS:
@@ -142,6 +145,7 @@ maximum number of Extended Memory Block handles:
142145

143146
DEVICE=HIMEM.SYS /NUMHANDLES=128
144147

148+
145149
Messages
146150

147151
The following messages may appear when you install the HIMEM.SYS
@@ -157,7 +161,7 @@ You have installed HIMEM.SYS properly.
157161

158162
You have tried to install HIMEM.SYS on a machine using a version of MS-DOS
159163
lower than 3.0. You can only install HIMEM.SYS on systems using MS-DOS
160-
Version 3.00 or higher.
164+
version 3.00 or higher.
161165

162166
* ERROR: HIMEM.SYS requires an 80x86-based machine.
163167
XMS Driver not installed.
@@ -212,13 +216,13 @@ System Requirements
212216

213217
To use EMM386.SYS with your computer, you need the following:
214218

215-
o A 80386 based computer compatible with the IBM AT standard
219+
o A 80386-based computer compatible with the IBM AT standard
216220
hardware/software interface, such as Compaq 386 or AST Premium 386.
217221

218222
o Extended memory
219223

220224
Note: The EMM386.SYS driver detects most boards which utilize memory
221-
between the addresses A000-E000. To determine what memory addresses to
225+
between the addresses A000--E000. To determine what memory addresses to
222226
exclude, or where to load its page frame, EMM386.SYS searches between A000
223227
and E000 to find addresses used by these adapters. It will not load its
224228
page frame at these addresses. Once it finds a contiguous block of 64K of
@@ -230,7 +234,7 @@ Installing EMM386.SYS
230234
To install EMM386.SYS, include the following command line in your
231235
CONFIG.SYS file:
232236

233-
DEVICE=[d:][path]emm386.sys [size] [X:mmmm-nnnn] [Mx]
237+
DEVICE=[d:][path]EMM386.SYS [size] [X:mmmm-nnnn] [Mx]
234238

235239
You should make sure that the EMM386.SYS driver gets loaded before any
236240
other programs, such as Microsoft RAMDrive, that use expanded memory.
@@ -239,26 +243,26 @@ Following is a description of the options in the EMM386.SYS command line:
239243

240244
size
241245

242-
size specifies the amount of extended memory that EMM386.SYS will use.
243-
Specify the amount in kilobytes. The recommended amount is 512K and
244-
default is 256K.
246+
This option specifies the amount of extended memory that
247+
EMM386.SYS will use. Specify the amount in kilobytes.
248+
The recommended amount is 512K and default is 256K.
245249

246250
X:mmmm-nnnn (Memory Exclusion Range)
247251

248-
This parameter allows you to specify a range of memory which will not be
252+
This option allows you to specify a range of memory which will not be
249253
used for locating the EMM386.SYS page frame or other mappable pages. Use
250254
this option if an expansion option board (e.g., a network board) is
251255
installed between the addresses A000 and E000.
252256

253257
Don't use this option unless you detect a conflict between EMM386.SYS and
254-
an expansion option board. However, a conflict is not likely to occur, as
258+
an expansion option board. However, a conflict is not likely to occur as
255259
EMM386.SYS automatically recognizes the presence of most expansion option
256-
boards and will not try and use the range of memory these boards use for
260+
boards and will not try to use the range of memory these boards use for
257261
locating the EMM386.SYS page frame or mappable pages.
258262

259263
Mx (Page Frame Address Location)
260264

261-
This parameter allows you to directly specify where the EMM386.SYS page
265+
This option allows you to directly specify where the EMM386.SYS page
262266
frame should be located in memory. EMM386.SYS will automatically locate
263267
an address for the EMM386.SYS page frame. Don't use this option unless
264268
you want to locate the page frame at a different address. If EMM386.SYS
@@ -284,27 +288,27 @@ conflict with any options that you have previously installed.
284288

285289
Examples
286290

287-
device=emm386.sys 1024
291+
DEVICE=EMM386.SYS 1024
288292

289293
This will load the EMM386.SYS driver and take 1024K of extended memory
290294
to provide expanded memory.
291295

292296

293-
device=emm386.sys 1024 X:C400-C7FF
297+
DEVICE=EMM386.SYS 1024 X:C400-C7FF
294298

295299
This will produce the same result as in the first example, but it also
296300
excludes the C400 to C7FF (768K to 832K) from being used by EMM386.SYS to
297301
locate its page frame or mappable pages.
298302

299303

300-
device=emm386.sys 1024 X:C400-C7FF X:E000-E3FF
304+
DEVICE=EMM386.SYS 1024 X:C400-C7FF X:E000-E3FF
301305

302306
This will produce the same result as in the second example, but it excludes
303307
both C400-C7FF and E000-E3FF (896K to 960K) from being used by EMM386.SYS
304308
to locate its page frame or mappable pages.
305309

306310

307-
device=emm386.sys 1024 M6
311+
DEVICE=EMM386.SYS 1024 M6
308312

309313
This will load EMM386.SYS and make 1024K of expanded memory available for
310314
its use. It also forces EMM386.SYS to locate its page frame at D800.
@@ -352,7 +356,7 @@ You will need additional extended memory required to install EMM386.SYS
352356

353357
You have tried to install EMM386.SYS on a machine using a version of MS-DOS
354358
lower than 3.1. You can only install EMM386.SYS on systems using MS-DOS
355-
Version 3.1 or higher.
359+
version 3.1 or higher.
356360

357361
* EMM386 not installed - incorrect machine type.
358362

@@ -371,6 +375,91 @@ contiguous memory in the 640K to 1 MB range to load its page frame
371375
You cannot install EMM386.SYS twice.
372376

373377

378+
XMA2EMS.SYS Device Driver
379+
-------------------------
380+
381+
This is a device driver that supports the Lotus, Intel, and Microsoft
382+
(LIM) Expanded Memory Specification (EMS) 4.0 under DOS 4.0.
383+
384+
Important
385+
386+
o Expanded memory is memory addressed through a
387+
combination of an Expanded Memory Specification (EMS)
388+
device driver, such as XMA2EMS.SYS, and a hardware
389+
adapter capable of providing expanded memory. This
390+
memory enhancement is available to you if you have
391+
one of the following installed:
392+
393+
- IBM 2MB Expanded Memory Adapter
394+
- IBM Personal System/2 80286 Expanded Memory
395+
Adapter/A
396+
- IBM Personal System/2 80286 Memory Expansion Option
397+
398+
o Refer to the EMS 4.0 specification for further
399+
information about how to allocate the memory in your
400+
system.
401+
402+
403+
Example
404+
405+
For example, to specify a 64K page frame for EMS applications, two
406+
16K pages for DOS usage, and 1MB as the amount of expanded memory to
407+
allocate, enter the following line in your CONFIG.SYS file:
408+
409+
DEVICE=C:\DOS\XMA2EMS.SYS FRAME=D000 P254=C000 P255=C400 /X:64
410+
411+
The following section explains the values entered in
412+
this command line and other values that can be substituted.
413+
414+
415+
Remarks
416+
417+
o The FRAME=D000 parameter specifies the default EMS page frame. It
418+
consists of a 64K contiguous (connecting) space of available
419+
memory, specified as one address that automatically sets the next
420+
four contiguous pages. You may substitute the address segment,
421+
D000, with any 64K available page frame from address segments
422+
hexadecimal C000 through E000.
423+
424+
o If you specify the FRAME parameter (such as FRAME=D000) to set
425+
pages P0, P1, P2, and P3, you cannot individually specify page
426+
p0, p1, p2, or p3 in the DEVICE statement. By specifying the
427+
FRAME parameter, you are already identifying four contiguous
428+
pages.
429+
430+
For example, you could set pages p0 through p3 from D000 through
431+
DC00 or have a page frame begin at D000 if you have a 64KB
432+
contiguous space in memory:
433+
434+
DEVICE=XMA2EMS.SYS P0=D000 P1=D400 P2=D800 P3=DC00 P254=C000 P255=C400
435+
436+
or
437+
438+
DEVICE=XMA2EMS.SYS FRAME=D000 P254=C000 P255=C400
439+
440+
441+
o The P254=C000 and P255=C400 parameters in the example represent
442+
"pages". A page is a fixed-length block of memory that is equal
443+
to 16K of memory and can represent the value P0, P1, P2, P3,
444+
P254, or P255. In the case of the XMA2EMS driver, pages P254 and
445+
P255 are reserved for use by DOS. If you specify the P254 page,
446+
you can run FASTOPEN in expanded memory by
447+
specifying the /X parameter. If you specify P255, you can run the
448+
BUFFERS command with the /X parameter specified. If you do not
449+
specify P254 or P255 in your DEVICE statement for XMA2EMS, DOS
450+
cannot use expanded memory and, therefore, uses conventional
451+
memory for DOS functions.
452+
453+
o You can set the size value of /X from a minimum of four 16K
454+
pages through the default value which is the maximum total
455+
available memory in multiples of 16K pages. For example, the
456+
minimum amount of memory you may specify is 64K (four 16K
457+
pages):
458+
459+
DEVICE=C:\DOS\XMA2EMS.SYS FRAME=D000 P254=C000 P255=C400 /X:4
460+
461+
462+
374463
CORRECTIONS
375464
-----------
376465

@@ -393,3 +482,13 @@ MS-DOS User's Reference--Mode command--Page 100.
393482
The second syntax statement should read:
394483

395484
mode [display],shift[,t]
485+
486+
487+
MS-DOS User's Reference--Select command--Page 122.
488+
489+
The third paragraph should read:
490+
491+
If you have already installed MS-DOS on the hard disk and you need to
492+
update the specifications made previously, insert the Install disk in drive A,
493+
set drive A as the default drive, and enter the following at the DOS prompt:
494+

v4.0/src/BIOS/MSINIT.ASM

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,6 +1704,13 @@ UNKNOWN3_0_J: ;AN012;Legally formatted media,
17041704

17051705
TRY5:
17061706
call Cover_Fdisk_Bug ;AN010;
1707+
CMP WORD PTR cs:[bx+7],"0" SHL 8 + "1"
1708+
JNZ TRY6
1709+
CMP BYTE PTR cs:[bx+9],"."
1710+
JZ COPYBPB
1711+
JMP Unknown3_0
1712+
1713+
TRY6:
17071714
CMP WORD PTR cs:[bx+8],"." SHL 8 + "3"
17081715
jb Unknown3_0_J ;AN012; Must be 2.1 boot record. Do not trust it, but still legal.
17091716
JNZ COPYBPB ;AN007; Honor OS2 boot record, or DOS 4.0 version

v4.0/src/CMD/COMMAND/TCMD2A.ASM

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ print_version:
9898
pop ax
9999
xchg ah,al
100100
xor ah,ah
101+
inc ax ; Increment minor version.
101102
mov minor_ver_num,ax
102103
mov dx,offset trangroup:vermes_ptr
103104
jmp std_printf

v4.0/src/CMD/COMMAND/TRANMSG.ASM

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,10 @@ VerMes_Ptr dw 1040 ;AN000;message number
302302
dw OFFSET TranGroup:Minor_Ver_Num ;AN000;offset of arg
303303
dw 0 ;AN000;segment of arg
304304
db 2 ;AN000;second subst
305-
db Unsgn_Bin_Word ;AN000;binary to decimal
305+
db Right_Align+Unsgn_Bin_Word ;AN000;binary to decimal
306306
db 2 ;AN000;maximum width
307307
db 2 ;AN000;minimum width
308308
db "0" ;AN000;pad character
309-
310309
; "Volume in drive %1 has no label",13,10
311310
;
312311
VolMes_Ptr_2 dw 1041 ;AN000;message number

v4.0/src/CMD/FASTOPEN/FASTSEEK.ASM

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,11 +1595,21 @@ Trunc_Find_Extent: ; ;AN000;
15951595
jnc Trunc_shrink_extent ; found extent ?? ;AN000;
15961596

15971597
Trunc_No_Extent: ; extent not found
1598-
xor di,di ; no, return DI = 0 ;AN000;
1599-
clc ; clear carry
1600-
jmp Trunc_exit ; exit ;AN000;
1601-
1598+
mov cx,Logical_Clusnum ; CX = given logical cluster number ;AN000;
1599+
mov si,Cur_Hdr_Ptr ; DI-->current header ;AN000;
1600+
mov di,es:[si].EH_COUNT ; BX = first phys clus num of prev ;AN000;
1601+
LAB_10c7_087c:
1602+
cmp di, -1 ; any next extent ??
1603+
JNZ LAB_10c7_0884
1604+
JMP Trunc_exit ; exit ;AN000;
16021605

1606+
LAB_10c7_0884:
1607+
cmp cx,es:[di]
1608+
ja LAB_10c7_088c
1609+
jmp LAB_10c7_089b
1610+
LAB_10c7_088c:
1611+
mov di,es:[di].EH_Next_Extn_Ptr ; get address of next extent ;AN000;
1612+
jmp LAB_10c7_087c
16031613

16041614
;--------------------------------------------------------------------------
16051615
; Found extent. Shrink the current extent and delete all subsequent extents.
@@ -1616,6 +1626,7 @@ Trunc_Shrink_Extent:
16161626
; First logical clus num matched. mark previous header or extent as last
16171627
; DI--->Extent found (starting extent)
16181628
;--------------------------------------------------------------------------
1629+
LAB_10c7_089b:
16191630
mov si,es:[di].EH_Prev_Extn_Ptr ; SI-->Previous extent ;AN000;
16201631
cmp si, -1 ; any previous extent ?? ;AN000;
16211632
je trunc_no_prev ; no, jump ;AN000;
@@ -1630,7 +1641,6 @@ Trunc_Shrink_Extent:
16301641
Trunc_No_Prev:
16311642
mov si,Cur_Hdr_Ptr ; get current header ;AN000;
16321643
mov es:[si].FH_Next_Extn_Ptr,-1 ; mark header for no extent ;AN000;
1633-
mov es:[si].FH_MRU_Extn_Ptr, -1
16341644
mov si,di ; save the current extent ptr ;AN000;
16351645
mov cx, 0 ; CX = buffer release counter ;AN000;;AN000;
16361646
jmp short trunc_more ; release the extent ;AN000;
@@ -1680,8 +1690,7 @@ TRUNC_LOOP: ; loop for subsequent extents
16801690

16811691
Trunc_Mark_Prev_Hdr:
16821692
mov di, Cur_Hdr_Ptr ; DI = address of current header
1683-
mov es:[di].FH_Next_Extn_Ptr,-1 ; mark header for no extent ;AN000;
1684-
mov es:[di].FH_MRU_Extn_Ptr, -1
1693+
mov es:[di].FH_MRU_Extn_Ptr, -1 ; mark header for no extent ;AN000;
16851694
jmp short Trunc_Chk_Next_Ext ; look for next extent
16861695

16871696
;-----------------------------------------------------------------------------
@@ -1742,12 +1751,10 @@ Trunc_Join_Free_Area:
17421751
Trunc_make_MRU_Hdr:
17431752
cmp Prev_Hdr_Ptr,-1 ; first header in the Queue?? ;AN000;
17441753
jne Trunc_move_Hdr
1745-
clc
17461754
jmp short Trunc_Exit ; yes, dont move to top ;AN000;
17471755

17481756
Trunc_move_Hdr:
17491757
CALL MAKE_MRU_HEADER ; move header to TOP of the Queue ;AN000;
1750-
clc
17511758

17521759
Trunc_Exit:
17531760
CALL Check_it

v4.0/src/CMD/FORMAT/FORMAT.ASM

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,9 +619,12 @@ GETTRK:
619619
JNZ TRKFND ;No - check error conditions
620620
JMP DRTFAT ;Yes
621621
TRKFND:
622-
mov bx,word ptr Relative_Sector_Low ;get the low word of the sector ;an000; dms;
622+
mov bx,word ptr Relative_Sector_High ;get the high word of the sector ;an000; dms;
623+
OR BX,BX
624+
JNZ CLRTEST
625+
mov bx,word ptr Relative_Sector_Low ;get the high word of the sector ;an000; dms;
623626
CMP BX,STARTSECTOR ;Are any sectors in the system area bad?
624-
JAE CLRTEST ; MZ 2.26 unsigned compare
627+
JAE CLRTEST ; MZ 2.26 unsigned compare
625628
Message msgDiskUnusable ; ;AC000;
626629
JMP FRMTPROB ;Bad disk -- try again
627630
CLRTEST:
@@ -644,6 +647,9 @@ CLRTEST:
644647
ADD AX,STARTSECTOR
645648
MOV SYSTRKS,AX ;Space FAT,Dir,and system files require
646649
CMPTRKS:
650+
mov bx,word ptr Relative_Sector_High ;get the high word of the sector ;an000; dms;
651+
OR BX,BX
652+
JNZ BAD100
647653
mov bx,word ptr Relative_Sector_Low ;get the low word of the sector ;an000; dms;
648654
CMP BX,SYSTRKS
649655
JA BAD100 ; MZ 2.26 unsigned compare

0 commit comments

Comments
 (0)