/* relative sectors Number of Partition */
relative_sec=*(long *)(buffer+454+i*16);
no_sectors=*(long *)(buffer+458+i*16); /* number of
sectors in
partition*/
sectors_part[*no_par]=no_sectors; /* Array to store
Number of
sectors of
partitions */
*sec=star_sec[*no_par]=relative_sec;
(*no_par)++;
}
} //loop close of for(i=0;i<4;i++)
} //loop close of if(*sec==0)
return;
}
Comments on coding:
The function starts reading the partitions information from the MBR and then reads the Extended MBRs if required. The function readabsolutesectors reads the absolute sector, specified by *sec.
sectors_part[*no_par] is the array to store the number of sectors of partitions. The partition number is specified by *no_par starting from 0.
no_sectors is the number of sectors in partition and relative_sec is the relative sector number for that partition.
star_sec[*no_par] is the array to store the stating sector numbers of partitions. The partition number is specified by *no_par starting from 0.
star_cyl, star_hea and star_sec are the arrays which keep the information of starting of each partition in terms of CHS. star_cyl stores the information of starting cylinders, star_hea stores the information of starting heads and star_sec stores the information of starting sectors of partitions.
For the description of readabsolutesectors function refer the chapters given earlier in this book.
|