Questions tagged [kernel-module]

A kernel module is a run-time loadable object file that is loaded into operating system kernel to add functionality to a running kernel. Examples include device drivers and other kernel items.

2005 questions
107
votes
2 answers

Read/write files within a Linux kernel module

I know all the discussions about why one should not read/write files from kernel, instead how to use /proc or netlink to do that. I want to read/write anyway. I have also read Driving Me Nuts - Things You Never Should Do in the Kernel. However, the…
Methos
  • 10,908
  • 11
  • 41
  • 47
76
votes
7 answers

Is there a way to figure out what is using a Linux kernel module?

If I load a kernel module and list the loaded modules with lsmod, I can get the "use count" of the module (number of other modules with a reference to the module). Is there a way to figure out what is using a module, though? The issue is that a…
mipadi
  • 359,228
  • 81
  • 502
  • 469
54
votes
5 answers

How to recompile just a single kernel module?

Usually kernel source are stored in /usr/src/linux-2.6.x/. To avoid to recompile the entire kernel if I modify a module's source, how can I recompile just that module?
user1056635
  • 735
  • 2
  • 9
  • 12
49
votes
3 answers

How do I configure modprobe to find my module?

I'm trying to get a kernel module to load at boot. If I run insmod /path/to/module.ko, it works fine. But this has to be repeated every time I reboot. If I run modprobe /path/to/module.ko, it can't find the module. I know modprobe uses a…
sep332
  • 950
  • 2
  • 12
  • 24
42
votes
2 answers

What is the opposite of `mknod`?

I am learning to write character device drivers from the Kernel Module Programming Guide, and used mknod to create a node in /dev to talk to my driver. However, I cannot find any obvious way to remove it, after checking the manpage and observing…
merlin2011
  • 63,368
  • 37
  • 161
  • 279
33
votes
6 answers

Cross compiling a kernel module

I'm trying to cross compile a helloworld kernel (2.6.x) module for ARM architecture on my intel x86 host. The codesourcery tool chain for ARM is located at: /home/ravi/workspace/hawk/arm-2009q3 The kernel source is located at…
32
votes
4 answers

What is a Kernel thread?

i am just started coding of device driver and new to threading, went through many documents for getting an idea about threads. i still have some doubts. what is a kernel thread ?. how it differs from user thread ?. what is the relationship…
tijin
  • 657
  • 1
  • 6
  • 12
28
votes
4 answers

kvm: module verification failed: signature and/or required key missing - tainting kernel

I'm using Ubuntu 14.04 LTS and kernel version 3.13.11.4. I'm trying to load patched KVM modules kvm and kvm-intel and I'm getting the following errors kvm: module verification failed: signature and/or required key missing - tainting kernel …
user2743
  • 1,303
  • 1
  • 17
  • 31
27
votes
6 answers

How to compile a kernel module for Raspberry pi?

I'm having trouble compiling a kernel module for a raspberry pi. I want to compile a "hello world" kernel module using the raspberry pi itself. I am using raspbian wheezy 3.6.11+. I tried following the directions at…
user3025582
  • 319
  • 1
  • 4
  • 8
25
votes
2 answers

Difference between printk and pr_info

What's the exact difference between printk and pr_info functions ? And under what conditions, should I choose one over the another ?
Jarvis
  • 8,020
  • 3
  • 23
  • 51
23
votes
5 answers

linux kernel module linker warnings: "*** Warning: [] undefined!" - any way to get rid of them?

While compiling Linux kernel modules that depend on each other, linker gives undefined symbol warnings like Building modules, stage 2. MODPOST *** Warning: "function_name1" [module_name] undefined! *** Warning: "function_name2" [module_name]…
Gary
  • 321
  • 1
  • 2
  • 8
22
votes
2 answers

How to find the list of processes using a particular kernel module?

When I try to rmmod a module I get the error message "Error: Module in use" , lsmod | grep shows the count. Is there a way that would tell me which processes are using this particular kernel module/driver?
Raj
  • 309
  • 2
  • 4
  • 13
22
votes
3 answers

How to stop Linux kernel threads on rmmod?

I wrote the following code to create a kernel thread: #include #include #include #include #include struct task_struct *task; int data; int ret; int thread_function(void…
pradeepchhetri
  • 2,688
  • 6
  • 26
  • 45
21
votes
5 answers

How to load Linux kernel modules from C code?

I have an application that has both two external kernel modules and a userspace daemon. I want to load the modules from the daemon code, written in C, at startup, and unload them on clean exit. Can I load them in a cleaner way than doing…
Prof. Moriarty
  • 491
  • 1
  • 4
  • 9
21
votes
5 answers

How to get current hour (time of day) in linux kernel space

I'm writing a kernel module that checks to see if the time is between two specified hours, and disables input if it is. This has to do with me wanting to make sure I go to bed early. (I know I could also use any number of different techniques…
Tom Macdonald
  • 5,763
  • 7
  • 36
  • 56
1
2 3
99 100