A controller for controlling the operation of a hard disk drive is capable
of generating a random number using the hard disk drive. Initially the
hard disk drive is disabled from performing a read-ahead operation.
Random addresses on the hard disk drive are generated from the output of
the pseudo-random number generator. Read-verify commands is sent to the
hard disk drive to perform a read-verify operation of reading and
verifying the data stored in the sectors of the hard disk drive at the
random addresses without returning the data. The disk access times taken
by the hard disk drive to access the sectors are measured. A deskewing
process is performed on a plural number of disk access time measurements
to generate a random number.