in the OS series, in http://www.brokenthorn.com/Resources/OSDev6.html, and in the comments in the downloadable source code, the following is written about converting an LBA address to a CHS one:
after spending 2 weeks trying to find out why my bootloader wasn't working, I found that the formula for Absolute Sector should beabsolute sector = (logical sector / sectors per track) + 1
absolute head = (logical sector / sectors per track) MOD number of heads
absolute track = logical sector / (sectors per track * number of heads)
The actual source code itself in the download is correct but the comment is the same as above.absolute sector = (logical sector MOD sectors per track) + 1
The reason I got so stuck on this is because, rightly or wrongly, I dont copy source code - I try to write it myself so I fully understand what is going on (I still have much to learn about assembly).
Anyway, I hope you dont mind a constructive criticism.