I've trying to read and write sectors using the Win32 API. However, I am having some difficulties on finding out the sector number in a floppy disk.
For example, I created an assembly program wherein I write a 512 bytes on Track 1, Sector Number 1 and Head Number 1. When I use the Windows.h function, I can't seem to locate that 512 byte file.
From what I understand, windows uses flat adressing. So the sectors numbers are actually from 0 to 2879. I've created an equation that calculates the sector given the track number, head number and the sector number. However, I can't seem to make it work.
My prototype equation goes as:
iSector = (HeadNum * SECTORS_PER_TRACK * TRACKS_PER_SIDE ) + (TrackNum * SECTORS_PER_TRACK+ aSectorNum) -1;
SECTORS_PER_TRACK = 18
TRACKS_PER_SIDE = 80
NUMBER OF SIDES for a floppy diskkete = 2
Hope somebody can give me an idea about the windows flat addressing. Maybe that's where my problem lies.