- why restrict when people read the sector count? This was causing

unnecessary panics on openbsd when sector count was read soon after a
  reset.
This commit is contained in:
Bryce Denney 2001-05-03 20:40:08 +00:00
parent 8e9caa8ddb
commit 10412cdf1e

View File

@ -489,18 +489,10 @@ bx_hard_drive_c::read(Bit32u address, unsigned io_len)
value8 = BX_SELECTED_CONTROLLER.error_register;
goto return_value8;
break;
case 0x1f2: // hard disk sector count / interrupt reason
if (BX_SELECTED_CONTROLLER.current_command==0x20 ||
BX_SELECTED_CONTROLLER.current_command==0x21 ||
BX_SELECTED_CONTROLLER.current_command==0x30 ||
BX_SELECTED_CONTROLLER.current_command==0xa0) {
value8 = BX_SELECTED_CONTROLLER.sector_count;
goto return_value8;
}
bx_panic("disk: IO read(0x1f2): current command (0x%2x) not read/write\n", BX_SELECTED_CONTROLLER.current_command);
value8 = BX_SELECTED_CONTROLLER.sector_count;
goto return_value8;
break;
case 0x1f3: // sector number
value8 = BX_SELECTED_CONTROLLER.sector_no;
goto return_value8;