summaryrefslogtreecommitdiffstats
path: root/src/intrf.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/intrf.c
parentcc3bc11be8d37123b2165510fe510c8ca5944385 (diff)
Store disk geometry in cylinders/heads_per_cylinder/sectors_per_head instead of CHS
Diffstat (limited to 'src/intrf.c')
-rw-r--r--src/intrf.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/intrf.c b/src/intrf.c
index 8deb21e..0c4b06b 100644
--- a/src/intrf.c
+++ b/src/intrf.c
@@ -1061,12 +1061,12 @@ void aff_LBA2CHS(const disk_t *disk_car, const unsigned long int pos_LBA)
{
unsigned long int tmp;
unsigned long int cylinder, head, sector;
- tmp=disk_car->CHS.sector;
+ tmp=disk_car->geom.sectors_per_head;
sector=(pos_LBA%tmp)+1;
tmp=pos_LBA/tmp;
- cylinder=tmp/(disk_car->CHS.head+1);
- head=tmp%(disk_car->CHS.head+1);
- wprintw(stdscr,"%lu/%lu/%lu", cylinder,head,sector);
+ cylinder=tmp / disk_car->geom.heads_per_cylinder;
+ head=tmp % disk_car->geom.heads_per_cylinder;
+ wprintw(stdscr, "%lu/%lu/%lu", cylinder, head, sector);
}
int ask_YN(WINDOW *window)
@@ -1963,12 +1963,12 @@ void log_CHS_from_LBA(const disk_t *disk_car, const unsigned long int pos_LBA)
{
unsigned long int tmp;
unsigned long int cylinder, head, sector;
- tmp=disk_car->CHS.sector;
+ tmp=disk_car->geom.sectors_per_head;
sector=(pos_LBA%tmp)+1;
tmp=pos_LBA/tmp;
- cylinder=tmp/(disk_car->CHS.head+1);
- head=tmp%(disk_car->CHS.head+1);
- log_info("%lu/%lu/%lu", cylinder,head,sector);
+ cylinder=tmp / disk_car->geom.heads_per_cylinder;
+ head=tmp % disk_car->geom.heads_per_cylinder;
+ log_info("%lu/%lu/%lu", cylinder, head, sector);
}
int display_message(const char*msg)