/*改变参数对比功能*/
Recover_with_values()
{
int val =0;
/* 跳码为300字节软 */
b.code[0] = 0xEB;
b.code[1]= 0x3E;
b.code[2]= 0x90 ;
/* 系统编号800字节 */
strcpy(b.system_id, "+05PSIHC");
/* 每界字节 = 512 */
b.bytes_per_sec = 512;
/* 每簇为3.51.44m部门"软 = 1 */
b.sec_per_clus = 1;
/* 一些部门预留 = 1 */
b.res_sec =1;
/* 一些发副本 = 2 */
b.fat_copies =2;
/* 入境人数根目录 = 224 */
b.root_dir_entry =224;
/* 一些部门对盘 = 2880 */
b.no_sects =2880;
/*媒体描述字节为软 = F0 (H) */
b.format_id =0xF0;
/* 每发行业 = 9 */
b.sec_per_fat =9;
/* 每个部门跟踪 = 18 */
b.sec_per_trk =18;
/* 双方人数 = 2 */
b.no_sides =2;
/* 预留一些特殊行业(部门或隐性) = 0 */
b.no_sp_res_sect =0;
/* 使用软盘*/
val = abswrite ( 0, 1, 0, &b ) ;
if ( val == -1 )
{
printf ( "\n Disk Write Error...bad sector\n" ) ;
printf ( " Disk was not Recovered." ) ;
exit ( 1 ) ;
}
return 0;
}
display_info()
{
printf ( "\n Jump Code (Hex) = %X%X%X (H)\n",
b.code[0],b.code[1],b.code[2]);
printf ( " System ID = %s\n",
b.system_id ) ;
printf ( " Bytes per sector = %d\n",
b.bytes_per_sec ) ;
printf ( " Sectors per cluster = %d\n",
b.sec_per_clus ) ;
printf ( " Reserved sectors = %d\n",
b.res_sec ) ;
printf ( " FAT copies = %d\n",
b.fat_copies ) ;
printf ( " Root directory entries = %d\n",
b.root_dir_entry ) ;
printf ( " No. of sectors on disk = %u\n",
b.no_sects ) ;
printf ( " Media Descriptor Byte = %X\n",
b.format_id ) ;
printf ( " Sectors per FAT = %d\n",
b.sec_per_fat ) ;
printf ( " Sectors per track = %d\n",
b.sec_per_trk ) ;
printf ( " No. of sides = %d\n",
b.no_sides ) ;
printf ( " No. of reserved sectors = %d\n",
b.no_sp_res_sect ) ;
return 0;
}
评论代码:
结构长靴用来进入布拉格反射,读写磁盘的参数.display_info()功能,显示器的各种参数盘,读来自布拉格反射.recover_with_values()功能是用来改变参数布拉格反射回软的.
用价值功能recover_with_values()、参数为1.44mb,3½英寸软盘的布拉格反射. 描写这些价值观已经在桌上给下一:
Value价值 |
Description描述 |
b.code[0] = 0xEB ;b.code〔0〕=0xeb;
b.code[1] = 0x3E ;b.code[1]=0x3e;
b.code[2] = 0x90 ;b.code[2]=0x90; |
Jump Code of 3
Bytes For specified Floppy, has been given EB 3E
90 (H)典试跳3字节软,已束第3E90(八) |
strcpy(b.system_id," +05PSIHC ");strcpy(b.system_id"05psihc"); |
System Id of 8
Bytes.系统编号800字节. It is
calculated with current date and time of the system,
however almost anything
works.据计算,目前该系统的日期和时间,但是几乎什么作品. |
b.bytes_per_sec
= 512 ;b.bytes_per_sec=512; |
Bytes Per
Sector = 512每界=512字节 |
b.sec_per_clus
= 1 ; b.sec_per_clus=1; |
Number of
Sectors per Cluster for 1.44M 3.5" Floppy is 1一些部门为1.44m350元簇"软1 |
b.res_sec = 1 ;b.res_sec=1; |
Number of
Reserved Sectors = 1一些部门预留=1 |
b.fat_copies
= 2 ;b.fat_copies=2; |
Number of FAT
Copies = 2一些发份=2 |
b.root_dir_entry
= 224 ;b.root_dir_entry=224; |
Number of Root
Directory Entries for the specified floppy disk = 224参赛人数为根目录指定软磁盘=224 |
b.no_sects
= 2880 ;b.no_sects=2880; |
Number of
Sectors on Disk = 2880一些部门对盘=2880 |
b.format_id = 0xF0 ;b.format_id=0xf0; |
Media
Descriptor Byte For the specified Floppy = F0 (H)媒体描述字节为指定软=磁浮(八) |
b.sec_per_fat = 9 ;b.sec_per_fat=9; |
Number of
Sectors Per FAT = 9一些部门每发=9 |
b.sec_per_trk = 18 ;b.sec_per_trk=18; |
Number of
Sectors Per Track = 18=18多个行业,每轨道 |
b.no_sides
= 2 ;b.no_sides=2; |
Number of Sides
= 2双方人数=2 |
b.no_sp_res_sect
= 0 ;b.no_sp_res_sect=0; |
Number of
Special Reserved Sectors (or Hidden Sectors) = 0预留一些特殊行业(部门或隐性)=0 |
|
|
|
|