Mail Archives: djgpp/2005/07/13/04:47:04
On Tue, 12 Jul 2005, Jack Klein wrote:
> On 12 Jul 2005 13:22:11 -0700, "arizvi" <ahmadwaris AT hotmail DOT com> wrote
> in comp.os.msdos.programmer:
>
> > Hi everyone,
> >
> > I am trying to create a copy-protected floppy for distributing my
> > application. I searched online and decided on bit-counting as perhaps
> > the best way for me to implement copy protection. A description of bit
> > counting is given below:
> >
> > "Two disk drives do not turn at precisely the same speed. Even the same
> > disk has small variations in its speed. When a disk is formatted, there
> > is some empty space remaining on each track between the end of the last
> > sector and the beginning of the first sector. The formatting program
> > fills this space with meaningless bits. The size of the space (the
> > number of bits), and therefore the total number of bits on the track,
> > depends on the rotational speed of the disk drive. If the bits are
> > counted, and the count is recorded somewhere else in the disk, the
> > software can find if the disk is original or copied and can bail out."
> >
> > However, I dont know how to implement this feature. If I use bios calls
> > to read a sector, I believe that I will read exactly 512 bytes or the
> > size of a standard sector. This will defeat my attempt to find the
> > exact # of bits on a track.
> >
> > Is there some code to get at the number of bits directly from the
> > floppy drive controller? Or can I somehow use the standard bios calls
> > to read the number of bits?
> >
> > Any help will be appreciated.
> > Thanks,
> > Ahmad Rizvi
>
> If I remember correctly, you can't really do this with the floppy disk
> controller in a PC. Of course, I may not remember right, it's at
> least 20+ years ago that I was interested in directly talking to the
> floppy disk controller in a PC.
>
> Before the original IBM PC, most microcomputers used a floppy
> controller from Western Digital. The PC used a newer chip, made by
> NEC. [...]
The NEC µPD765.
> [...] The NEC chip had a lot fewer features/functions than the WD had.
> One of the things that the NEC chip did not have was the ability to
> read or write an entire track is a raw data stream.
>
> Again, I could be wrong, but I do not think that there is any way at
> all to read, write, or even count the number of bits in between
> formatted sectors with the PC disk controller.
The NEC chip did/does have a command for reading a track but I think it
just reads the data within sectors and not the raw bits. Some
programming details:
"ClipX - Hardware - nec .pd765 - floppy disk controller - 8272a"
http://www.clipx.net/ng/hardware/ng96a4.php
"Programming the NEC µPD765 and Intel 82072/7 Floppy Disk Controller"
http://www.isdaman.com/alsos/hardware/fdc/floppy.htm
"The OS Journal - Programming Floppy Disk Controllers"
http://www.cyberscriptorium.com/osjournal/cgi-bin/index.pl?action=viewfile&file=9
"Floppy Index"
http://ohlandl.kev009.com/floppy/floppy_index.html
"uPD765.pdf"
http://ohlandl.kev009.com/floppy/uPD765.pdf
--
Can you Change: N O V A Halifax to N O V A Halifax *
* S C O T I A . S C O T I A .
in 34 moves? (*==Lobster) http://www.chebucto.ns.ca/~af380/JSNSPuz.html
(Requires a browser supporting the W3C DOM such as Firefox or IE ver 6)
- Raw text -