61 lines
2.6 KiB
Plaintext
61 lines
2.6 KiB
Plaintext
----------------------------------------------------------------------
|
|
Patch name: pit-panic
|
|
Author: Bryce Denney
|
|
Date: Fri Apr 6 02:48:29 EDT 2001
|
|
|
|
Description:
|
|
|
|
The 82c54 model (pit.cc) implements timer modes 0, 2, and 3 in its handler
|
|
functions, without caring which timer number is involved. However, the
|
|
I/O write code that sets the mode is inconsistent.
|
|
Timer 0 can be set to modes 0,2,3 only.
|
|
Timer 1 can be set to mode 2 only.
|
|
Timer 2 can be set to mode 2,3 only.
|
|
From a quick reading of an 8254 datasheet, I can't see any reason to
|
|
restrict which timer can be in which mode, so I think it's correct to
|
|
allow ALL timers to go into ALL modes that are implemented. If you think
|
|
otherwise, pls let me know.
|
|
|
|
Apply patch to:
|
|
bochs 3-25-2000 snapshot
|
|
Instructions:
|
|
To patch, go to main bochs directory.
|
|
Type "patch -p1 < THIS_PATCH_FILE".
|
|
----------------------------------------------------------------------
|
|
*** clean-bochs-2000-03-25/iodev/pit.cc Tue Apr 3 15:19:42 2001
|
|
--- pit-panic/iodev/pit.cc Fri Apr 6 02:38:08 2001
|
|
***************
|
|
*** 368,374 ****
|
|
BX_PIT_THIS s.timer[1].input_latch_value = 0;
|
|
BX_PIT_THIS s.timer[1].input_latch_toggle = 0;
|
|
BX_PIT_THIS s.timer[1].bcd_mode = bcd_mode;
|
|
! if ( mode!=2 || bcd_mode!=0 )
|
|
bx_panic("pit: outp(43h): comm 7, mode %02x, bcd %02x unhandled\n",
|
|
(unsigned) mode, bcd_mode);
|
|
break;
|
|
--- 368,374 ----
|
|
BX_PIT_THIS s.timer[1].input_latch_value = 0;
|
|
BX_PIT_THIS s.timer[1].input_latch_toggle = 0;
|
|
BX_PIT_THIS s.timer[1].bcd_mode = bcd_mode;
|
|
! if ( (mode!=3 && mode!=2 && mode!=0) || bcd_mode!=0 )
|
|
bx_panic("pit: outp(43h): comm 7, mode %02x, bcd %02x unhandled\n",
|
|
(unsigned) mode, bcd_mode);
|
|
break;
|
|
***************
|
|
*** 387,393 ****
|
|
BX_PIT_THIS s.timer[2].input_latch_value = 0;
|
|
BX_PIT_THIS s.timer[2].input_latch_toggle = 0;
|
|
BX_PIT_THIS s.timer[2].bcd_mode = bcd_mode;
|
|
! if ( (mode!=3 && mode!=2) || bcd_mode!=0 )
|
|
bx_panic("pit: outp(43h): comm Bh, mode %02x, bcd %02x unhandled\n",
|
|
(unsigned) mode, bcd_mode);
|
|
break;
|
|
--- 387,393 ----
|
|
BX_PIT_THIS s.timer[2].input_latch_value = 0;
|
|
BX_PIT_THIS s.timer[2].input_latch_toggle = 0;
|
|
BX_PIT_THIS s.timer[2].bcd_mode = bcd_mode;
|
|
! if ( (mode!=3 && mode!=2 && mode!=0) || bcd_mode!=0 )
|
|
bx_panic("pit: outp(43h): comm Bh, mode %02x, bcd %02x unhandled\n",
|
|
(unsigned) mode, bcd_mode);
|
|
break;
|