linux-kernel

What options do we have for communication between a user program and a Linux Kernel Module?

I am a new comer to Linux Kernel Module programming. From the material that I have read so far, I have found that there are 3 ways for a user program to request services or to communicate with a Linux Kernel Module a device file in /dev a file in /proc file system ioctl() call Question: What other options do we have for communicatio...

Question Regarding Linux kernel book

Hello guys, I have a question regarding Linux kernel books.Currently I am reading Understanding Linux Kernel 3rd edition. But most of my friends recommended me Linux kernel development3rd editon. In order to buy that book it costs me 40$ for me. So any one who have read both the books can tell me is it worth owning a second book and w...

How to use netlink socket to communicate with a kernel module?

I am trying to write a linux kernel module that communicates with user process using netlink. I am using netlink because the user program I want to communicate to communicates only using sockets and I cant change that to add ioctl() or anything. Problem is that I cant figure out how to do that. I have googled but all examples I found ar...

Help monitoring battery status through SMBus

I am currenlty trying to monitor my battery status through SMBus. I have a battery along with a contorl board which constantly outputs the battery status. This control board is then connected to my mother board through a I2C-USB module. I need to write some program to recognize the SMBus connection and transmit the battery status to the ...

Poll is causing crash

Hi, I am getting a crash with following values :- Poll is the system call in use giving "errno" as 24 (EMFILE) and struct pollfd has values "fd = 1022, events = 1, revents = 32" Here we are woking on "fd = 1022" then why it is showing "errno" as 24 (EMFILE /Too many files open/) I have multiple threads which works in an Infinite loop...

Whose responsibility is it to free sk_buff

While creating a netlink socket using netlink_kernel_create() a function pointer is passed as argument to this function which is called when a message is received on this socket. This call back function receives an sk_buff as parameter which contains the message received. My question is that whose responsibility is it to free this sk_bu...

Question regarding Unix/Linux kernel programming

Hello guys, I would like to learn about linux/Unix kernel programming for scalable multi processors (smps). I found this book UNIX(R) Systems for Modern Architectures http://www.amazon.com/UNIX-Systems-Modern-Architectures-Multiprocessing/dp/0201633388/ref=pd_rhf_p_t_3 . Is there any other good resources or a better book since its relea...

Minimun Stable Linux Kernel

Hi, I need to compile a minimun minimun minimun minimun linux kernel, I mean, with the basic and generic modules to get it work on low resources machines. Is there any specification of the minimun modules that a kernel must have to acomplish my needs??? The unique requirement is that it must be stable. Where can I find information ...

Developing a 64 bit kernel module on a 32 bit distro

My development machine has a 64 bit proc, running a 32 bit distribution. I would like to compile and test a kernel module with a 64 bit kernel. My question is : Is there a 64 bit liveCD with kernel development package included ? If it does not exist, How can I build a module for a 64 bit kernel ? Then I can eventually test it with a li...

Mapping DMA buffers to userspace

hi everybody, i am writing a device driver on linux-2.6.26. I want to have a dma buffer mapped into userspace for sending data from driver to userspace application. Please suggest some good tutorial on it. Thanks ...

ksoftirqd consumes >80% CPU on embedded platform

Hi we're designing SOHO router based on MIPS processor, wired up with 24-ports switch. The CPU runs NAT (configured with iptables), iptables rules, dhcp etc. it doesn't have any H/W acceleration for these functions. When testing NAT in full-mesh mode (i.e. one WAN port and others are LAN port), we observe the significant system's slowdo...

Linux Multi-Threaded Performance Enhancements for File open()

Hello all, I’m working on tuning performance on a high-performance, high-capacity data engine which ultimately services an end-user web experience. Specifically, the piece delegated to me revolves around characterizing multi-threaded file IO and memory mapping of the data to local cache. In writing test applications to isolate the tim...

What's actually in the Managed Runtime Initiative's kernel patches and JVM?

http://managedruntime.org/ is pretty sparse on what exactly are in the tarballs and why users would want them. http://lwn.net/Articles/392307/ has some more details, but the author also isn't sure what the memory management modules actually do. Apparently the high-level goal is to reduce GC pauses, but I'd be interested in (pointers to) ...

spin_lock on non-preemtive linux kernels

I read that on a system with 1 CPU and non preemtive linux kernel (2.6.x) a spin_lock call is equivalent to an empty call, and thus implemented that way. I can't understand that: shouldn't it be equivalent to a sleep on a mutex? Even on non-preemtive kernels interrupt handlers may still be executed for example or I might call a function...

Assembly, hello world question

I'm learning asm on Linux (noobuntu 10.04) I got the following code off of: http://asm.sourceforge.net/intro/hello.html section .text global _start ;must be declared for linker (ld) _start: ;tell linker entry point mov edx,len ;message length mov ecx,msg ;message to write mov ebx,1 ;file descriptor (stdout) mov eax,4 ;system call numb...

How can I record system calls (including related parameters) of an application from the kernel?

Hi ,guys I want to record system calls (including parameters) invoked by an application from the kernel. Somebody told me I can hook all system calls or hook the sysenter, however, I don’t know how to do it. By the way, I have tried the strace utility, but it seemed that the strace provided me more system calls than what I expected. For ...

Extend the witdh of base address in 386 segment selector to excess the 4GB RAM limit in 32-bit OS?

As the memory requirement grows fast, today more and more system requires 64-bit machines to access even larger RAM. FWIK in 386 protected mode, a memory pointer consists of two part: the base address (32-bit) specified by a segment selector, and the offset address (32-bit) added to the base address. To re-compile all programs in 64-...

Multiple queueing and working queues

I'm learning the Work queues to code bottom halves in the linux kernel. I wonder: if the interrupt handler is executed two times (thus calling schedule_work two times), does the work queue handler be called once or twice? ...

How do you keep track of your progress while reading about a new technology or language?

I just started reading an book on Linux kernel in my free time. Its my first book on this topic so to me everything seems important so I got overloaded by the information very soon. I have tried to quit many times but really cant as I love this subject. My question for all the experts here is how you tackle this while reading new topic/...

Are there any memory restrictions on Linux Kernel Modules?

Are there any restrictions on memory usage by a Linux Kernel Module i.e Code Segment size or amount of global memory or any thing. ...