60 lines
2.6 KiB
Plaintext
60 lines
2.6 KiB
Plaintext
|
|
|||
|
Areas where 2.0 is not compatible with previous versions of
|
|||
|
the DOS.
|
|||
|
|
|||
|
+ Direct calls to the BIOS
|
|||
|
Any program which jumped directly to the BIOS by way
|
|||
|
of the jump table at 40:0 will no longer work.
|
|||
|
|
|||
|
+ FAT pointer calls
|
|||
|
Programs which used system calls 27 and 28 to get a
|
|||
|
pointer to the FAT will no longer work. Because the
|
|||
|
FAT is now cached with other disk resources, there is
|
|||
|
no fixed location in memory to pass the address of.
|
|||
|
The calls still exist, however, and have the same
|
|||
|
format. THEY CAN ONLY BE USED TO GET THE FAT ID BYTE.
|
|||
|
On return ES:BX points to a FAT ID BYTE for the Drive.
|
|||
|
Doing anything except READing this ONE byte will
|
|||
|
probably crash the system. In order to get at the
|
|||
|
FAT, programs will first call DSKRESET (call 13) to
|
|||
|
flush out any dirty buffers, and then make a GETDPB
|
|||
|
call (call 31 or 50) to find out which sector on the
|
|||
|
disk the FAT starts at, how big it is, and how many
|
|||
|
copies of it there are. Then INT 25H and INT 26H can
|
|||
|
be used to transfer the FAT in and out of the programs
|
|||
|
memory space.
|
|||
|
|
|||
|
+ INT 25H and INT 26H
|
|||
|
In order for the above to work, and in order to
|
|||
|
maintain some order in the world of multi-surface
|
|||
|
disks, it is required that INT 25H and 26H use the
|
|||
|
MSDOS sector mapping rather than some rather arbitrary
|
|||
|
head-cylinder-sector mapping.
|
|||
|
|
|||
|
The following subroutine will read the fat into the area of
|
|||
|
memory specified by DS:BX. DL contains the drive number, DL=0
|
|||
|
means read the fat from the default drive, DL=1 indicates read
|
|||
|
from drive A:, and so on.
|
|||
|
|
|||
|
getfat:
|
|||
|
push bx ; save pointer to fat area
|
|||
|
push ds
|
|||
|
mov ah,50 ; request the dpb
|
|||
|
int 21h
|
|||
|
mov cx,[bx+15] ; get fat sector count
|
|||
|
mov dx,[bx+6] ; first sector of fat
|
|||
|
pop ds ; restore fat area pointer
|
|||
|
pop bx
|
|||
|
mov al,dl ; is it the default drive?
|
|||
|
or al,al
|
|||
|
jnz driveok ; if not, load fat
|
|||
|
|
|||
|
mov ah,19h ; ask for default drive
|
|||
|
int 21h ; get the default drive
|
|||
|
inc al ; map a=0 to a=1
|
|||
|
driveok:
|
|||
|
dec al ; map a=1 to a=0
|
|||
|
int 25h ; read the fat into DS:BX
|
|||
|
pop ax ; clean up the stack
|
|||
|
ret
|
|||
|
|