Skip to contentSkip to conversation

Interrupt service routine problem

Xenomai-help Shashank Bhatia 2 participants 4 messages May 25, 2009 – May 26, 2009

lore
Share & tools
lore
#0 lore raw

Dear All,

I was trying to make a simple kernel module, and was unable to insert it into the kernel space. The code and Error messages are provided hereunder:

Code:
#include <native/task.h>
#include <native/timer.h>
#include <native/intr.h>

#define STACK_SIZE 0

RT_INTR isrDesc;

int isrKbdHandler(struct xnintr* _idesc) {

  printk("module: catch a key\n");

return RT_INTR_PROPAGATE;

}

int init_module (void) {

  printk("module: Init\n");
  rt_intr_create(&isrDesc, "kbdisr", (unsigned)1, &isrKbdHandler, NULL, 0);
  rt_intr_enable(&isrDesc);

return 0;
}

void cleanup_module (void) {

  rt_intr_delete(&isrDesc);

printk("module: exit\n");
}

MODULE_LICENSE("GPL");

Makefile:

obj-m = module.o

KDIR = /lib/modules/$(shell uname -r)/build
PWD = $(shell pwd)
EXTRA_CFLAGS = -I/usr/xenomai/include -I/usr/include/ default:

	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules

clean:

	rm -f *.o *.ko *.mod.c *symvers *~

Error message:
make -C /lib/modules/2.6.25.11-default/build SUBDIRS=/home/bhatia/rtprog/interupt modules
make[1]: Entering directory `/usr/src/linux-2.6.25.11'
CC [M] /home/bhatia/rtprog/interupt/module.o
Building modules, stage 2.
MODPOST 1 modules
WARNING: "rt_intr_enable" [/home/bhatia/rtprog/interupt/module.ko] undefined!
WARNING: "rt_intr_create" [/home/bhatia/rtprog/interupt/module.ko] undefined!
WARNING: "rt_intr_delete" [/home/bhatia/rtprog/interupt/module.ko] undefined!
CC /home/bhatia/rtprog/interupt/module.mod.o
LD [M] /home/bhatia/rtprog/interupt/module.ko
make[1]: Leaving directory `/usr/src/linux-2.6.25.11'

Error while insmoding:
insmod: error inserting './module.ko': -1 Unknown symbol in module

Thanks and Regards,

Shashank

-------------------------------------
Hi-Tech Gears Limited, Gurgaon, India

#1 lore raw

Hi,

the rt_intr_* functions are disabled by default in the kernel configuration [1].

You can enable them here:
Real-time subsystem -> Interfaces -> Native API -> Interrupts

For device drivers its suggested that you use the RTDM skin and not the rt_intr_* calls from the native API.

kisda

[1] https://mail.gna.org/public/xenomai-help/2006-07/msg00197.html

Quoted 110 lines · Shashank Bhatia

Dear All,

I was trying to make a simple kernel module, and was unable to insert it into the kernel space. The code and Error messages are provided hereunder:

Code:
#include <native/task.h>
#include <native/timer.h>
#include <native/intr.h>

#define STACK_SIZE 0

RT_INTR isrDesc;

int isrKbdHandler(struct xnintr* _idesc) {

  printk("module: catch a key\n");

return RT_INTR_PROPAGATE;

}

int init_module (void) {

  printk("module: Init\n");
  rt_intr_create(&isrDesc, "kbdisr", (unsigned)1, &isrKbdHandler, NULL, 0);
  rt_intr_enable(&isrDesc);

return 0;
}

void cleanup_module (void) {

  rt_intr_delete(&isrDesc);

printk("module: exit\n");
}

MODULE_LICENSE("GPL");

Makefile:

obj-m = module.o

KDIR = /lib/modules/$(shell uname -r)/build
PWD = $(shell pwd)
EXTRA_CFLAGS = -I/usr/xenomai/include -I/usr/include/ default:

	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules

clean:

	rm -f *.o *.ko *.mod.c *symvers *~

Error message:
make -C /lib/modules/2.6.25.11-default/build SUBDIRS=/home/bhatia/rtprog/interupt modules
make[1]: Entering directory `/usr/src/linux-2.6.25.11'
CC [M] /home/bhatia/rtprog/interupt/module.o
Building modules, stage 2.
MODPOST 1 modules
WARNING: "rt_intr_enable" [/home/bhatia/rtprog/interupt/module.ko] undefined!
WARNING: "rt_intr_create" [/home/bhatia/rtprog/interupt/module.ko] undefined!
WARNING: "rt_intr_delete" [/home/bhatia/rtprog/interupt/module.ko] undefined!
CC /home/bhatia/rtprog/interupt/module.mod.o
LD [M] /home/bhatia/rtprog/interupt/module.ko
make[1]: Leaving directory `/usr/src/linux-2.6.25.11'

Error while insmoding:
insmod: error inserting './module.ko': -1 Unknown symbol in module

Thanks and Regards,

Shashank

-------------------------------------
Hi-Tech Gears Limited, Gurgaon, India

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

#2 lore raw

Thanks a lot, i got my ISR working. I was also looking for some tutorial on RTDM, do you have any source for it ?

Thanks ,
Shashank

Quoted 8 lines · you

Hi,

the rt_intr_* functions are disabled by default in the kernel configuration [1].

You can enable them here:
Real-time subsystem -> Interfaces -> Native API -> Interrupts

Quoted 119 lines

For device drivers its suggested that you use the RTDM skin and not the rt_intr_* calls from the native API.

kisda

[1] https://mail.gna.org/public/xenomai-help/2006-07/msg00197.html

Quoted 111 lines · Shashank Bhatia

Dear All,

I was trying to make a simple kernel module, and was unable to insert it into the kernel space. The code and Error messages are provided hereunder:

