Passing socket struct between kernel threads - module programming
I write kernel module with kernel threads using
linux/kthread.h on 2.6.* kernel
I tried to passing data between two kernel threads
with data argument of kthread_run( fun, data , NAME );
but this is not work I dont know why. I tried many possibility
and nothing works.
So I thought that maybe something like this will work
but not.
Iam sure that fun1 thread was executed before fun2, I used semaphores ( actually completion mechanism ).
Hi everyone,
I am trying to prevent the ehci_hcd kernel module to load at boot time.
Here's what I've tried so far:
1) Add the following line to /etc/modprobe.d/blacklist.conf (as suggested here):
2) Blacklisted the module by adding the following string to
3) Tried to blacklist the module... (0 Replies)
Hi all!
I am trying to register a device in an existing device class, but I am
having trouble getting the pointer to an existing class.
I can create a class in a module, get the pointer to it and then use
it to register the device with:
*cl = class_create(THIS_MODULE, className);... (0 Replies)
hi there
so, i was given an assignment: implement a linux system call that blocks all packets that are sent to a given IP (i have to do it without using iptables)
i'm really new to kernel programming btw (and i'm enjoying it a lot)
so, my syscall is called ip_block() and receives a... (1 Reply)
Hi,
1)i wrote a program which acts lik a client gateway serving clients request and sending probe msg`s to server to chech if its active..
2)both moduels interact when run independently my problem is that when i tr to run them as two different threads in a single program(client_gateway prog to... (4 Replies)
Hi, i'm trying to copy a struct into a binary file using the unix instruction write, so i declare and fill the struct "superbloque" in one function "initSB" and then i pass the pointer to another function called bwrite (for block write) which calls write. The problem is that i call the function... (2 Replies)
EDIT: Nevermind, called a friend who is good at this stuff and he figured it out :D
Hi all,
So I'm trying to teach myself to write programs for unix in c. I am currently creating a program, and I need to pass a struct through a pipe, but I can't figure out how.
The struct I want to pass... (0 Replies)
hi masters,
I am new to kernel programming and learning its trade. I am writing a module for lan bandwidth manager. I designed one module successfully for 2.4 kernel . But when I tried to upgrade it for 2.6 kernel I found that struct tq_struct is missing . Is there any suitable replacement for... (0 Replies)
Hi all,
I am working on USB data monitoring on Fedora Core 9. Kernel 2.6.25 has a built-in module (the one that isn't loadable, but compiles and links statically with the kernel during compilation) to snoop USB data. It is in <kernel_source_code>/drivers/usb/mon/.
I need to know if I can... (0 Replies)
Hi All,
Is there a max number of slabs that can be used per kernel module? I'm having a tough time finding out that kind of information, but the array 'node_zonelists' (mmzone.h) has a size of 5. I just want to avoid buffer overruns and other bad stuff.
Cheers,
Brendan (4 Replies)
Hi Everyone!
How can we make a socket() system call from a linux module executing in kernel space?
If any one knows, kindly tell me. It will be great.
I want to use the socket interface in linux kernel space for sending raw packets over the network.
Hamayun (0 Replies)
unix_master(9r)unix_master(9r)NAME
unix_master - General: Forces execution onto the master CPU
SYNOPSIS
void unix_master(
void );
ARGUMENTS
None
DESCRIPTION
The unix_master routine forces execution of the kernel thread onto the master CPU (also called the boot CPU). In other words, unix_master
binds the kernel thread to the master CPU. To release the kernel thread from the bind to the master CPU, call the unix_release routine. You
can make recursive calls to unix_master as long as you make an equal number of calls to unix_release.
The unix_master routine provides another way besides the simple and complex lock routines to make a kernel module symmetric multiprocessing
(SMP) safe. Although calling unix_master is not optimal for performance on an SMP CPU, it does provide third-party kernel module writers
with an easy way to make their modules SMP safe without using the lock routines.
NOTES
Device drivers should not directly call the unix_master and unix_release routines. One exception to this recommendation is when you want a
device driver's kernel threads to run only on the master CPU. This situation occurs when your driver creates and starts its own kernel
threads and you set the d_funnel member of the associated dsent structure to the value DEV_FUNNEL. In this case, each kernel thread must
call unix_master once to ensure that the kernel thread runs only on the master CPU. Remember to make a corresponding call to unix_release.
CAUTIONS
To avoid deadlock, do not call the unix_master routine under the following circumstances: When holding a simple lock In the driver's inter-
rupt service routine
RETURN VALUES
None
SEE ALSO
routines: unix_release(9r)unix_master(9r)