As Octocontrabass states, this allows you to keep a disk spinning even though you may be accessing another drive. It was quite common back in the day for a computer to have at least two drives. (Just for fun, I happen to still have one here on one of my desks that has a 3 1/2" as well as a 5 1/4")
With all of this in mind, you will need to create a thread (or task) to watch the motors and turn them off after a couple of seconds. This is done in real mode via the Legacy BIOS. A value is decremented once per interrupt and if it reaches zero, the motor is turned off.
Once you move to protected mode (or even long mode), this service is no longer available, so you will need to do this yourself. It is actually quite simple. Take the time you wish to have a motor run after no more access, calculate the hertz a timer would be called, and decrement a value until zero. Just like the Legacy BIOS does it.
One more note about the floppy drive. If you happen to be booting from the floppy drive and move to protected mode before the BIOS has time to turn off the motor, the drive will continue to spin indefinitely. A really easy trick to make sure this doesn't happen is to set the value the BIOS uses (
a byte at 0x00440) to 1 just before you move to protected mode. If it is already zero, skip the check.
Here is some code I use.
Ben