Page 1 of 1

How does DOS work out the volume serial number?

Posted: Thu Jul 03, 2003 11:00 pm
by tom1000000
Hello,

I am probably being lazy and  could find this info out if I could get hold of an open source format utility,  but I'll ask anyway.

In the FAT specification it says the volume serial number is a 32bit value derived from the current date and time. It would have been really nice if they gave an example.

So if a disk is formatted at 2003 July 4, 12:15:34pm, how is that date / time converted to a 32 bit value by DOS??

Thanks!

RE:How does DOS work out the volume serial number?

Posted: Fri Jul 04, 2003 11:00 pm
by Anton
You can do it any way. The main point is that this number is unik. So any system which sets this value should set it in some way, that there is very low probability that this number repeats.
Anton.

RE:How does DOS work out the volume serial number?

Posted: Fri Jul 04, 2003 11:00 pm
by carbonBased
I wouldn't be surprised if it's the same way Unix (and C) do it; as the number of seconds that've passed since January 1, 1970 (I believe that's the date they use).

Cheers,
Jeff

RE:How does DOS work out the volume serial number?

Posted: Sun Jul 06, 2003 11:00 pm
by kataklinger
The first part of the serial number is equal to the sum of the time
(seconds and hundredths of a second) and the date (month and day);   The
second part of the serial number is equal to the sum of the time (hours
and minutes) and date (year), where all numbers are in hex.  For
example, if the diskette is formatted at 8:32:43.65 on 7/21/1991, the
first part of the serial number will be 2B41+0715, or 3256;  the second
part of the serial number will be 0820+07C7, or 0FE7.


By some Ray