- apply patches from Ben Lunt :

* do not panic when "calibrate drive" is issued to non disk
  * warn that "set tranfert mode" command not supported
This commit is contained in:
Christophe Bothamy 2004-01-19 21:48:07 +00:00
parent bb485a27f0
commit 2117cdae7d

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: harddrv.cc,v 1.114 2003-11-25 23:00:06 cbothamy Exp $
// $Id: harddrv.cc,v 1.115 2004-01-19 21:48:07 cbothamy Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -159,7 +159,7 @@ bx_hard_drive_c::init(void)
Bit8u channel;
char string[5];
BX_DEBUG(("Init $Id: harddrv.cc,v 1.114 2003-11-25 23:00:06 cbothamy Exp $"));
BX_DEBUG(("Init $Id: harddrv.cc,v 1.115 2004-01-19 21:48:07 cbothamy Exp $"));
for (channel=0; channel<BX_MAX_ATA_CHANNEL; channel++) {
if (bx_options.ata[channel].Opresent->get() == 1) {
@ -1939,7 +1939,10 @@ if (channel == 0) {
case 0x10: // CALIBRATE DRIVE
if (!BX_SELECTED_IS_HD(channel))
BX_PANIC(("calibrate drive issued to non-disk"));
BX_INFO(("calibrate drive issued to non-disk"));
// FIXME Maybe we should signal an error in case of cdrom
// if (!BX_SELECTED_IS_PRESENT(channel) || !BX_SELECTED_IS_HD(channel))
if (!BX_SELECTED_IS_PRESENT(channel)) {
BX_SELECTED_CONTROLLER(channel).error_register = 0x02; // Track 0 not found
BX_SELECTED_CONTROLLER(channel).status.busy = 0;
@ -2147,6 +2150,7 @@ if (channel == 0) {
case 0x55: // Disable look-ahead cache.
case 0xCC: // Enable and
case 0x66: // Disable reverting to power-on default
case 0x03: // Set Transfer Mode
BX_INFO(("SET FEATURES subcommand 0x%02x not supported by disk.", (unsigned) BX_SELECTED_CONTROLLER(channel).features));
command_aborted(channel, value);
break;