3B2: Do not read from detached floppy
The Rev 3 firmware does not check floppy controller status before commanding a sector read, which can lead to calling sim_disk_rdsect() on a detached unit. With this checkin, the simulator will no longer attempt a read or write if the floppy unit is not attached.
This commit is contained in:
parent
87eab8a53c
commit
5fd9ee3909
1 changed files with 6 additions and 0 deletions
|
@ -554,6 +554,12 @@ void if_write(uint32 pa, uint32 val, size_t size)
|
||||||
if_state.cmd = (uint8) val;
|
if_state.cmd = (uint8) val;
|
||||||
/* Writing to the command register always de-asserts the IRQ line */
|
/* Writing to the command register always de-asserts the IRQ line */
|
||||||
if_clear_irq();
|
if_clear_irq();
|
||||||
|
|
||||||
|
if ((uptr->flags & UNIT_ATT) == 0) {
|
||||||
|
/* If not attached, do nothing */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if_handle_command();
|
if_handle_command();
|
||||||
break;
|
break;
|
||||||
case IF_TRACK_REG:
|
case IF_TRACK_REG:
|
||||||
|
|
Loading…
Add table
Reference in a new issue