/* Destination should not be smaller than the Source */
if(Sectors_in_HDD2<Sectors_in_HDD1)
{
printf("\n\n Destination Disk should not be Smaller
than Source Disk");
printf("\n Press any Key to Exit...");
getch();
exit(0);
}
/* If Everything is okay, copy All the Sectors of the
Source Disk to Destination Hard Disk */
gotoxy(10,15);printf("Copying Absolute Sector: ");
for(loop=0;loop<=Sectors_in_HDD1;loop=loop+120)
{
readabsolutesectors ( 0x80, loop, 120, buffer );
writeabsolutesectors ( 0x81, loop, 120, buffer );
gotoxy(36,15); printf("%ld",loop);
if(kbhit())
{
exit(0);
}
}
//// Show the Message of Completion \\\
printf("\n\n Disk Imaging is Now Completed, Press any Key
To Exit...");
getch();
} //// End of main
Comments on Coding:
In the coding of the program given earlier, for disk Imaging We are proceeding by performing the Following tasks:
- The Structure, geometry is used by getdrivegeometry function using INT 13H Extension, Function Number 0x48. For a Detailed description on INT 13H Extensions, refer the chapter “Handling large hard disks”, Discussed earlier in this book.
|