int 13/AH=02

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
MWM

int 13/AH=02

Post by MWM »

This question concerns loading sectors from disk via int 13/AH=02.  My problem is that the register cl, which holds the value of the sector to be load into memory only allows  values in the range 0-63.  If I would like to load sector 100 from the disk into memory how would i go about doing this?  My guess is that I would use CHS translation to load the desired  sector.  If this is correct could someone please explain to me with an example how  i would use this method to obtain the correct sector.   If not please let me know how this could me done.

thank you
MWM
Tom Fritz

RE:int 13/AH=02

Post by Tom Fritz »

what about using different heads?
carbonBased

RE:int 13/AH=02

Post by carbonBased »

cylinder = LBA / (heads_per_cylinder * sectors_per_track)
    temp = LBA % (heads_per_cylinder * sectors_per_track)
    head = temp / sectors_per_track
  sector = temp % sectors_per_track + 1

LBA = logical/large block access, ie. your 32-bit sector number

You'll have to get the drive parameters from the IDE controller, or a BIOS call (unless you know them before hand, perhaps; like a 1.44mb floppy)

PS: That's the _FIRST_ link that pops up on a search for CHS translation (your own words!) on Google.  Did you even try to find this info yourself?

Jeff
Post Reply