VirtualBox

Changeset 55753 in vbox


Ignore:
Timestamp:
May 8, 2015 12:58:38 PM (10 years ago)
Author:
vboxsync
Message:

FDC: Fixed DRIVE SPECIFICATION command.

File:
1 edited

Legend:

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

    r55641 r55753  
    21752175    fdrive_t *cur_drv = get_cur_drv(fdctrl);
    21762176
    2177     if (fdctrl->fifo[fdctrl->data_pos - 1] & 0x80) {
     2177    /* This command takes a variable number of parameters. It can be terminated
     2178     * at any time if the high bit of a parameter is set. Once there are 6 bytes
     2179     * in the FIFO (command + 5 parameter bytes), data_len/data_pos will be 7.
     2180     */
     2181    if (fdctrl->data_len == 7 || (fdctrl->fifo[fdctrl->data_pos - 1] & 0x80)) {
     2182
    21782183        /* Command parameters done */
    21792184        if (fdctrl->fifo[fdctrl->data_pos - 1] & 0x40) {
    2180             fdctrl->fifo[0] = fdctrl->fifo[1];
     2185            /* Data is echoed, but not stored! */
     2186            fdctrl->fifo[0] = fdctrl->data_len > 2 ? fdctrl->fifo[1] : 0;
     2187            fdctrl->fifo[1] = fdctrl->data_len > 3 ? fdctrl->fifo[2] : 0;
    21812188            fdctrl->fifo[2] = 0;
    21822189            fdctrl->fifo[3] = 0;
     
    21852192            fdctrl_reset_fifo(fdctrl);
    21862193        }
    2187     } else if (fdctrl->data_len > 7) {
    2188         /* ERROR */
    2189         fdctrl->fifo[0] = 0x80 |
    2190             (cur_drv->head << 2) | GET_CUR_DRV(fdctrl);
    2191         fdctrl_set_fifo(fdctrl, 1, 0);
    2192     }
     2194    } else
     2195        fdctrl->data_len++; /* Wait for another byte. */
    21932196}
    21942197
     
    22552258    { FD_CMD_POWERDOWN_MODE, 0xff, "POWERDOWN MODE", 2, fdctrl_handle_powerdown_mode },
    22562259    { FD_CMD_OPTION, 0xff, "OPTION", 1, fdctrl_handle_option },
    2257     { FD_CMD_DRIVE_SPECIFICATION_COMMAND, 0xff, "DRIVE SPECIFICATION COMMAND", 5, fdctrl_handle_drive_specification_command },
     2260    { FD_CMD_DRIVE_SPECIFICATION_COMMAND, 0xff, "DRIVE SPECIFICATION COMMAND", 1, fdctrl_handle_drive_specification_command },
    22582261    { FD_CMD_RELATIVE_SEEK_OUT, 0xff, "RELATIVE SEEK OUT", 2, fdctrl_handle_relative_seek_out },
    22592262    { FD_CMD_FORMAT_AND_WRITE, 0xff, "FORMAT AND WRITE", 10, fdctrl_unimplemented },
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