Mail Archives: djgpp/2005/07/12/22:30:32
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 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.
--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
- Raw text -