I'm now trying to read the disk boot sector info. I compiled my kernel into a floppy and load it into qemu using -fda a.img, and I also created another qcow image file called disk.img and load into qemu using -hda disk.img. When I try to get boot sector info from LBA 0x00 I could only get all 0 in that sector. After that I format the qcow image file into fat32 using
Code:
mkfs.vfat -F 32 -v disk.img
and load it into qemu, but qemu then print
Code:
Booting from Hard Disk
This is not a bootable disk. Please insert a bootable floppy and press any key to try again
The parameters I add to qemu is this
Code:
QemuParameter := -cpu Nehalem,+x2apic -m 512 \
-enable-kvm -D ./log.txt -s -S -fda a.img -smp cores=$(APUNUM) -hda disk.img
a.img is the image file contains a bootloader and kernel
I'm now wondering how could I read the fat32 boot sector info properly