aboutsummaryrefslogtreecommitdiffstats
path: root/src/disk.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2014-12-29 10:29:34 -0500
committerKevin O'Connor <kevin@koconnor.net>2014-12-29 10:36:46 -0500
commit45e71721da6e37598593cf04f5a840380455d0a6 (patch)
treed5ac9eafa31c4ff17f4ab4c37e129a2938fc54cd /src/disk.c
parentc08ef9a777d3bec4deaad564bcf510e8f0b27ff6 (diff)
downloadseabios-45e71721da6e37598593cf04f5a840380455d0a6.tar.gz
block: Check for read/write requests over 64K
The standard BIOS disk read/write request interface should never get a request for more than 64K of data. Explicitly check for overly large requests and reject them. This way, the low-level drivers do not need to check for or attempt to handle very large requests. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/disk.c')
-rw-r--r--src/disk.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/disk.c b/src/disk.c
index fe2e2c31..0e0af24b 100644
--- a/src/disk.c
+++ b/src/disk.c
@@ -173,6 +173,7 @@ disk_1300(struct bregs *regs, struct drive_s *drive_gf)
struct disk_op_s dop;
dop.drive_gf = drive_gf;
dop.command = CMD_RESET;
+ dop.count = 0;
int status = send_disk_op(&dop);
disk_ret(regs, status);
}
@@ -322,6 +323,7 @@ disk_1310(struct bregs *regs, struct drive_s *drive_gf)
struct disk_op_s dop;
dop.drive_gf = drive_gf;
dop.command = CMD_ISREADY;
+ dop.count = 0;
int status = send_disk_op(&dop);
disk_ret(regs, status);
}