[SOLVED] IDENTIFY OK, supports LBA48 but total LBA48 == 0
[SOLVED] IDENTIFY OK, supports LBA48 but total LBA48 == 0
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.
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.
Last edited by HugeCode on Sat Jun 29, 2013 2:08 am, edited 1 time in total.
Re: IDENTIFY OK, supports LBA48 but total LBA48 == 0
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?
????????????????????
My disk has 1GB. What are these values?
Re: IDENTIFY OK, supports LBA48 but total LBA48 == 0
Yes, but why I have LBA48 avaible, but total LBA48 field is zero? And why is there difference of 512*512=256KB?
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: IDENTIFY OK, supports LBA48 but total LBA48 == 0
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
And LBA48 supported but count zero?
Re: IDENTIFY OK, supports LBA48 but total LBA48 == 0
After a long time, I maybe found out what was the problem.
- I forgot on operator priority and used bitwise & so it returned 0.
- 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...