4

Machine is an AT 80286, drive A is 3.5' 1.44 Mb, drive B is 5.25' 1.2 Mb.

Vector for int 1Eh is a far pointer to address of active DPT (diskette parameter table):

-d 0000:0078
0000:0070                          22 05 00 00 BC 49 00 C0           "....I..

-d 0000:0522
0000:0520        DF 02 25 02 3F 1B-FF 54 F6 0F 08 00 00 00     ..%.?..T......

From DPT's address (0000:0522) it is obvious that MS-DOS has created a distinct DPT and set 1Eh to point there. But where is active DPT for drive B, the 5 1/4 one, stored?

Calling int 13h,AH=08h points to the default DPTs set by the BIOS, which are indeed different for drives A & B :

For DL=0 (drive A, 1.44) it points to F000:B392

F000:B390        AF 02 25 02 12 1B-FF 6C F6 0F 08 4F 00 DF     ..%....l...O..

For DL=1 (drive B, 1.2) it points to F000:B378

F000:B370                          DF 02 25 02 0F 1B FF 54           ..%....T
F000:B380  F6 0F 08 4F 00 DF 02 25-02 09 2A FF 50 F6 0F 08   ...O...%..*.P...

What troubles me is that offset 04h for DPT at 0000:0522 is 3F, this means 63 sectors per track. This is not any of my floppies, this is my hard disk!

Whereas F000:B396 is 12h=18 sectors per track for drive A, and F000:B37C is fh=15 sectors per track for drive B. Proper values for 1.44 and 1.2 formats, respectively.

My questions are:

  1. DPT pointed to by vector of int 1Eh, residing in this case at 0000:0522, belongs to which drive?
  2. Since vector of int 1Eh points to one DPT only, how can I set / view active settings for different drives?
  3. Since int 08h,AH=08h populates ES:DI only for floppies (source: Ralph Brown's interrupt list ), how can I set / view said settings in the case of hard drives? I am especially interested in block size.

Edit/Update:

When booting from C: with both drives without a floppy: DPT+04 offset is 3Fh, that is 63 sectors per track

-d 0000:0522
0000:0520        DF 02 25 02 3F 1B-FF 54 F6 0F 08 00 00 00     ..%.?..T......

When accessing drive A and executing DEBUG.EXE from it: DPT+04 offset becomes 12h=18 sectors per track, typical for 1.44

-d 0000:0522
0000:0520        DF 02 25 02 12 1B-FF 54 F6 0F 08 00 00 00     ..%....T......

From there on, no matter from which drive (A,B,C) I execute DEBUG.EXE and dump the contents of 0000:0522, its contents do not change.

2

1 Answer 1

3
  1. As the floppy disk parameter table (DPT) address points to a memory area set by DOS, the BIOS uses whatever settings there are set by DOS when accessing any floppy drive. The data (or the pointer) will dynamically change accordingly when any floppy drive gets accessed by DOS. After DOS is done with the drive access, it may restore any parameters it changed, so that any programs using INT 13h to directly access a drive won't notice it changed during DOS access. For example, read and write operations may use different motor ready timeout as a workaround to a problem that would fail writes on some drives or when retrying reads. DOS may also install a custom INT 13H handler to return different data to you than what BIOS would return.

  2. Good question. As the DPT is managed by DOS at low level, you really have no direct access to parameters that DOS uses when it accesses a disk. DOS keeps track of disk type for each disk at higher level, i.e. at the Drive Parameter Table or Disk Parameter Block level found on sector 0 of each floppy. That's how DOS can detect which type of floppy is inserted and how to adjust the BIOS DPT to access it - i.e. how many sides or sectors per track there is and what parameters to use when formatting it.

  3. As the Disk Parameter Table is only used by BIOS for accessing floppies, it is useless for hard disks. As first PCs only contained BIOS access to floppies, adding a hard drive means adding a separate hard drive BIOS which hooks INT 13H and calls the motherboard BIOS for floppies and handles the hard drive itself. Some hard drive BIOSes emulate returning some DPT or just the current floppy DPT. Corresponding hard disk parameters are stored at pointers on INT 41h and 46h. But for newer drives, they may be irrelevant. Also BIOS interface to hard disks with sector size other than 512 bytes does not exist, so always assume the BIOS interface for hard disks is 512 bytes. However, some DOS versions did not fare well with "large" drives and it was required for DOS hard disk driver to emulate a 1024-byte or 2048-byte sectors for DOS and access multiple 512-byte sectors on drive to match the emulated size.

So if you want to know hard drive block size, ask DOS, and regardless of what DOS says about the logical sector size, the physical sector size should always be 512 bytes.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.