///// ドライブ変数を得る機能 \\\\\
unsigned long getdrivegeometry (int drive)
{
union REGS i, o ;
struct SREGS s ;
struct geometry g = { 26, 0, 0, 0, 0, 0, 0, 0 } ;
i.h.ah = 0x48 ; /* INT 13H延長の機能数0x48はコメントを次に見る */
i.h.dl = drive; /* ドライブ数 */
i.x.si = FP_OFF ( (void far*)&g ) ;
s.ds = FP_SEG ( (void far*)&g ) ;
/* 区分の記録の価値のINT 13H延長の指定機能数を実施しなさい */
int86x ( 0x13, &i, &o, &s ) ;
printf("\n Head = %lu, Sectors Per Track = %lu, Cylinder =
%lu\n", g.heads, g.spt, g.cyl);
/* ドライブ幾何学機能失敗を得なさい、エラーメッセージを表示し、出なさい */
if(g.spt==0)
{
printf("\n Get Drive Geometry Function Fails....");
printf("\n Extensions Not Supported, Press any Key to
Exit...");
getch();
exit(1);
}
return *g.sectors; /* ドライブのセクターの数を戻しなさい */
}
////// 本管の開始 \\\\\\
void main()
{
unsigned long loop=0, Sectors_in_HDD1=0, Sectors_in_HDD2=0;
unsigned char buffer[61440]; /* 読み書きへの61440バイトのデータバッファ時間を節約する512バイトの120のセクター一度に。*/
char choice;
clrscr();
|