I am creating a basic MBR that reads the Partition Table and loads the first sector of the Bootable Partition. I am confused by the CHS and LBA addressing modes. I read in a tutorial that CHS is more or less not used except for compatibility reasons. So, I opted to use LBA(INT 13h extensions). To load the sector of the drive, I have to read the CHS value from the Partition table of that partition. Only then I could convert it to LBA and store it in "Disk Address Packet".
My doubt is, The CHS in Partition table is 1 byte each. Should I take this value directly and convert it into LBA (or) I have to first convert it into,
Cylinder = 10 bits
Sector = 6 bits
Head = 8 bits
and then convert it into LBA?
Note: My MBR must be able to access sectors on both HDD and USB - That is the motive.
OS : Ubuntu
Assembler : Gas