summaryrefslogtreecommitdiffstats
path: root/src/fat_adv.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2008-07-18 22:16:08 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2008-07-18 22:16:08 +0200
commit8585ef8e51b492783c7d4a3125beeacac1d4314a (patch)
treeec8cbc98265f903e2ca2063b78f93eb3c358ad23 /src/fat_adv.c
parentcc3bc11be8d37123b2165510fe510c8ca5944385 (diff)
Store disk geometry in cylinders/heads_per_cylinder/sectors_per_head instead of CHS
Diffstat (limited to 'src/fat_adv.c')
-rw-r--r--src/fat_adv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fat_adv.c b/src/fat_adv.c
index 92944fd..345d901 100644
--- a/src/fat_adv.c
+++ b/src/fat_adv.c
@@ -1068,8 +1068,8 @@ static void create_fat_boot_sector(disk_t *disk_car, partition_t *partition, con
fat_header->sector_size[1]=disk_car->sector_size >>8;
fat_header->fats=fats;
fat_header->media=0xF8;
- fat_header->secs_track=le16(disk_car->CHS.sector);
- fat_header->heads=le16(disk_car->CHS.head+1);
+ fat_header->secs_track=le16(disk_car->geom.sectors_per_head);
+ fat_header->heads=le16(disk_car->geom.heads_per_cylinder);
fat_header->marker=le16(0xAA55);
if(!((fat_header->ignored[0]==0xeb&&fat_header->ignored[2]==0x90)||fat_header->ignored[0]==0xe9))
{
@@ -1085,7 +1085,7 @@ static void create_fat_boot_sector(disk_t *disk_car, partition_t *partition, con
memcpy(fat_header->system_id,"MSWIN4.1",8);
/* FIXME, need to know where the extended or logical partition start */
if(partition->status==STATUS_LOG)
- fat_header->hidden=le32(disk_car->CHS.sector);
+ fat_header->hidden=le32(disk_car->geom.sectors_per_head);
else
fat_header->hidden=le32((partition->part_offset/disk_car->sector_size));
fat_header->sectors_per_cluster=sectors_per_cluster;