I’m starting to learn kernel modules programming. To pass any parameter to the kernel module you use module_param( ) macro which i guess work something like dynamic linking method in user space (deffer symbols relocation to run time by kernel modules loader) you can correct me if I’m wrong. Anyways, module_param() takes a permission parameter to specify the read write
Tag: module
Creating a new directory in /dev using udev rule
This is the code snippet responsible for creating the device: My udev rule is the following: From my understanding, this rule should match against the device name given by the kernel module (synchmess) and create the /dev subdirectory “synch”. However, the synchmess device shows under /dev with the correct permissions, but i can’t seem to figure out how to create
Problem running “Hello World” linux module
I’m trying to compile and run a “Hello World” module from the book “Linux Device Drivers” the program ~/ldd3/hello.c I’m trying to compile is: And the Makefile is: When I run make, the compilation seems ok: But when I run : the “Hello World” message doesnt get printed. Nor do I get a message printed when I run Can you
How to avoid double creating directories in /proc?
I’m writing a Linux kernel module, and I’d like to create a subdirectory, /proc/foo/, and then expose several artificial files inside it that will be generated on the fly by my module. I know I can use proc_mkdir to create the foo directory, but if it already exists dmesg will display a warning, and I’d prefer to keep the log
Linux kernel – Context switch when calling function from other module?
I am curious if calling a function from a different module in the Linux kernel triggers a context switch? Basically, I’m doing something like this. Say I have module A: module B: between the two measurements, I’m seeing a gap of up to 2 microseconds (after dividing through the TSC frequency). Could this gap be due to a context switch?
sys/types.h: No such file or directory
I am trying to compile module but get this error. Here is my module file headers And my Makefile I have tried to search for this file Here are results I tried to set it as #include “/usr/include/sys/types.h” but got following error I am using Kali Linux(Debian) AMD64 platform What is wrong ? Thanks SOLVED Sorry this was my fault,
make: Nothing to be done for `all’. when i tried to compile
this is the code of my make file AND I HAVE FEW QUESTIONS we save C language file with extension *.c so for Makefile which extension should we use? When i throw command in terminal “make” it gives me error that make: Nothing to be done for `all’. Answer Probably the file all already exists. As it doesn’t depend on
Python3 error “no module named bluetooth” on Linux Mint
I am trying to connect my Lenovo S10E to a Nintendo Wiimote via bluetooth. I am using a simple Python script, reproduced below. I am calling it from the Linux Mint (version 16, “Petra”) command line using python3 find_wii.py Script: I am receiving the error I have installed bluez and python wrappings for it (sudo aptitude install python-bluez). I have
What’s the difference between insmod and modprobe?
I know insmod and modprobe are used to insert module into the kernel. But, what’s the difference between them? And, why is it dangerous to insert modules with force option in modprobe? Answer modprobe is the intelligent version of insmod. insmod simply adds a module where modprobe looks for any dependency (if that particular module is dependent on any other
How to make my Python module available system wide on Linux?
I made myself a little module which I happen to use quite a lot. Whenever I need it I simply copy it to the folder in which I want to use it. Since I am lazy I wanted to install it so that I can call it from anywhere, even the interactive prompt. So I read a bit about installing