1 year ago

#361616

test-img

SubtRose

How to get size of disk driver sector

Can get size of disk sector via the Linux API/ABI? It's about the quantum of I/O disk, normally it's equal 512 bytes, but others values can be too (usually multiple 512 bytes). Also it should not confuse to size of logical block or to size of sector of a file system.

A block device is reflected as file in a file system of an UNIX (/dev/sda, /dev/sr etc.) It means, can open that file and make some manipulations to its content like with content of the corresponded block device.

So specifically the work to a true block device similar the work to a virtual hard disk (the .vhd format for instance). But i don't know how to get size of sector in general case. At moment i've single solution: get the maximal CHS address and size of hard drive, both action via BIOS. But i think, it's bad idea, because portability lost

c

linux

assembly

hard-drive

0 Answers

Your Answer

Accepted video resources