aboutsummaryrefslogtreecommitdiff
path: root/src/disk.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2012-02-11 09:38:44 -0500
committerKevin O'Connor <kevin@koconnor.net>2012-02-11 09:38:44 -0500
commitb50488bb3912f50ac70055d3fc3200ff2303986b (patch)
tree3622516c86482658fb899ec1b3a30a4dfed6b3a4 /src/disk.c
parent26d3144fbf22185c75b10c30988ca33aa8842837 (diff)
downloadseabios-hppa-b50488bb3912f50ac70055d3fc3200ff2303986b.zip
seabios-hppa-b50488bb3912f50ac70055d3fc3200ff2303986b.tar.gz
seabios-hppa-b50488bb3912f50ac70055d3fc3200ff2303986b.tar.bz2
disk: handle LBA I/O with zero sector count
Unlike basic_access, extended_access does not check for a zero sector count. However, this is a problem because for example it would be interpreted as 256 when processing an ATA request. Based on patch from: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/disk.c')
-rw-r--r--src/disk.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/disk.c b/src/disk.c
index f2c6621..29714d6 100644
--- a/src/disk.c
+++ b/src/disk.c
@@ -135,6 +135,11 @@ extended_access(struct bregs *regs, struct drive_s *drive_g, u16 command)
dop.buf_fl = SEGOFF_TO_FLATPTR(GET_INT13EXT(regs, data));
dop.count = GET_INT13EXT(regs, count);
+ if (! dop.count) {
+ // Nothing to do.
+ disk_ret(regs, DISK_RET_SUCCESS);
+ return;
+ }
int status = send_disk_op(&dop);