|
Hi all, I am writing a module driver and have run into a problem and
just wanted to check I’m not doing anything stupid! I am not currently using the latest SVN version I am using
an export from the 25/2/09 – I am in the process of updating to the
latest version. I have made an example which on my system causes an illegal
instruction Oops: --------------------------------------- #include <linux/kernel.h> #include <linux/init.h> #include <linux/module.h> MODULE_AUTHOR("Ian Whitmore"); MODULE_DESCRIPTION("Discovery communications
example"); MODULE_LICENSE("Dual BSD/GPL"); static void test1(void); static void test2(void); static int __init startGoing(void) { printk("I'm in startGoing\n"); test1(); test1(); return 0; } static void __exit stopGoing(void) { printk("I'm in stopGoing\n"); test1(); test1(); return; } static void test1(void) { printk("I'm in test1\n"); test2(); test2(); //If
this call is commented out the module does not crash! return; } static void test2(void) { printk("I'm in test2\n"); return; } module_init(startGoing); module_exit(stopGoing); This is the error message I get: # insmod discovery-module.ko I'm in startGoing Oops: Exception in kernel mode, sig: 4 Registers dump: mode=8816FEC0 r1=88038130, r2=8809408C, r3=00000015, r4=FFFFFFFF r5=881605A4, r6=00000001, r7=FFFFFFFF, r8=00000000 r9=23410000, r10=00000049, r11=00000000, r12=84000000 r13=8F023B10, r14=88096654, r15=8F5881B0, r16=881788F8 r17=881787DC, r18=00000000, r19=8802651C, r20=881788E0 r21=00000001, r22=881788F8, r23=00000001, r24=00000004 r25=00000001, r26=88004598, r27=8818172C, r28=8813F808 r29=88178904, r30=00000000, r31=00000000, rPC=88175968 msr=00000000, ear=00000000, esr=880020B4, fsr=00000A33 Illegal instruction --------------------------------------- If I comment out the 2nd call to test2() the
module does not crash: --------------------------------------- # insmod discovery-module.ko I'm in startGoing I'm in test1 I'm in test2 I'm in test1 I'm in test2 # Has anyone got any ideas? Ian. PS. sorry about the footer to this email – It’s
a work address and I can’t get rid of it!!! The information contained in this E-Mail and any subsequent
For those other than the recipient any disclosure, copying, Emails and other electronic communication with QinetiQ may be Telephone calls to QinetiQ may be monitored or recorded for quality
QinetiQ Limited |