From: Nate Eldredge Newsgroups: comp.games.development.programming.misc,comp.os.msdos.djgpp Subject: Re: Disk Serial Numbers Date: Wed, 27 Oct 1999 13:31:35 -0700 Organization: Harvey Mudd College Lines: 25 Message-ID: <38176127.2C870165@hmc.edu> References: <7v7lar$aa1$1 AT news8 DOT svr DOT pol DOT co DOT uk> NNTP-Posting-Host: mercury.st.hmc.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: nntp1.interworld.net 941056342 50795 134.173.45.219 (27 Oct 1999 20:32:22 GMT) X-Complaints-To: usenet AT nntp1 DOT interworld DOT net NNTP-Posting-Date: 27 Oct 1999 20:32:22 GMT X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.2.13pre12 i586) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Ben Davis wrote: > > This may be slightly off topic, but please bear with me... > > I have noticed that some floppy disks have serial numbers; the serial number > appears when I type 'dir/w'. Can someone confirm that the serial number of a > floppy disk cannot be changed through software (if at all) No, this is not true. The serial number is written to the disk when it's formatted (I believe it's stored in the boot sector) and so can be modified at will. (Assuming the disk is writable.) >, and explain how > to write a program which reads it? (After all, 'dir' does it, so it must be > possible.) > If there is a DJGPP function to do this, I would like to know. Otherwise I > will use whatever low-level DOS Interrupts or whatever are necessary. According to Ralf Brown's interrupt list, there's an IOCTL function to do this. Looks like INT 21h / AX=440Dh / minor code (in CL) = 0x66h. In DJGPP you can use ioctl(drive_no, DOS_GENBLKREQ, ...). -- Nate Eldredge neldredge AT hmc DOT edu