VirtualBox

Changeset 34966 in vbox


Ignore:
Timestamp:
Dec 10, 2010 5:47:25 PM (14 years ago)
Author:
vboxsync
Message:

BIOS: Read multiple sectors at a time.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/BIOS/rombios.c

    r34458 r34966  
    22612261#ifdef VBOX
    22622262#define ATA_CMD_READ_SECTORS_EXT             0x24
     2263#define ATA_CMD_READ_MULTIPLE_EXT            0x29
     2264#define ATA_CMD_WRITE_MULTIPLE_EXT           0x39
    22632265#endif /* VBOX */
    22642266#define ATA_CMD_READ_VERIFY_SECTORS          0x40
     
    23382340    write_byte(ebda_seg,&EbdaData->ata.devices[device].lock,0);
    23392341    write_byte(ebda_seg,&EbdaData->ata.devices[device].mode,ATA_MODE_NONE);
    2340     write_word(ebda_seg,&EbdaData->ata.devices[device].blksize,0);
     2342    write_word(ebda_seg,&EbdaData->ata.devices[device].blksize,0x200);
    23412343    write_byte(ebda_seg,&EbdaData->ata.devices[device].translation,ATA_TRANSLATION_NONE);
    23422344    write_word(ebda_seg,&EbdaData->ata.devices[device].lchs.heads,0);
     
    28642866  iobase2 = read_word(ebda_seg, &EbdaData->ata.channels[channel].iobase2);
    28652867  mode    = read_byte(ebda_seg, &EbdaData->ata.devices[device].mode);
    2866   blksize = 0x200; // was = read_word(ebda_seg, &EbdaData->ata.devices[device].blksize);
     2868  blksize = read_word(ebda_seg, &EbdaData->ata.devices[device].blksize);
    28672869  if (mode == ATA_MODE_PIO32) blksize>>=2;
    28682870  else blksize>>=1;
     
    29192921  outb(iobase1 + ATA_CB_DH, (slave ? ATA_CB_DH_DEV1 : ATA_CB_DH_DEV0) | (Bit8u) head );
    29202922  outb(iobase1 + ATA_CB_CMD, command);
     2923
     2924  if (command == ATA_CMD_READ_MULTIPLE)
     2925    count = 1;
    29212926
    29222927  while (1) {
     
    55765581        else
    55775582#endif
    5578           status=ata_cmd_data_in(device, ATA_CMD_READ_SECTORS, count, cylinder, head, sector, lba, segment, offset);
     5583          write_word(ebda_seg,&EbdaData->ata.devices[device].blksize,count * 0x200); 
     5584          status=ata_cmd_data_in(device, ATA_CMD_READ_MULTIPLE, count, cylinder, head, sector, lba, segment, offset);
     5585          write_word(ebda_seg,&EbdaData->ata.devices[device].blksize,0x200); 
    55795586      }
    55805587      else
     
    57535760          if (count >= 256 || lba + count >= 268435456)
    57545761            status=ata_cmd_data_in(device, ATA_CMD_READ_SECTORS_EXT, count, 0, 0, 0, lba, segment, offset);
    5755           else
    5756             status=ata_cmd_data_in(device, ATA_CMD_READ_SECTORS, count, 0, 0, 0, lba, segment, offset);
     5762          else {
     5763            write_word(ebda_seg,&EbdaData->ata.devices[device].blksize,count * 0x200); 
     5764            status=ata_cmd_data_in(device, ATA_CMD_READ_MULTIPLE, count, 0, 0, 0, lba, segment, offset);
     5765            write_word(ebda_seg,&EbdaData->ata.devices[device].blksize,0x200); 
     5766          }
    57575767        }
    57585768      }
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