-   Linux - Software (
-   -   Unable to hit my serial port interrupt routine (

hguts 07-14-2003 04:19 PM

Unable to hit my serial port interrupt routine
Hi there;

Im trying to write a program to intercept the PPS signal from my Motorola GPS
receiver (Oncore).
This the initialisation of my module

int __init hguts_init(void)
int result;

result = check_region(COM1_BASE,8);
if (result<0) printk("<1>short: can't get I/O address \n");
else request_region(COM1_BASE, 8,"hgserial");

result = register_chrdev(254, "hgserial", &hgserial_fops);
if (result < 0) {
printk(KERN_WARNING "hgserial: can t get major %d\n",254);
return result;
result = request_irq(IRQ_COM1, myserial_interrupt, SA_INTERRUPT, "myserial", NULL);

if (result) {
printk("<1>hgserial: can t get assigned irq %i\n", 3*2);
} else {
outb(0x00,COM1_BASE+1); /*Disable Interrupt on COM1*/
outb(0x08,COM1_BASE+3); /* Tur non DLAB */
outb(0x00,COM1_BASE); /*Set baud rate I tried differnet */
outb(0x0C,COM1_BASE+1); /* baud rate*/
outb(0x00,COM1_BASE+3); /* Turn off DLAB */
outb(0x01,COM1_BASE+1); /* Set up the interrupt register */

return 0;

And this is my handler routine (Nothins special)

void myserial_interrupt(int irq, void *dev_id, struct pt_regs *regs)
printk("<1> Im the intr \n");

After I will load the module I could reserve the IRQ 4
[root@bedoule ntp-4.1.80-rc1]# cat /proc/interrupts
0: 1065580 XT-PIC timer
1: 22469 XT-PIC keyboard
2: 0 XT-PIC cascade
4: 129 XT-PIC myserial
9: 0 XT-PIC usb-uhci
11: 8832 XT-PIC eth0
12: 142647 XT-PIC PS/2 Mouse
14: 68778 XT-PIC ide0
15: 132412 XT-PIC ide1
NMI: 0
ERR: 0

Please If you have any idea, Im stuck and I have to fix this probleme ASAP.

captainstorm 07-15-2003 07:45 AM

You could use interrupt under gcc? Oh, I don't know but I have read some documents telling that gcc does not have the interrupt process ability.

From your code I think you first open the serialport, then request the interrupt, if successful, do some control, like baud rate by modifying some registers.

But I have no idea on "request_irq" this function...

All times are GMT -5. The time now is 09:21 PM.