scsihd: Add PREVENT_ALLOW_MEDIUM_REMOVAL.

Like scsicdrom has.
This commit is contained in:
joevt 2024-03-10 01:30:01 -08:00 committed by dingusdev
parent 4be6bad526
commit cefe8698da
2 changed files with 5 additions and 0 deletions

View File

@ -116,6 +116,10 @@ void ScsiHardDisk::process_command() {
case ScsiCommand::SEND_DIAGS:
this->illegal_command(cmd);
break;
case ScsiCommand::PREVENT_ALLOW_MEDIUM_REMOVAL:
this->eject_allowed = (cmd[4] & 1) == 0;
this->switch_phase(ScsiPhase::STATUS);
break;
case ScsiCommand::READ_CAPACITY_10:
this->read_capacity_10();
break;

View File

@ -63,6 +63,7 @@ private:
int total_blocks;
uint64_t file_offset = 0;
static const int sector_size = 512;
bool eject_allowed = true;
int bytes_out = 0;
uint8_t data_buf[1 << 21]; // TODO: add proper buffer management!