getgeom is a program to print out the CHS geometry (Cylinders, Heads and Sectors) and size of all disks attached to an IBM-compatible PC.

This is a real mode (16 bit) program.  The easiest way to use it is to write it into the boot sector of a disk.  When the machine is booted from that disk it will print the numbers and then wait for you to power off.

The PC BIOS int 13h interface is limited to drives of 8064 MiB.  With drives bigger than this, getgeom will print out exactly what the BIOS reports.  This is its whole purpose.


This is truly free software.


Binary, padded to 512 bytes, with boot signature: getgeom.bin

Source: getgeom.s


On a typical Linux system, use the following commands to download and assemble getgeom, and install it to the first floppy drive.

wget ''
nasm -f bin -o tempfile getgeom.s
cat tempfile /dev/zero | head -c510 > getgeom.bin
rm tempfile
echo -en '\x55\xAA' >> getgeom.bin
dd if=getgeom.bin bs=512 count=1 of=/dev/fd0