Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Volume Serial Number: how is it created?

22 views
Skip to first unread message

Pmadar

unread,
Oct 19, 1999, 3:00:00 AM10/19/99
to
Hello win95 filesystem gurus:

I would like to know how a Volume Serial Number is generated in Win95,
before it is written onto a freshly formatted disk. Does anyone know the
algorithm? I visited a couple of websites that had algorithms for DOS 4.0
which involved ORing and adding bytes from the current time, but this did
not produce the same result as a win95 volume serial number. I understand
that Win95 has the equivalent of DOS 7 running underneath.

Also, where does the Volume Serial Number from a CD-audio disc come from?
Surely it is not on the disc itself. That is a microsoft-specific piece of
data. The volume serial number is conjured up by the operating system
itself (win95) somehow. I would like to know this conjuring method.

Any help is appreciated

-----------------------------------------------------------------
Piero Madar
Escient LLC Research & Development
12955 Old Meridian St.
Carmel IN 46032
317-814-3045
pma...@escient.com
-----------------------------------------------------------------

E.P. van Westendorp

unread,
Oct 19, 1999, 3:00:00 AM10/19/99
to
Sorry, the story below is a bit long.
I made it when investigating any possible difference between Dos 5.0 and
Dos 7.x.

--

Eric P. van Westendorp Tel: +31(0252)210579
Reigerslaan 22 2215NN Voorhout Netherlands

The Volume Serial Number appeared first in MS-Dos 5.0 (Not counting 4.x)
It is used by MS-Dos to identify removable media.

In Windows 95/98 Volume Tracking is used instead, unless the removable
media
is write protected or Volume Tracking has been switched off in the
Registry.
Volume Tracking writes a different string to the OEM field in the
bootsector
each session of Windows.
Identification of removable media is therefore much more reliable with
Volume
Tracking than using the Volume Serial Number.

A VSN is generated by Format.COM and DiskCopy.Com from Dos date and Dos
time.
It is a double word (4 bytes) value stored in reverse notation on disk.
The VSN is stored in the bootsector.

The routines used to generate a VSN stayed the same from Dos 5.0 - Dos
7.1

Routines in Format.Com and DiskCopy differ slightly.
Compared with Format.COM the High and Low word have changed place
Format: [Seconds/Hundredth] + [Month/Day of mo] = High word of VSN
[Hour/Minutes] + [Year] = Low word of VSN
DiskCopy: [Seconds/Hundredth] + [Month/Day of mo] = Low word of VSN
[Hour/Minutes] + [Year] = High word of VSN

Create Volume Serial Number
Dos 5.0 Format.Com
0DA4:4B84 B42A MOV AH,2A ;Get date
0DA4:4B86 CD21 INT 21
0DA4:4B88 51 PUSH CX ;Year
0DA4:4B89 52 PUSH DX ;DH=month, DL=day of month
0DA4:4B8A B42C MOV AH,2C ;Get time
0DA4:4B8C CD21 INT 21
0DA4:4B8E 8BC2 MOV AX,DX ;AH=seconds, AL=hundredths/sec
0DA4:4B90 5A POP DX ;DH=month, DL=day of month
0DA4:4B91 03C2 ADD AX,DX ;Get High word of VSN
0DA4:4B93 A3A815 MOV [15A8],AX
0DA4:4B96 A37E0F MOV [0F7E],AX
0DA4:4B99 8BC1 MOV AX,CX ;AH=hour, AL=minutes
0DA4:4B9B 59 POP CX ;Year
0DA4:4B9C 03C1 ADD AX,CX ;Get Low word of VSN
0DA4:4B9E A3A615 MOV [15A6],AX
0DA4:4BA1 A3800F MOV [0F80],AX
0DA4:4BA4 C3 RET

Dos 7.1 Format.Com (Windows 98)
0DA7:83E4 B42A MOV AH,2A ;Get date
0DA7:83E6 CD21 INT 21
0DA7:83E8 51 PUSH CX ;Year
0DA7:83E9 52 PUSH DX ;DH=month, DL=day of month
0DA7:83EA B42C MOV AH,2C ;Get time
0DA7:83EC CD21 INT 21
0DA7:83EE 8BC2 MOV AX,DX ;AH=seconds, AL=hundredths/sec
0DA7:83F0 5A POP DX ;DH=month, DL=day of month
0DA7:83F1 03C2 ADD AX,DX ;Get High word of VSN
0DA7:83F3 A3014B MOV [4B01],AX
0DA7:83F6 A3C632 MOV [32C6],AX
0DA7:83F9 8BC1 MOV AX,CX ;AH=hour, AL=minutes
0DA7:83FB 59 POP CX ;Year
0DA7:83FC 03C1 ADD AX,CX ;Get Low word of VSN
0DA7:83FE A3FF4A MOV [4AFF],AX
0DA7:8401 A3C832 MOV [32C8],AX
0DA7:8404 C3 RET

