[comp.os.minix] bug in mpx88.s + fix

mullen@sdsu.UUCP (deborah mullen) (03/31/89)

This bug shows up when NR_CONS in tty.h is changed to 2 instead of 1.
Many many thanks to Bruce Evans for the solution!!
The interrupt handlers for the serial ports push a constant on the
stack before calling the C routine that handles the interrupt. This
constant is related to the value of NR_CONS. Below is a cdiff for the
fix.
--Deborah Mullen
-----------------------Cut Here---------------------------
*** mpx88.old	Wed Mar 29 11:52:20 1989
--- mpx88.new	Wed Mar 29 11:56:13 1989
***************
*** 29,34 ****
--- 29,35 ----
  IDLE		= -999
  DISKINT		=    1
  CLOCK_TICK	=    2
+ NR_CONS		=    1
  
  | The following procedures are defined in this file and called from outside it.
  .globl _tty_int, _rs232_int, _lpr_int, _clock_int, _disk_int, _wini_int
***************
*** 106,112 ****
  |*============================================================================
  _rs232_int:			| Interrupt routine for rs232 I/O.
  	call save		| save the machine state
! 	mov ax,#1		| which unit caused the interrupt
  	push ax			| pass it as a parameter
  	call _rs232		| process a rs232 interrupt
  	jmp _restart		| continue execution
--- 107,113 ----
  |*============================================================================
  _rs232_int:			| Interrupt routine for rs232 I/O.
  	call save		| save the machine state
! 	mov ax,#NR_CONS		| which unit caused the interrupt
  	push ax			| pass it as a parameter
  	call _rs232		| process a rs232 interrupt
  	jmp _restart		| continue execution
***************
*** 117,123 ****
  |*============================================================================
  _secondary_int:			| Interrupt routine for rs232 port 2
  	call save		| save the machine state
! 	mov ax,#2		| which unit caused the interrupt
  	push ax			| pass it as a parameter
  	call _rs232		| process a rs232 interrupt
  	jmp _restart		| continue execution
--- 118,125 ----
  |*============================================================================
  _secondary_int:			| Interrupt routine for rs232 port 2
  	call save		| save the machine state
! 	mov ax,#NR_CONS		| which unit caused the interrupt
! 	inc ax
  	push ax			| pass it as a parameter
  	call _rs232		| process a rs232 interrupt
  	jmp _restart		| continue execution