📄 format.h
字号:
#ifndef _FORMAT_H
#define _FORMAT_H
class format
{
private:
};
int main(int argc,char *argv[])
{
struct partition_entry
{
start_of_partition_in_CHS;
end_of_partition_in_CHS;
}p[4];
if(argc !=2)
{
printf("Usage format [drive:]\n");
exit(0);
}
char *drive = argv[1]; //1-c:\; 2-d:\...
struct tab
{
char *drv;
int num;
}arr[4]={{"c",0},{"d",1},{"e",2},{"f",3}};
for(int i=0;i<4;i++)
{
if(drive == arr[i].drv)
{
drv_no = arr[i].num;
}
}
read_MBR_partitions(&p[0]);
struct part = p[drv_num];
int start = part.start_of_partition_in_CHS;
int end = part.end_of_partition_in_CHS;
calculate(hidden_sect,total_sect,FAT_sect);
write(boot.com);
modify(hidden_sect,total_sect,FAT_sect);
construct_FAT(total_sect);
set_volID();
set_vollabel();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -