Message-ID: <03a701c2ccf6$5ccd6160$0600000a@broadpark.no> From: "Gisle Vanem" To: References: Subject: Re: Determining interrupt vector for serial port Date: Wed, 5 Feb 2003 10:10:00 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1123 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1123 Reply-To: djgpp AT delorie DOT com "John Henderson" said: > But I've been unable to discover how to "read" the associated IRQ > value for each port. So far I've found them hardcoded as 4, 3, > 4, 3 respectively in all examples. But I've got to look no > further than my own PC to find COM3 using IRQ5 (on an ISA card). > How does a program discover this? Only way I know is to 1. mask off all interrupts in the PIC (to prevent false positives) 2. clear the in-service bits 3. issue an UART command that raises it's IRQ line (e.g. an internal loopback test) 4. poll all in-service bits in the PIC 5. and finally restore the PIC mask. A lot of work to automate. A IMHO nicer approach would be to use an environment variable so the user can override default assumptions. E.g. COM1_SETTINGS=irq 5, base 0x3f8 Gisle V.