La codificazione del programma è stata data dopo:
/* Programma per fare l'immagine del primo disco rigido (0x80) al secondo disco rigido (0x81) */
#include<stdio.h>
#include<dos.h>
#include<conio.h>
/* Struttura da usare dalla funzione getdrivegeometry usando 13H estensione INTERNA, numero 0x48 di funzione. */
struct geometry
{
unsigned int size ; /* (call) size of Buffer */
unsigned int flags ; /* Information Flags */
unsigned long cyl ; /* Number of Physical
Cylinders on Drive */
unsigned long heads ;/* Number of Physical
Heads on Drive */
unsigned long spt ; /* Number of Physical
Sectors Per Track */
unsigned long sectors[2] ; /* Total Number of
Sectors on Drive */
unsigned int bps ; /* Bytes Per Sector */
} ;
/* Struttura della disposizione del pacchetto di indirizzo di disc, essere usato dalle funzioni, dai readabsolutesectors e dai writeabsolutesectors */
struct diskaddrpacket
{
char packetsize ; /* Size of Packet, generally 10H */
char reserved ; /* Reserved (0) */
int blockcount ; /* Number of Blocks to Transfer */
char far *bufferaddress ; /* address to Transfer
Buffer */
unsigned long blocknumber[2] ; /* Starting Absolute
Block Number */
} ;
|