Hi,
zq wrote:
I'm doing something about disk reading under real mode and I wanna my program to be more compatible, that is, consider 4KB(or any size other than conventional 512Bytes ).
However trouble came when I deal with qemu, even I've set those properties such like physical and logical block size in command line, but my program detect that by BIOS int 13h,ah 0x42, still it return a value with sector size 512.
I don't know if my command is wrong, can anyone tell m3 the right solution.
OR Does it means in bios sector size is ALWAYS logical 512B?
For backward compatibility for hard drives with 4 KiB sectors:
- most hard drives emulate 512-byte sectors in their default mode, so that the BIOS and/or old software doesn't break
- for hard disks that don't emulate 512-byte sectors, the BIOS has to support "4 KiB native" and the BIOS emulates 512-byte sectors
To avoid the performance costs (without writing your own device driver that puts the drive into "native mode") you can just read/write "groups of eight 512-byte pretend sectors that are aligned on an 8 pretend sector boundary".
Cheers,
Brendan