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?
Emulate 4KB sector disk
Re: Emulate 4KB sector disk
Hi,
Cheers,
Brendan
For backward compatibility for hard drives with 4 KiB sectors: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?
- 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
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: Emulate 4KB sector disk
hard drives on the market will give 512 byte blocks for you. only older special non-standard hardware will give different sector size, but you will not met any of such on the market. so the vaules you got are correct.
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
http://users.atw.hu/gerigeri/DawnOS/download.html
Re: Emulate 4KB sector disk
Yes, that's how the BIOS interfaces are defined. If you want to use a 4k native disk to boot from, you need something else, like UEFI. (As Brendan says, the BIOS could emulate 512b sectors on a 4k disk, but that would be slow, not 100% correct and in practice I haven't seen a BIOS that supports it.)zq wrote:Does it means in bios sector size is ALWAYS logical 512B?