Dos 5.0 DiskCopy.Com
0DA4:0B21 B42A MOV AH,2A ;Get date
0DA4:0B23 CD21 INT 21
0DA4:0B25 51 PUSH CX ;Year
0DA4:0B26 52 PUSH DX ;DH=month, DL=day of month
0DA4:0B27 B42C MOV AH,2C ;Get time
0DA4:0B29 CD21 INT 21 ;DH=seconds, DL=hundredths/sec
0DA4:0B2B 58 POP AX ;AH=month, AL=day of month
0DA4:0B2C 03C2 ADD AX,DX ;Get Low word of VSN
0DA4:0B2E A35603 MOV [0356],AX
0DA4:0B31 26 ES:
0DA4:0B32 894727 MOV [BX+27],AX
0DA4:0B35 58 POP AX ;Year
0DA4:0B36 03C1 ADD AX,CX ;CH=hour, CL=minutes
0DA4:0B38 A35803 MOV [0358],AX ;Hi word of VSN
0DA4:0B3B 26 ES:
0DA4:0B3C 894729 MOV [BX+29],AX
0DA4:0B3F C606550301 MOV BYTE PTR [0355],01
0DA4:0B44 5E POP SI
0DA4:0B45 5B POP BX
0DA4:0B46 07 POP ES
0DA4:0B47 C3 RET

Dos 7.1 DiskCopy.Com (Windows 98)
0DA7:0B7E B42A MOV AH,2A ;Get date
0DA7:0B80 CD21 INT 21
0DA7:0B82 51 PUSH CX ;Year
0DA7:0B83 52 PUSH DX ;DH=month, DL=day of month
0DA7:0B84 B42C MOV AH,2C ;Get time
0DA7:0B86 CD21 INT 21 ;DH=seconds, DL=hundredths/sec
0DA7:0B88 58 POP AX ;AH=month, AL=day of month
0DA7:0B89 03C2 ADD AX,DX ;Get Low word of VSN
0DA7:0B8B A35703 MOV [0357],AX
0DA7:0B8E 26 ES:
0DA7:0B8F 894727 MOV [BX+27],AX
0DA7:0B92 58 POP AX ;Year
0DA7:0B93 03C1 ADD AX,CX ;CH=hour, CL=minutes
0DA7:0B95 A35903 MOV [0359],AX ;Hi word of VSN
0DA7:0B98 26 ES:
0DA7:0B99 894729 MOV [BX+29],AX
0DA7:0B9C C606560301 MOV BYTE PTR [0356],01
0DA7:0BA1 5E POP SI
0DA7:0BA2 5B POP BX
0DA7:0BA3 07 POP ES
0DA7:0BA4 C3 RET

Pmadar

unread,
Oct 19, 1999, 3:00:00 AM10/19/99
to
Eric:
This is perfect. I will get to work on our problem using this information
and see if I can duplicate the win95/98 serial numbers we're seeing on the
discs. Thanks for your help!

Piero

E.P. van Westendorp <E.P.vanW...@net.HCC.nl> wrote in message
news:380CB763...@net.HCC.nl...

Pmadar

unread,
Oct 19, 1999, 3:00:00 AM10/19/99
to
Hi Eric:
In the case of write-protected media (e.g. CD audio) where Win cannot use
volume tracking to write to the OEM field, do you know how the VSN is
determined in this case?

E.P. van Westendorp <E.P.vanW...@net.HCC.nl> wrote in message
news:380CB763...@net.HCC.nl...

E.P. van Westendorp

unread,
Oct 19, 1999, 3:00:00 AM10/19/99
to
No, I don't know.
There is info about "Volume Tracking" in the MS Knowlege Base.
Amongst others how to disable it.
It's disabled by default for some disks. (Registry)
You can add others.

--

Eric P. van Westendorp Tel: +31(0252)210579
Reigerslaan 22 2215NN Voorhout Netherlands

0 new messages