[comp.sys.ibm.pc] IBM PS/2 interupt handler for serial port problem

sfm3166@ultb.UUCP (S.F. Modi) (08/01/89)

Subject: IBM interupt handler for PS2
Newsgroups: comp.sys.ibm.pc

Netters 
	I am trying to write an interupt driven I/O handler on the IBM
PS 2. I am replacing the interupt vector OB and OC with hooks to my
routine for interupts. The address I am using are 3F8 and 2F8 for com1
and com2 resp. The interupt routine serial driver works fine with and
without loopback for IBM PC XT but fails with PS/2 or AT. Am I doing
something wrong in the vectors ? Any one have a simillar problem ? 
Any help will be greatly appreciated. Please mail replies to
{rutgers,cornell}!rochester!rit!ultb!sfm3166.

thanks
			Sohrab Modi

mail address : {rutgers,cornell}!rochester!rit!ultb!sfm3166

kevin@msa3b.UUCP (Kevin P. Kleinfelter) (08/03/89)

sfm3166@ultb.UUCP (S.F. Modi) writes:


>Subject: IBM interupt handler for PS2
>Newsgroups: comp.sys.ibm.pc

>	I am trying to write an interupt driven I/O handler on the IBM
>PS 2. I am replacing the interupt vector OB and OC with hooks to my
>routine for interupts. The address I am using are 3F8 and 2F8 for com1
>and com2 resp. The interupt routine serial driver works fine with and
>without loopback for IBM PC XT but fails with PS/2 or AT. Am I doing
>something wrong in the vectors ? Any one have a simillar problem ? 

I have found no problem in this area.  The following logic works, for me
on PC,XT,AT,PS/2:

out (0x21,MASK_FOR_MY_COM_PORT_INTS)	; shut of ints from com?
wait-2-microseconds-or-more
in (comport_data_reg)			; in case there is already data
save_old vector (3F8 or 2F8)
out (0x21, MASK_MY_COM_INTS_ON)		; enable ints from com?


Perhaps you are leaving out one of the steps, and accepting
default values left there by boot (and perhaps they are different on
the different machine).

The following ports are of interest (for COM1)
3F8	TD/RD
3F8	BaudRate (low)
3F9	BaudRate (high)
3F9	Enable interrupts
3FA	Interrupt ID
3FB	Select amongst uses of 3F8,3F9
3FC	ModemControl (output)
3FD	LineStatus (input)
3FE	ModemStatus (input)


021	Interrupt Controller

Note: Accesses to the 8250 must be at least 2 microsec apart
or it will SEIZE-UP (a technical term meaning "bust").

A useful text is "IBM Personal Computer from the Inside Out".

(Yes, I know you really know how to do all this.  I'm just suggesting
that you do an operation by operation compare with something that
works on all machines, to see what you've missed.)
-- 
Kevin Kleinfelter @ Management Science America, Inc (404) 239-2347
gatech!nanovx!msa3b!kevin