Page 1 of 1

[SOLVED] IDENTIFY OK, supports LBA48 but total LBA48 == 0

Posted: Sat Apr 06, 2013 5:38 am
by HugeCode
Hi all. I'm currently trying to get LBA working, but I have problem.
My IDENTIFY function returns OK and word 83;bit 10 is set, so my device supports LBA48. But when I try to get total amount of LBA48 sectors (configuration words 100-103), it gives my zero. In virtual machine I have 1GB disk set (192KB used) but this field is still zero. I also tried to get amount of LBA28 sectors, but it returns me crazy value.

Does anybody know what am I doing wrong? Is there any other way for getting the size of HDD? Please help.

Re: IDENTIFY OK, supports LBA48 but total LBA48 == 0

Posted: Sat Apr 06, 2013 6:50 am
by HugeCode
Another interesting thing is that when I print out heads*cylinders*sectors_per_track, the value is almost same as value of total LBA28 sectors located on words 60-61. It's 2097152 for total LBA28 and 2096640 for h*c*s. Difference of these two values is 512.

????????????????????

My disk has 1GB. What are these values?

Re: IDENTIFY OK, supports LBA48 but total LBA48 == 0

Posted: Sun Apr 07, 2013 2:09 am
by dozniak
2097152*512 == 1GB

Re: IDENTIFY OK, supports LBA48 but total LBA48 == 0

Posted: Sun Apr 07, 2013 3:58 am
by HugeCode
Yes, but why I have LBA48 avaible, but total LBA48 field is zero? And why is there difference of 512*512=256KB?

Re: IDENTIFY OK, supports LBA48 but total LBA48 == 0

Posted: Sun Apr 07, 2013 6:46 am
by Combuster
the numbers correspond to 512 * 4096 and 512 * 4095, i.e. you probably have an off-by-one error in your CHS code.

Re: IDENTIFY OK, supports LBA48 but total LBA48 == 0

Posted: Sun Apr 07, 2013 8:48 am
by HugeCode
And LBA48 supported but count zero?

Re: IDENTIFY OK, supports LBA48 but total LBA48 == 0

Posted: Sun Apr 07, 2013 9:32 am
by Combuster
Echo-o-o.

Re: IDENTIFY OK, supports LBA48 but total LBA48 == 0

Posted: Sun Apr 07, 2013 10:09 am
by HugeCode
Hmm???

Re: IDENTIFY OK, supports LBA48 but total LBA48 == 0

Posted: Mon Apr 08, 2013 12:53 am
by dozniak
Lol.

Re: IDENTIFY OK, supports LBA48 but total LBA48 == 0

Posted: Sun Jun 16, 2013 4:52 am
by HugeCode
After a long time, I maybe found out what was the problem.
  1. I forgot on operator priority and used bitwise & so it returned 0.
  2. My CHS used number of sectors, but sectors begin on 1 (not 0). I don't think it is really my fault. It looks like VirtualBox counts also with sector 0...