reading heads beyond 16

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
pulsar
Member
Member
Posts: 49
Joined: Wed Nov 22, 2006 1:01 am
Location: chennai

reading heads beyond 16

Post by pulsar »

I'm once again having trouble with ata driver. how will you access sectors beyond
head > 16. In drive/head register 0x1f6, you can specify a maximum of 16 heads. how to read beyond that because in my hard disk there are 255 heads ?
everyone here are best programmers ( not yet not yet)
Mikae
Member
Member
Posts: 94
Joined: Sun Jul 30, 2006 1:08 pm

Post by Mikae »

I think, that you mixed up BIOS address translations and direct access to drive. Really ATA standart defines, that number of head should be representable by four bits (it means, it is possible to address only 16 heads), number of cylinders by 16 bits and number of sectors by 8 bits. BIOS developers (cause of unknown reasons) decided to implement calls to HD using 10 bits for cylinder, 5 bits for sector and 8 bits for head. Therefore four high bits of head number was not used. Such implemetation allows to address hard drives not more than 512 MiB only. After some perturbations BIOS developers implemented so called 'address translation', which involves four high bits of head number, but really BIOS software divides number of head by a number and mutiplies number of cylinder on that number. It allows to overcome limit of '10 bits for cylinder' staying in limits of ATA standard (4 bits for head). Modern BIOSes allow to use LBA calls, which have much more convenient limits (2^64 sectors).

Anyway, if you use direct call to ATA interface you can to not bother with CHS addressing (which is left for compatibility), but use LBA addressing.
User avatar
pulsar
Member
Member
Posts: 49
Joined: Wed Nov 22, 2006 1:01 am
Location: chennai

Post by pulsar »

Bios has nothing to do with this. In http://my.execpc.com/~geezer/osd/disks/index.htm, it says that the limit for ata hardware interface is 65536 cylinders, 16 heads and 63 sectors. So if i want to access all the sectors in my hard drive, what should i do? How will you do an LBA call?
I'm completely lost here. Most of the documents i'm having just list the register descriptions and the ata commands and i never came across lba calling.
http://www.nondot.org/sabre/os/files/Disk/IDE-tech.html. this is the document i followed
everyone here are best programmers ( not yet not yet)
octavio
Member
Member
Posts: 94
Joined: Wed Oct 25, 2006 5:12 am
Location: Barcelona España
Contact:

Post by octavio »

Post Reply