I'm porting a linux kernel module. It used to create a device file for itself (using dirty hacks with syscalls from kernelspace), but now I want to do this in udev. Where can I find documentation on supporting udev in in kernel module?
Note that module itself is not a device driver. It serves as a multiplexor for a set of drivers. There...
How to write a kernel module that creates a directory in /proc named mymod and a file in it name is mymodfile. This file should accept a number ranged from 1 to 3 when written into it and return the following messages when read based on the number already written into it:
• 1: Current system time (in microseconds precision)
• 2: System ...
I was trying to capture keyboard events.
e.g. I want to drill down a keylogger from the scratch.
After 2 hours of fighting I found the following
neel@pc1$ ls -l /dev/input/by-id
lrwxrwxrwx 1 root root 9 2010-05-05 21:33 usb-Plus_More_Enterprise_LTD._USB-compliant_keyboard-event-kbd -> ../event1
lrwxrwxrwx 1 root root 9 2010-05-05 21:33 ...
In Linux, when you make a blocking i/o call like read or accept, what actually happens?
My thoughts: the process get taken out of the run queue, put into a waiting or blocking state on some wait queue. Then when a tcp connection is made (for accept) or the hard drive is ready or something for a file read, a hardware interrupt is raised ...
i have 4 processes:
p1 - bursts 5, priority: 3
p2 - bursts 8, priority: 2
p3 - bursts 12, priority: 2
p4 - bursts 6, priority: 1
Assuming that all processes arrive at the scheduler at the same time what is the average response time and average turnaround time?
For FCFS is it ok to have them in the order p1, p2, p3, p4 in the executi...
I am trying to run an app which is using a kernel mode driver. System locks up every hour and the only way to recover it is a hard reset. Sysrq stops responding, telnet sessions hang and there are no error messages of any kind. Unfortunately the board does not have ejtag support. I have been trying to isolate it functionally, but this is...
Hi everyone,
I'm trying to compile a simple Kernel program that read and write from a proc file.
I'm trying to set permission to that file by overriding the permission fp in inode_operations struct (.permission)
static int module_permission(struct inode *inode, int op, struct nameidata *foo)
{
. . .
}
static struct inode_opera...
Performance counters for Linux are a new kernel-based subsystem that provide a framework for all things performance analysis. It covers hardware level (CPU/PMU, Performance Monitoring Unit) features and software features (software counters, tracepoints) as well.
Since 2.6.33, the kernel provide 'perf_event_create_kernel_counter' kernel ...
If I see the output of cat /proc//smaps, I find that there are some memory regions with which no read/write/execute permissions have been associated. Also these region are mapped to inode number 0.
I wanted to know how does a region end up in such a state? Is it some sort of memory leak?
Can these regions be ever used again by the proc...
In ARM linux, the user-kernel virtual address range is divided in the ratio 3:1.
But in MIPS linux, this is usually 2:2
Does someone know what motivates this design difference ?
I have a faint idea that this has something to do with the fact that in MIPS, the TLB refill is managed in s/w and the kernel TLB entries are kind of hard...
Hi guys, I'm here to ask you the difference between a process and a thread in linux. I know that a thread for linux is just a "task", which shares with the father process things that they need to have in common (the address space and other important informations). I also know that the two are creating calling the same function ('clone()'...
On a Linux device (using Android [Eclair] with a 2.6.29 kernel), I seem to have some contents in my cache that never go away.
I would like to be able to examine the contents of my cache to find the culprit. I've looked at mount for any tmpfs that may be causing it, but they are taking up very little space.
What other types of things co...
Hi Kernel Gurus,
I'm currently writing a simple "multicaster" module.
Only one process can open a proc filesystem file for writing, and the rest can open it for reading.
To do so i use the inode_operation .permission callback, I check the operation and when i detect someone open a file for writing I set a flag ON.
i need a way to det...
I've written a Linux device driver for a PCI device. This device performs DMA operations. An issue arise when the program crashes when a DMA operation is running.
Indeed, when crashing, the device_remove() function is called by the system (as if close() were called). This function does the cleanup on the memory regions used by the PCI d...
Hello,
I have recently been trying to familiarize myself with the Linux Networking stack and device drivers (have both similarly named O'Reilly books) with the eventual goal of offloading UDP. I have already implemented UDP on the NIC but now the hard part...
Rather than ask for assistance on this larger goal I was hoping someone coul...
I run massively parallel scientific computing jobs on a shared Linux computer with 24 cores. Most of the time my jobs are capable of scaling to 24 cores when nothing else is running on this computer. However, it seems like when even one single-threaded job that isn't mine is running, my 24-thread jobs (which I set for high nice values)...
Hi,
I'm writing a kernel module that reads from a /proc file.
When someone writes into the /proc file the reader will read it, but if it reads again while there is no "new" write, it should be blocked.
In order to remember if we already read, i need to keep a map of the latest buffer that process read.
To avoid that, I was told that th...
I'm porting android to Devkit8000 which is a BeagleBoard clone. I have a GPS module connected on /dev/ttyS0. I could successfully get NMEA output when writing "cat /dev/ttyS0" in the terminal emulator.
I want to know how to let android know that there is a GPS module on /dev/ttyS0 and it is outputting NMEA standard? To be able to use th...
I'm trying to implement user threads on a 2.4 Linux kernel (homework) and the trick for context switch seems to be using an alarm that goes off every x milliseconds and sends us to an alarm handler from which we can longjmp to the next thread. What I'm having difficulties with is figuring out how to save the environment to return to late...
I'm trying to figure out how to block a signal in Linux kernel 2.4 (user space) from invoking its handler, but keep it available to be handled later, preferably as soon as I re activate the handling of said signal.
The function sigprocmask seem to come up in all my search results, but I can't find a good, clear description that explain...