I needed to recover the partition table I deleted accidentally. I used an application named [TestDisk](http://www.cgsecurity.org/wiki/TestDisk). Its simply mind blowing. I reads each cylinder from the disk. I've seen similar such applications which work with MBR & partitioning.

I'm curious.

> 
> How do they read
>  clusters/cylinders/sectors from the
>  disk? Is there some kind of API for this?
> 
> 
> 

Is it again OS dependent? If so whats the way to for Linux & for windows?

**EDIT:**
Well, I'm not just curious I want a hands on experience. I want to write a simple application which displays each LBA.