LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-23-2016, 04:31 AM   #1
AliVatankhah
LQ Newbie
 
Registered: May 2016
Posts: 1

Rep: Reputation: 0
insmod gets error


I'm writing a kernel module that receives interrupts for mpc8308 (PowerPC) board. when I make the code for Ubuntu and my current version of kernel it works well with interrupt of keyboard, but when I Cross build it for mpc8308 board (2.6.29.6 kernel) and I want to load it into kernel with insmod command I get error:

insmod: cannot insert './intrpt.ko': Function not implemented
my code is:
Code:
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/interrupt.h>

#define DRIVER_AUTHOR "AVM"
#define DRIVER_DESC "A sample driver"

static irqreturn_t irq_handler(int irq, void *dev_id, struct pt_regs *regs)
{
  printk(KERN_ALERT "Hello Interrupt world.\n");
  return IRQ_HANDLED;
}
/*
* Initialize the module − register the IRQ handler
*/
int init_module()
{
  free_irq(1, NULL);
  return request_irq(1, irq_handler, IRQF_SHARED, "test_keyboard_irq_handler",
                    (void *)(irq_handler));
}
/*
* Cleanup
*/
void cleanup_module()
{
  free_irq(1, NULL);
}

MODULE_LICENSE("GPL");
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_SUPPORTED_DEVICE("testdevice");
and output of modinfo ./intrpt.ko is:

filename: ./intrpt.ko
description: A sample driver
author:
license: GPL
depends:
vermagic: 2.6.29.6-rt23 mod_unload
 
Old 05-24-2016, 03:47 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,568

Rep: Reputation: 164Reputation: 164
Not sure if you're missing something in your code, it looks mostly fine. However, have you tried to insert any module in the kernel? Are you sure that dynamic modules are supported in your kernel image? There is a kernel config option to enable/disable dynamic modules.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
insmod error xakeriah Linux - Newbie 6 09-17-2006 08:57 AM
insmod error 98steve600 Linux - General 1 03-28-2005 04:50 AM
Insmod error Horos23 Linux - Software 2 01-27-2005 11:28 AM
insmod error cstringer18 Linux - Newbie 1 03-01-2004 05:15 PM
insmod error Rex_chaos Linux - General 4 05-17-2002 11:43 PM


All times are GMT -5. The time now is 10:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration