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
5
votes
2 answers

Sending SKB's for transmission from kernel space

I am currently writing a kernel module that modifies packet payloads as a learning experience. I have the packet modifications done, but now I want to send out this new modified packet after the original (I don't want to drop the original). I…
MacStation
  • 411
  • 4
  • 20
5
votes
0 answers

FreeBSD module debugging - cannot access memory at address

I am trying to hack/understand the nullfs kernel module (on FreeBSD) so to that end, I do the following: On the target machine: kldstat gives: Id Refs Address Size Name 1 10 0xffffffff80200000 17e10c8 kernel 2 1…
AjB
  • 890
  • 13
  • 34
5
votes
1 answer

Load kernel module from mac os sierra host to a docker container

I've juste installed a custom kernel module to enable SCTP support on my Macbook And I would like to load this kernel module inside my docker container. I tried to start a container using the --cap-add SYS_MODULE flag and install the libsctp-dev…
Razaborg
  • 151
  • 1
  • 7
5
votes
1 answer

How to fix : No rule to make target?

I am trying to build a demo kernel module, but when I do make, I get following, make[1]: Entering directory '/usr/src/linux-headers-4.4.0-47-generic' make[2]: *** No rule to make target 'arch/x86/entry/syscalls/syscall_32.tbl', needed by…
Sagar
  • 2,315
  • 7
  • 25
  • 34
5
votes
4 answers

Linux kernel module compiling

I try to compile simple linux kernel module: #include #include int init_module(void) { printk("Hello world 1.\n"); return 0; } void cleanup_module(void) { printk(KERN_ALERT…
0xAX
  • 20,957
  • 26
  • 117
  • 206
5
votes
1 answer

Source code of keyboard driver of linux

I have been working on making my own keyboard driver for linux. So I came accross these two links: usbkbd.c and atkbd.c. Now I am confused which of these is the actual code driving my keyboard at the present. As I see it atkbd.c is quite gory and…
paramvir
  • 276
  • 4
  • 22
5
votes
1 answer

Creating new system calls via KLD in FreeBSD

Are there any good (entry-level) tutorials on adding system calls to FreeBSD via kernel loadable modules? Specifically, the required form of the methods, getting information from processes, etc.
dckrooney
  • 3,041
  • 3
  • 22
  • 28
5
votes
1 answer

Performance profiling a KEXT

How to measure performance impact of a kext in OS X in terms of CPU, memory or thread usage during some user defined activities ? Any particular method tool that can be use from user land ? OR any approach/method that can be considered?
5
votes
0 answers

Virtual address to physical address translation in Linux proc module

I'm trying to create my own proc node "os_pagemap" on Linux(using odroid) This node's goal is to print all physical memory page's information. (sudo cat /proc/os_pagemap) Like this : [PHY] Virt 483252 Phy 266908 VMA 0 PID 5773 PNAME…
BlakStar
  • 147
  • 2
  • 11
5
votes
2 answers

How to get details of all modules / drivers that were initialized / probed during the Linux kernel boot?

I need the sequence of modules/drivers that are invoked|initialized|probed during the kernl boot. Can you please let me know if any flash command-line option available to get this sequence ?
Raj
  • 1,013
  • 2
  • 11
  • 23
5
votes
3 answers

Address mapping of PCI-memory in Kernel space

I'm trying to read and write to and PCI-device from a loadable kernel module. Therefore I follow this post: pci_enable_device(dev); pci_request_regions(dev, "expdev"); bar1 = pci_iomap(dev, 1, 0); // void iowrite32(u32 val, void __iomem…
Alex44
  • 3,597
  • 7
  • 39
  • 56
5
votes
2 answers

no rule to make target for simple hello module

So I am trying to write a simple hello module no need to say a newbie :) however while following steps to create a make file - what I saw was I didnot have build folder at uname -r/build so I created one - not sure that itself should be problem as…
thedreamer
  • 319
  • 1
  • 5
  • 13
5
votes
2 answers

Can I have more than 32 netlink sockets in kernelspace?

I have several kernel modules which need to interact with userspace. Hence, each module has a Netlink socket. My problem is that these sockets interfere with each other. This is because all of them register to the same Netlink address family…
Yd Ahhrk
  • 1,088
  • 12
  • 24
5
votes
2 answers

"Segmentation fault" when `rmmod` or `modprobe -r`

Trying the simplest kernel module from LDD3 without any modification on custom built kernel v4.1.0-rc6 for Beagle Bone board with BusyBox v1.23.0. The code for the module is as follows: #include #include…
Eugene Sh.
  • 17,802
  • 8
  • 40
  • 61
5
votes
1 answer

Different privileges in kernel module execution

I have two places in a kernel module (Linux 3.13): One is module_init The other is code I hook with running an invalid opcode (by hacking interrupt description table). My code is to enable hardware performance counter. When I put it in…
Richard
  • 14,642
  • 18
  • 56
  • 77