>To determine if a drive uses a DOS-FAT12 or a DOS-FAT16 system: I don't
>think you can derive this information from a bootsector of a partition;

Of course you can:

- Look at position #26 of boot sector. If it is #29, the disk is formatted
with MS-DOS 4 or higher. Then it can be either FAT12 or FAT16.

Now look at position #36. You will find either the string "FAT12" or "FAT16".

You can also look at the number of clusters (calculated from the number of
sectors, the cluster size, and the number of sectors used for FAT and
directory). 4086 clusters or more means FAT16 in use, else, FAT12.

>but it can be obtained from the MasterBootRecord of a harddisk. (=absolute
>sector 0) This sector contains the partition table and for each partition
>also a kind of code (#00=disabled partition, #01=DOS-FAT12, #xx Linux,
>#yy=DOS-FAT16 #zz=DOS-FAT32LBA etc., etc.)

There is four primary partition entries in the physical sector 0:

#1BE: First partition entry
#1CE: Second partition entry
#1DE: Third partition entry
#1EE: Fourth partition entry

Data in these partitions are:

+0: #80 = Active partition
    #00 = Not active partition
+1: Head of first sector
+2, +3: Cylinder and sector of first sector, in a strange format designed
for PC BIOS
+4: Partition type. Intiristing types for us are:
    #0: Unused 
    #1: MS-DOS, FAT12, <32Mb
    #4: MS-DOS, FAT16, <32Mb
    #5: MS-DOS, extended
    #6: MS-DOS, >32Mb
+5: Head of last sector
+6,+7: Cylinder, sector of first sector (see +2,+3)
+8 - +11: First physiscal sector of partition
+12: Partition lenght in sectors

Head and cylinder can be ignored, in fact MegaSCSI puts it to 0 when doing
ESE-ASPI format.

If partition is extended, search for a new partition table in its first
sector.

>I think it is a good idea to pass this information through the GETDPB
>(Get diskparameter block function, address #4016 I think) A DPB field is
>21 bytes long and it is filled in by the diskrom.

It is easier to rely in the clusters number cryterium, I think. Then DPB
format must not be modified.


-----------------------------------------------------------------------------
        Konami Man - AKA Nestor Soriano (^ ^)v - Itsumo MSX user

        http://www.geocities.com/SiliconValley/Bay/9797/msx.htm
            [EMAIL PROTECTED]        ICQ#: 18281450

    "In Windows 98, 3.000 found failures of W95 have been corrected..."
Translation: 3.000.000 not found failures continue without being corrected...
----------------------------------------------------------------------------
-

****
MSX Mailinglist. To unsubscribe, send an email to [EMAIL PROTECTED] and put
in the body (not subject) "unsubscribe msx [EMAIL PROTECTED]" (without the
quotes :-) Problems? contact [EMAIL PROTECTED] (www.stack.nl/~wiebe/mailinglist/)
****

Reply via email to