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.
I'm working on a simple bootloader, and I'm running into some issue with by build environment. To generate my bootable image, I have a Makefile that looks like
but when my MBR attempts to read the LBA of the active partition from the partition table, it just reads 0's. I have checked a hexdump of the disk image, and the relevant bytes are indeed 0. I was under the impression that these bytes should give me the LBA of the boot record of the partition, so I'm not sure why it's 0 in the generated disk image. I have also checked the image generated before my MBR is copied in, in case I was somehow overwriting it, and the same problem exists. I'm not really sure what the issue is here. Is there some utility that I have to use in order to properly initialize the partition table? Is these bytes being 0 actually correct? If so, how do I know which sectors to load from disk to get the boot record of the active partition?
You're not creating any partitions. mformat only creates a filesystem, nothing else. If you want that filesystem to be a partition on the disk, you need to either manually assemble your disk image by partitioning it and copying the filesytem created by mformat into the partition, or mount your disk image as a loopback device and tell mformat to operate on the partition sub-device.
There may also be some utility that can more conveniently create a partitioned and formatted disk image for you, but I don't know of any off the top of my head.
Unrelated, but the ".iso" file extension implies you're creating an optical disc image. You should choose a different extension.