Volume Serial Numbers in MS-DOS Version 4.00

ID Number: Q39893

4.00 4.01

MS-DOS

Summary:

MS-DOS Version 4.00 introduced volume serial numbers to allow programs

to determine if disk switches have occurred. This serial number is

assigned when a disk is formatted and is based on the time and date

of the format. Using this method, no two disks from the same machine

should ever have the same serial number unless the date and time are

manually set to be the same for the two disks.

The only way for a program to obtain the serial number of an MS-DOS

Version 4.00 volume is to read the boot sector of the volume and get

the serial number from the information read in. The serial number is

stored as a double word. For more information regarding the structure

of the boot record, see below.

More Information:

The structure of the MS-DOS Version 4.00 boot record is as follows:

-----------------------------------------------------------------

| 3 BYTES short JMP instruction (EBH) + NOP instruction (90H) |

|---------------------------------------------------------------|

| 8 BYTES OEM name and version |

|---------------------------------------------------------------|

| 25 BYTES BPB |

|---------------------------------------------------------------|

| BYTE physical driver number |

|---------------------------------------------------------------|

| BYTE reserved |

|---------------------------------------------------------------|

| BYTE extended boot record signature (29H) |

|---------------------------------------------------------------|

| DWORD volume serial number |

|---------------------------------------------------------------|

| 11 BYTES volume label |

|---------------------------------------------------------------|

| 8 BYTES file system name |

-----------------------------------------------------------------

To get the serial number, a program needs to set up a buffer of 512

bytes and read in one sector from the disk using interrupt 25H,

Absolute Disk Read.