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.

2228 questions
7
votes
2 answers

How to get use count from Linux kernel module?

I have a problem with use count of kernel module being developed.I'd like to print it for debugging purpose. How can I obtain it from the module code? Kernel version in question - Linux 2.6.32
Basilevs
  • 22,440
  • 15
  • 57
  • 102
7
votes
1 answer

Why should the permisson attrbute be specified for every variable declared in Kernel Module development?

Although we define these variables in the global namespace, why do we need to explicitly specify the permissions for every variable declared. Or is my way of thinking completely wrong? int number = 100; module_param(number, int , 0); //…
bittterbotter
  • 445
  • 6
  • 18
7
votes
2 answers

Why there isn't a munmap callback in struct file_operation?

I'm working on a Linux kernel module which shares a piece of memory with user applications through the syscall mmap. The module works alright with the help of the mmap callback defined in the struct file_operations, which informs the module when the…
liangpig1
  • 171
  • 1
  • 6
7
votes
3 answers

Changing the Interrupt descriptor Table

I am using Linux 2.6.26 kernel version and I am trying to change the interrupt descriptor table using a kernel module. I am only trying to change the page fault table entry here. So I make a copy of the original IDT and make changes to the page…
user213950
7
votes
1 answer

difference between the physical address,device address and virtiual address

What is the difference between device address, physical address and virtual address? Actually I am trying for mmap in drivers, I am stuck on this concept.
user3867504
  • 71
  • 1
  • 7
7
votes
2 answers

modules.usbmap and modules.pcimap missing on Ubuntu-based distro

I have been learning Kernel programming and taking the Eudyptula challenge, and task 5 requires me to modify a hello world module from an earlier task to be automatically loaded when a USB keyboard is plugged, and unloaded when the keyboard is…
Filipe Gonçalves
  • 20,783
  • 6
  • 53
  • 70
7
votes
1 answer

How to get kobject from current module

In Linux kernel, given a module how can I know is it's kobject? Context: I am trying to do a sysfs_create_file(kobj,attr) in a kernel module. I have all the attribute stuff set up, but I want to add an attribute to the current module.
kernelator
  • 131
  • 6
7
votes
2 answers

Difference b/w kthread and work-queues

I am little confused b/w workqueues and kthread when they are created as following- Create kthread for each online CPU and bind to 1 unique CPU for_each_online_cpu(cpu) { kthread = kthread_create(func, ...); kthread_bind(kthread,…
CodeQ
  • 319
  • 1
  • 3
  • 13
7
votes
1 answer

Dump mobile memory

i want to dump my mobiles memory with lime but during the process i faced some problems. 1.Downloaded kernel source and building, zImage is created. 2.Change Makefile for lime as the guide says and then i make lime.(problem in this step despite the…
7
votes
2 answers

Linux Kernel Module (*.ko) compatibility between kernels

I have a simple kernel object that I built for probing around at kernel memory. If I build it on my 64-bit Ubuntu (3.2) machine it works fine on that machine. But it won't insmod on my 64-bit Ubuntu (3.9) machine. And vice versa. It gives me a…
Joe C
  • 2,728
  • 4
  • 30
  • 38
7
votes
2 answers

Can the loading of exported symbols be delayed?

I'm working a few linux kernel modules and have a question related to a circular loading problem. Module A loads first and exports many symbols for module B or C's use. Module B or C then get loaded afterwards and the symbols exist for their…
Ender
  • 1,652
  • 2
  • 25
  • 50
7
votes
2 answers

Finding the kernel address of a loadable kernel module

I'm trying to find the kernel address space where my loadable kernel module is relocated by insmod. I came to know that by using the -m, -O switches while insmod'ing the module, we can only see the symbol table and the executable's sections'…
freax
  • 169
  • 1
  • 5
  • 12
7
votes
2 answers

kernel module, while being called from one process, writes to a page from another process

I am writing a kernel module that is to be called by process p1 to overwrite a data page that belongs to a target process p2. First, inside the kernel module and while responding to a write event to proc file system issued by p1. I used the process…
7
votes
3 answers

How much information is actually stored in a file descriptor?

This may sound like an odd question, but when I go and open a file: int fd; fd = open("/dev/somedevice", O_RDWR); What exactly am I getting back? I can see the man page says: The open() function shall return a file descriptor for the named file…
Mike
  • 47,263
  • 29
  • 113
  • 177
7
votes
3 answers

kernel module parameters changes (using /sys/module)

I have some questions concerning the /sys/module/ in linux Does the /sys/module contain all modules of kernel Does the /sys/module/xxx/parameters contains all parameters of the kernel module xxxx Does the /sys/module/xxx/parameters/yyyy contain…
MOHAMED
  • 41,599
  • 58
  • 163
  • 268