Read/Write from/to 1024 Bytes sector (Floppy Disk)

miladyyy
miladyyy used Ask the Experts™
on
Dear
  I want to read on 1024/2048/... bytes sectors on floppy disk.what can i do ?  
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
I want to format just one sector of floppy disk in 1024/2048 bytes in Windows 2000/NT/XP and i want to read from or write to it.but i do not know what i can do.please guide me to do that.

Thank you in advance for your response

======================================
   Yours Sincerely
      Milad
Commented:
Windows 2000 can see floppies of nonstandard formats. But
it will not read or write to the sectors of the floppy that are not in the standard format. I have tried floppies with a 1.76M format. Windows sees it as a 1.76M but will only write 1.44M. I think the only way to do what you want is to rewrite the floppy driver, and that is a big job.
But this is possibe in dos.
Here is a piece of code from floppy.c from the Device Driver Kit.

switch ( fDeviceData->MaxDensity ) {

 case 360:   driveType = DRIVE_TYPE_0360;    break;
 case 1200:  driveType = DRIVE_TYPE_1200;    break;
 case 1185:  driveType = DRIVE_TYPE_1200;    break;
 case 1423:  driveType = DRIVE_TYPE_1440;    break;
 case 1440:  driveType = DRIVE_TYPE_1440;    break;
 case 2880:  driveType = DRIVE_TYPE_2880;    break;
 case 1201:if (IsNEC_98) {driveType=DRIVE_TYPE_1200_E;       break;
    } // (IsNEC_98)
 default:
   FloppyDump( FLOPDBGP, ("Floppy: Bad DriveCapacity!\n"
       "------  density is %d\n",fDeviceData->MaxDensity));

  driveType = DRIVE_TYPE_1200;
  FloppyDump( FLOPDBGP,("Floppy: run a setup program to  set the floppy\n" "------  drive type; assuming 1.2mb\n"
  "------  (type is %x)\n",fDeviceData->MaxDensity)
                        );
                    break;
  }
It seems that an old 720k diskette is treated as a 1.44M but only 9 sectors per track is written.
Hey buy a good Assembly Language book for Intel Processors like IBM PC Assembly Language and Programming by Peter Abel
and
8085/86,286, 386, 486, Pentium - I, Pentium - II
by Barrey B. Brey

You will find all BIOS services and interrrupt list to access different devices of system, DMA, Direct disk access and using these services and various parameters you can write a peice of code in C

Commented:
int 13h

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial