Kinda figured, because the table in a CHS MBR has a head size of 2^8, sector size of 2^6, and cyllinder size of 2^10. And I'd rather just address using the other addressing scheme, the one that works for hard drives only. A lot easier and less cumbersome. I just wanted a partition table to make the BIOS happy, and this will do! But this is all making tons of sense now!Octocontrabass wrote: In practice, you can always use 255 heads and 63 sectors to calculate the CHS values in your USB flash drive's partition table. (You still need to use INT 0x13 AH=0x08 if you plan on reading the disk using CHS addressing.)
Yeah, MBR is definitely standardized. I saw the main wikipedia article about it, and have been studying it best I could. Hence, the one they marked as 'standard' used CHS keys instead of LBA. Haven't found one that uses LBA keys to reference though.Octocontrabass wrote: MBR is also standardized and also uses LBA. My own bootloaders completely ignore the CHS values; they're only in the partition table for the BIOS's benefit.
It makes sense why it wouldn't check Hard disks or floppy, because those aren't being emulated. I was actually thinking that the BIOS checked for an active (80h) flag. Wanted to confirm first. And glad I did!Octocontrabass wrote: It checks for a signature, exactly one partition marked active, and start and end values that don't overlap. It only checks for USB flash drives and the like; it does not check hard disks or floppy disks.
That makes sense, because as I've just found out, 0,0,1 is equal to LBA 0, which is the MBR. Doesn't make sense to have a partition start at the bootsector. Will change to 0,0,2.(Or whatever value is valid after the GTP is implemented!)Octocontrabass wrote: You can't start a partition at CHS (0,0,1). The previous partition table you posted (and have since deleted) booted in floppy disk mode on your test machine because of that mistake.
This makes a lot more sense now, and all the answers posted have been very helpful. Will try the revised code later tomorrow, see if it works on my other test machine. Thank you guys for your help! I really appreciate it!