mirror of https://github.com/bochs-emu/Bochs
- don't blindly reject odd length atapi commands. There are cases when
it's really ok according to ATA-4.
This commit is contained in:
parent
1dea7b1d3e
commit
7279914d1b
|
@ -1,5 +1,5 @@
|
|||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: harddrv.cc,v 1.39 2001-10-06 09:04:39 bdenney Exp $
|
||||
// $Id: harddrv.cc,v 1.40 2001-10-06 23:55:19 bdenney Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
|
@ -116,7 +116,7 @@ bx_hard_drive_c::~bx_hard_drive_c(void)
|
|||
bx_hard_drive_c::init(bx_devices_c *d, bx_cmos_c *cmos)
|
||||
{
|
||||
BX_HD_THIS devices = d;
|
||||
BX_DEBUG(("Init $Id: harddrv.cc,v 1.39 2001-10-06 09:04:39 bdenney Exp $"));
|
||||
BX_DEBUG(("Init $Id: harddrv.cc,v 1.40 2001-10-06 23:55:19 bdenney Exp $"));
|
||||
|
||||
/* HARD DRIVE 0 */
|
||||
|
||||
|
@ -2462,9 +2462,10 @@ bx_hard_drive_c::init_send_atapi_command(Bit8u command, int req_length, int allo
|
|||
if (BX_SELECTED_CONTROLLER.byte_count == 0)
|
||||
BX_PANIC(("ATAPI command with zero byte count"));
|
||||
|
||||
if (BX_SELECTED_CONTROLLER.byte_count & 1)
|
||||
BX_PANIC(("Odd byte count to ATAPI command"));
|
||||
|
||||
if ((BX_SELECTED_CONTROLLER.byte_count & 1)
|
||||
&& !(alloc_length <= BX_SELECTED_CONTROLLER.byte_count)) {
|
||||
BX_PANIC(("Odd byte count to ATAPI command"));
|
||||
}
|
||||
if (alloc_length <= 0)
|
||||
BX_PANIC(("Allocation length <= 0"));
|
||||
|
||||
|
|
Loading…
Reference in New Issue