aboutsummaryrefslogtreecommitdiffstats
path: root/src/hw/virtio-blk.c
diff options
context:
space:
mode:
authorNikolay Nikolov <nickysn@users.sourceforge.net>2018-02-04 17:27:01 +0200
committerKevin O'Connor <kevin@koconnor.net>2018-02-07 21:19:42 -0500
commit4a6dbcea3e412fe12effa2f812f50dd7eae90955 (patch)
treeb0cc832a28a77cb7c94b728d425fb4ae4f4e191e /src/hw/virtio-blk.c
parent488ede2297461af9d60dd21cff853a49afdc2c70 (diff)
downloadseabios-4a6dbcea3e412fe12effa2f812f50dd7eae90955.tar.gz
floppy: Use timer_check() in floppy_wait_irq()
Use timer_check() instead of using floppy_motor_counter in BDA for the timeout check in floppy_wait_irq(). The problem with using floppy_motor_counter was that, after it reaches 0, it immediately stops the floppy motors, which is not what is supposed to happen on real hardware. Instead, after a timeout (like in the end of every floppy operation, regardless of the result - success, timeout or error), the floppy motors must be kept spinning for additional 2 seconds (the FLOPPY_MOTOR_TICKS). So, now the floppy_motor_counter is initialized to 255 (the max value) in the beginning of the floppy operation. For IRQ timeouts, a different timeout is used, specified by the new FLOPPY_IRQ_TIMEOUT constant (currently set to 5 seconds - a fairly conservative value, but should work reliably on most floppies). After the floppy operation, floppy_drive_pio() resets the floppy_motor_counter to 2 seconds (FLOPPY_MOTOR_TICKS). This is also consistent with what other PC BIOSes do. Signed-off-by: Nikolay Nikolov <nickysn@users.sourceforge.net>
Diffstat (limited to 'src/hw/virtio-blk.c')
0 files changed, 0 insertions, 0 deletions