VirtualBox

Changeset 30687 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Jul 7, 2010 7:21:20 AM (14 years ago)
Author:
vboxsync
Message:

BusLogic: Fix W2K guests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DevBusLogic.cpp

    r30597 r30687  
    840840
    841841    /* Reset registers to default value. */
    842     pBusLogic->regStatus = BUSLOGIC_REGISTER_STATUS_HOST_ADAPTER_READY;
     842    pBusLogic->regStatus = BUSLOGIC_REGISTER_STATUS_HOST_ADAPTER_READY | BUSLOGIC_REGISTER_STATUS_INITIALIZATION_REQUIRED;
    843843    pBusLogic->regInterrupt = 0;
    844844    pBusLogic->regGeometry = BUSLOGIC_REGISTER_GEOMETRY_EXTENTED_TRANSLATION_ENABLED;
     
    13011301        case BUSLOGICCOMMAND_INQUIRE_BOARD_ID:
    13021302        {
    1303             pBusLogic->aReplyBuffer[0] = '0'; /* @todo figure out what to write here. */
    1304             pBusLogic->aReplyBuffer[1] = '1'; /* @todo figure out what to write here - can't be '0' or 'B'. */
     1303            pBusLogic->aReplyBuffer[0] = 'A'; /* Firmware option bytes */
     1304            pBusLogic->aReplyBuffer[1] = 'A';
    13051305
    13061306            /* We report version 5.07B. This reply will provide the first two digits. */
     
    13261326            /* The reply length is set by the guest and is found in the first byte of the command buffer. */
    13271327            pBusLogic->cbReplyParametersLeft = pBusLogic->aCommandBuffer[0];
    1328             memset(pBusLogic->aReplyBuffer, 0, pBusLogic->cbReplyParametersLeft);
     1328            memset(pBusLogic->aReplyBuffer, ' ', pBusLogic->cbReplyParametersLeft);
    13291329            const char aModelName[] = "958";
    1330             int cCharsToTransfer =   (pBusLogic->cbReplyParametersLeft <= sizeof(aModelName))
     1330            int cCharsToTransfer =   (pBusLogic->cbReplyParametersLeft <= (sizeof(aModelName) - 1))
    13311331                                   ? pBusLogic->cbReplyParametersLeft
    1332                                    : sizeof(aModelName);
     1332                                   : sizeof(aModelName) - 1;
    13331333
    13341334            for (int i = 0; i < cCharsToTransfer; i++)
     
    13981398            Log(("cMailboxes=%u\n", pBusLogic->cMailbox));
    13991399
     1400            pBusLogic->regStatus &= ~BUSLOGIC_REGISTER_STATUS_INITIALIZATION_REQUIRED;
    14001401            pBusLogic->cbReplyParametersLeft = 0;
    14011402            break;
     
    14631464            break;
    14641465        }
     1466        case BUSLOGICCOMMAND_SET_PREEMPT_TIME_ON_BUS:
     1467        {
     1468            pBusLogic->cbReplyParametersLeft = 0;
     1469            pBusLogic->LocalRam.structured.autoSCSIData.uBusOnDelay = pBusLogic->aCommandBuffer[0];
     1470            Log(("Bus-on time: %d\n", pBusLogic->aCommandBuffer[0]));
     1471            break;
     1472        }
     1473        case BUSLOGICCOMMAND_SET_TIME_OFF_BUS:
     1474        {
     1475            pBusLogic->cbReplyParametersLeft = 0;
     1476            pBusLogic->LocalRam.structured.autoSCSIData.uBusOffDelay = pBusLogic->aCommandBuffer[0];
     1477            Log(("Bus-off time: %d\n", pBusLogic->aCommandBuffer[0]));
     1478            break;
     1479        }
    14651480        case BUSLOGICCOMMAND_EXECUTE_MAILBOX_COMMAND: /* Should be handled already. */
    14661481        default:
     
    14681483    }
    14691484
    1470     Log(("cbReplyParametersLeft=%d\n", pBusLogic->cbReplyParametersLeft));
     1485    Log(("uOperationCode=%#x, cbReplyParametersLeft=%d\n", pBusLogic->uOperationCode, pBusLogic->cbReplyParametersLeft));
    14711486
    14721487    /* Set the data in ready bit in the status register in case the command has a reply. */
     
    16411656                    case BUSLOGICCOMMAND_DISABLE_HOST_ADAPTER_INTERRUPT:
    16421657                    case BUSLOGICCOMMAND_ECHO_COMMAND_DATA:
     1658                    case BUSLOGICCOMMAND_SET_PREEMPT_TIME_ON_BUS:
     1659                    case BUSLOGICCOMMAND_SET_TIME_OFF_BUS:
    16431660                        pBusLogic->cbCommandParametersLeft = 1;
    16441661                        break;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette