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
This commit is contained in:
Peter Rutenbar 2014-06-23 10:55:41 -04:00
parent f051d42597
commit 305d84faad

View File

@ -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);