Code:
#include <native/task.h>
#include <native/timer.h>
#include <native/intr.h>

#define STACK_SIZE 0

RT_INTR isrDesc;

int isrKbdHandler(struct xnintr* _idesc) {

  printk("module: catch a key\n");

return RT_INTR_PROPAGATE;

}

int init_module (void) {

printk("module: Init\n");
rt_intr_create(&isrDesc, "kbdisr", (unsigned)1, &isrKbdHandler, NULL,
0); rt_intr_enable(&isrDesc);

return 0;
}

void cleanup_module (void) {

  rt_intr_delete(&isrDesc);

printk("module: exit\n");
}

MODULE_LICENSE("GPL");

Makefile:

obj-m = module.o

KDIR = /lib/modules/$(shell uname -r)/build
PWD = $(shell pwd)
EXTRA_CFLAGS = -I/usr/xenomai/include -I/usr/include/ default:

	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules

clean:

	rm -f *.o *.ko *.mod.c *symvers *~

Error message:
make -C /lib/modules/2.6.25.11-default/build SUBDIRS=/home/bhatia/rtprog/interupt modules
make[1]: Entering directory `/usr/src/linux-2.6.25.11'
CC [M] /home/bhatia/rtprog/interupt/module.o
Building modules, stage 2.
MODPOST 1 modules
WARNING: "rt_intr_enable" [/home/bhatia/rtprog/interupt/module.ko] undefined! WARNING: "rt_intr_create" [/home/bhatia/rtprog/interupt/module.ko] undefined! WARNING:
"rt_intr_delete" [/home/bhatia/rtprog/interupt/module.ko] undefined! CC
/home/bhatia/rtprog/interupt/module.mod.o
LD [M] /home/bhatia/rtprog/interupt/module.ko
make[1]: Leaving directory `/usr/src/linux-2.6.25.11'

Error while insmoding:
insmod: error inserting './module.ko': -1 Unknown symbol in module

Thanks and Regards,

Shashank

-------------------------------------
Hi-Tech Gears Limited, Gurgaon, India

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

-------------------------------------
Hi-Tech Gears Limited, Gurgaon, India

#3 lore raw
Quoted 2 lines · Shashank Bhatia

Thanks a lot, i got my ISR working. I was also looking for some tutorial on RTDM, do you have any source for it ?

this helped me to implement a rtdm driver:

1) captain.at: Hard Real Time Driver Example Tutorial with MMAP using the RTDM [1] -> simple examples

2) Ondrej Cevan: Installation and Implementation of Xenomai on an Industrial Component and Porting a Driver for an Industrial IO-Card to the Xenomai Infrastructure [2]
-> See chapter 4 "Linux Driver" and Chapter 5 "Xenomai RTDM Driver"

3) Xenomai Source: ksrc/drivers/*

[1] http://www.captain.at/xenomai-real-time-driver-example.php
[2] http://stud3.tuwien.ac.at/~e0226686/xenomai/xenomai_implementation.pdf

good luck
kisda

Quoted 143 lines

Thanks ,
Shashank

Quoted 8 lines · you

Hi,

the rt_intr_* functions are disabled by default in the kernel configuration [1].

You can enable them here:
Real-time subsystem -> Interfaces -> Native API -> Interrupts

Quoted 119 lines

For device drivers its suggested that you use the RTDM skin and not the rt_intr_* calls from the native API.

kisda

[1] https://mail.gna.org/public/xenomai-help/2006-07/msg00197.html

Quoted 111 lines · Shashank Bhatia

Dear All,

I was trying to make a simple kernel module, and was unable to insert it into the kernel space. The code and Error messages are provided hereunder:

Code:
#include <native/task.h>
#include <native/timer.h>
#include <native/intr.h>

#define STACK_SIZE 0

RT_INTR isrDesc;

int isrKbdHandler(struct xnintr* _idesc) {

  printk("module: catch a key\n");

return RT_INTR_PROPAGATE;

}

int init_module (void) {

printk("module: Init\n");
rt_intr_create(&isrDesc, "kbdisr", (unsigned)1, &isrKbdHandler, NULL,
0); rt_intr_enable(&isrDesc);

return 0;
}

void cleanup_module (void) {

  rt_intr_delete(&isrDesc);

printk("module: exit\n");
}

MODULE_LICENSE("GPL");

Makefile:

obj-m = module.o

KDIR = /lib/modules/$(shell uname -r)/build
PWD = $(shell pwd)
EXTRA_CFLAGS = -I/usr/xenomai/include -I/usr/include/ default:

	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules

clean:

	rm -f *.o *.ko *.mod.c *symvers *~

Error message:
make -C /lib/modules/2.6.25.11-default/build SUBDIRS=/home/bhatia/rtprog/interupt modules
make[1]: Entering directory `/usr/src/linux-2.6.25.11'
CC [M] /home/bhatia/rtprog/interupt/module.o
Building modules, stage 2.
MODPOST 1 modules
WARNING: "rt_intr_enable" [/home/bhatia/rtprog/interupt/module.ko] undefined! WARNING: "rt_intr_create" [/home/bhatia/rtprog/interupt/module.ko] undefined! WARNING:
"rt_intr_delete" [/home/bhatia/rtprog/interupt/module.ko] undefined! CC
/home/bhatia/rtprog/interupt/module.mod.o
LD [M] /home/bhatia/rtprog/interupt/module.ko
make[1]: Leaving directory `/usr/src/linux-2.6.25.11'

Error while insmoding:
insmod: error inserting './module.ko': -1 Unknown symbol in module

Thanks and Regards,

Shashank

-------------------------------------
Hi-Tech Gears Limited, Gurgaon, India

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

-------------------------------------
Hi-Tech Gears Limited, Gurgaon, India