Permalink
Browse files

Very dumb bug fixed, 3.0.1 boots now!

For READ(6) and WRITE(6), SCSI spec says,
"A TRANSFER LENGTH field set to zero specifies that 256 logical blocks shall be written"
Oops
  • Loading branch information...
pruten committed Jun 23, 2014
1 parent f051d42 commit 305d84faadf67b74924f8a392b48681f80fa2379
Showing with 2 additions and 2 deletions.
  1. +2 −2 core/scsi.c
View
@@ -349,7 +349,7 @@ static void scsi_buf_set (uint8_t byte)
(shoe.scsi.buf[1] << 16) |
(shoe.scsi.buf[2] << 8 ) |
(shoe.scsi.buf[3]);
const uint8_t len = shoe.scsi.buf[4];
const uint16_t len = (shoe.scsi.buf[4]==0) ? 0x100 : shoe.scsi.buf[4]; // len==0 -> 256 sectors
assert(dev->f);
@@ -380,7 +380,7 @@ static void scsi_buf_set (uint8_t byte)
(shoe.scsi.buf[1] << 16) |
(shoe.scsi.buf[2] << 8 ) |
(shoe.scsi.buf[3]);
const uint8_t len = shoe.scsi.buf[4];
const uint16_t len = (shoe.scsi.buf[4]==0) ? 0x100 : shoe.scsi.buf[4]; // len==0 -> 256 sectors
slog("scsi_buf_set: Responding to write at off=%u len=%u\n", offset, len);

0 comments on commit 305d84f

Please sign in to comment.