When the BIOS gives control to the MBR (or the bootloader, for non-partitioned media), it passes the drive number from which the bootloader was loaded in the DL register. This number is most of the times 0x00 when booting floppy drives or 0x80 when booting from hard drives.
The BIOS disk functions (int 0x13) all require a drive number when accessing a drive. Since the bootloader is only given the boot drive's number, how is it possible to determine how many drives are in the system (assuming that the BIOS will enumerate the disks sequentially, so the second floppy is 0x01, the second hard drive is 0x81 and so on...)? There seems to be no BIOS function for this, at least according to Wikipedia.