When i write a infrared remote control driver, I have to control delay accurate time during enabling and disabling PWM. At first i used udelay() function in kernel, but i found it’s not accurate at all as i said in another post AFAIK, other timeout functions provided by kernel can’t provide accurate time because of scheduler, when timeout, kernel still
Tag: linux-kernel
How to have a separate kernel parameter for a newly created network namespace under Linux?
I am creating a new network namespace called OAM, along wit the veth interfaces to communicate between the new namespace and the default namespace: Now I check the value of ip_default_ttl parameter from within the default namespace: It is set to 64. Next I check the same parameter in the newly created OAM namespace: So, there isn’t a copy of
How to add poll function to the kernel module code?
As I know, to inform the user space from kernel space, one way is to using poll. That means kernel driver should provide poll method first. Below code is found from internet, and it really works! I can do like this to make it work: And then to see the result. But how to add poll method to it? I
Audio Channel change/swap automatically
I am working with digital TV in Linux platform. Currently I am facing with one issue in audio. When I give stereo audio to Function and after long time running the audio channels get swapped. That is, right channel audio hearing in Left channel and Left in Right. I dumped the PCM data in to a file before giving to
C program works on my Ubuntu VM terminal but not on school Linux server?
I have this C program that runs perfectly on my Ubuntu Virtual Machine but does not run at all(doesn’t prompt user for input, just finishes) on the school Linux server. School Linux version: Linux 2.6.18-371.9.1.e15 x86_64 My Ubuntu VM version: Linux 3.16.0-33-generic x86_64 Here is the program: Any idea why this is?? P.S. thanks to those who helped me with
How to change kernel timer frequency?
I wanted to change kernel option on kernel timer frequency. So i found this, it is saying that i can change the configuration via /boot/config-‘uname -r’ (And i also found the post saying unless it builds a tickless kernel – CONFIG_NO_HZ=y i couldn’t change timer frequency but mine is set to CONFIG_NO_HZ=y) And it is also mentioning how to calculate
When using PF_PACKET type of socket, what does PACKET_ADD_MEMBERSHIP?
When using a PF_PACKET type of socket with protocol type ETH_P_IP, the man packet documentation talks about a socket option for multicast. The socket option is PACKET_ADD_MEMBERSHIP. Assuming you use PACKET_ADD_MEMBERSHIP socket option on a PF_PACKET socket correctly, what features and benefits and use cases is this socket option for? Right now I receive all incoming IP packets so I
How does kbuild actually work?
When i’m developing a linux driver, i’ve read about how to write linux kbuild makefile through this document I know kbuild system use makefile variables such as obj-y obj-m to determine what to build and how to build. But what i’m confused about is where does kbuild system really execute build process.In a word, if i have obj-m = a.o,
Failed to execute /init
I am trying to build a basic root filesystem using Buildroot, for an embedded system (the Banana PI D1). I am using a kernel from an SDK supplied by the SoC vendor. From this repo I am using only the kernel, found in src/kernel. There’s nothing remarkable about the Buildroot configuration. It builds with no errors and the resulting root
linux kernel module: kernel method undefined (kthread_create_on_cpu)
The method is defined in kthread.c file and prototyped in kthread.h. But it is not exported. In my driver I want to start a kthread on a given CPU, so I do: I can compile but I get linkage error on resolving module symbols on MODPOST: How should I proceed? How to import this symbol or what to do instead?