Kernel space sockets

2005-03-18 Thread Josef E. Galea
Hi,
I'm trying to implement a UDP server in a kernel module. So far I have 
created the struct socket using sock_create_kern(), and used 
sock->ops->bind() on it. Now how do I send UDP datagrams? I looked at 
some code and found the function sock->ops->sendmsg() but I can't figure 
out where to put the destination address. I would appreciate it if 
someone could point me to some tutorial or sample code.

Thanks,
Josef
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Kernel space sockets

2005-03-18 Thread Josef E. Galea
Juergen Quade wrote:
On Fri, Mar 18, 2005 at 02:53:31PM +0100, Josef E. Galea wrote:
 

Hi,
I'm trying to implement a UDP server in a kernel module. So far I have 
created the struct socket using sock_create_kern(), and used 
sock->ops->bind() on it. Now how do I send UDP datagrams? I looked at 
some code and found the function sock->ops->sendmsg() but I can't figure 
out where to put the destination address. I would appreciate it if 
someone could point me to some tutorial or sample code.
   

Maybe the sample code on this (german) site helps:
http://ezs.kr.hsnr.de/TreiberBuch/Artikel/index.html
Look at "Folge" 16.
 Juergen.
 

Thanks :)
Josef
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


init process and task_struct

2005-02-25 Thread Josef E. Galea
Hi,
Does the init process have a task_struct associated with it, and if yes 
where is this structure created?

Thanks
Josef
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


System call problem

2005-02-26 Thread Josef E. Galea
Hi,
I am implemeting a new system call for a project I'm working on. I added 
the system call to the file arch/i386/kernel/process.c and added the 
relevant entries in the files arch/i386/entry.S and 
include/asm-i386/unistd.h. My system call is made up of only two lines, 
a printk statement, and a return statement which gets the value of a 
field that I added to the task_struct structure.

I compiled and booted the kernel and am trying to build a user space 
application that uses my system call, however gcc is returning this error:
/tmp/cc4zgzUr.o(.text+0x4e): In functiono `get_rmt_paging':
: undefined reference to `errno'

Can anyone help me with this?
Thanks
Josef
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: System call problem

2005-02-26 Thread Josef E. Galea
Steven Rostedt wrote:
On Sat, 2005-02-26 at 15:17 +0100, Josef E. Galea wrote:
 

I compiled and booted the kernel and am trying to build a user space 
application that uses my system call, however gcc is returning this error:
/tmp/cc4zgzUr.o(.text+0x4e): In functiono `get_rmt_paging':
: undefined reference to `errno'

   

Where you defined your system call in the user space program (ie. where
you declared your _syscall macro), did you also include ?
-- Steve
 

I included  and it didn't solve the problem. Now i 
included  and it did. Thanks for you help!

Josef
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Sending IP datagrams

2005-03-07 Thread Josef E. Galea
Hi,
Is there any way, other than socket buffers, to send IP datagrams from a 
kernel module? If yes, can you please point me to some good tutorial or 
sample code

Thanks
Josef Galea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Sending IP datagrams

2005-03-07 Thread Josef E. Galea
Scott Feldman wrote:
On Mar 7, 2005, at 3:48 PM, Josef E. Galea wrote:
Hi,
Is there any way, other than socket buffers, to send IP datagrams 
from a kernel module? If yes, can you please point me to some good 
tutorial or sample code

See net/core/pktgen.c for an example.
-scott
AFAIK that module uses socket buffers (struct sk_buff) to send the 
packets. I was asking whether there was another way to send the IP 
datagrams.

Thanks for your reply :)
Josef
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


EXPORT_SYMBOL question

2005-03-28 Thread Josef E. Galea
Hi,
I have 2 modules. The first one uses EXPORT_SYMBOL to make some function 
available to other modules. These prototypes for these functions were 
also put in a header file. Now the second module uses the functions the 
functions defined in the first module by and includes the afore 
mentioned header file. However when i'm compiling the module, I get a 
symbol underfined warning. When I load the module it works as expected. 
Is there any way to get rid of these warnings.

Another problem I'm having is that when I load the second module I get 
`no version for "rbnode_initialize" found: kernel tainted.' 
(rbnode_initialize is one of the functions exported by the first 
module). Both MODULE_LICENSE("GPL"); and MODULE_VERSION are declared in 
the two modules. Is there anything I'm missing?

Thanks
Josef Galea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: EXPORT_SYMBOL question

2005-03-28 Thread Josef E. Galea
Sam Ravnborg wrote:
On Mon, Mar 28, 2005 at 01:10:35PM +0200, Josef E. Galea wrote:
 

Hi,
I have 2 modules. The first one uses EXPORT_SYMBOL to make some function 
available to other modules. These prototypes for these functions were 
also put in a header file. Now the second module uses the functions the 
functions defined in the first module by and includes the afore 
mentioned header file. However when i'm compiling the module, I get a 
symbol underfined warning. When I load the module it works as expected. 
Is there any way to get rid of these warnings.

Another problem I'm having is that when I load the second module I get 
`no version for "rbnode_initialize" found: kernel tainted.' 
(rbnode_initialize is one of the functions exported by the first 
module). Both MODULE_LICENSE("GPL"); and MODULE_VERSION are declared in 
the two modules. Is there anything I'm missing?
   

You need to compile both modules at the same time.
Do something like this for your two modules foo and bar:
modules/Makefile
obj-y := foo/ bar/
modules/foo/<= Your foo module
modules/bar/<= Your bar module
Then when building the modules stay in modules/ and
execute:
make -C  M=`pwd`
And to install modules:
make -C  M=`pwd` modules_install
Sam
 

Thanks for your help. That solved both the warnings and the kernel 
tainted message.

Josef
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Linux virtual memory manager

2005-03-31 Thread Josef E. Galea
Hi,
Can someone point me to a document explaining the differences between 
the 2.4 and the 2.6 virtual memory manager. Particularly I am looking 
for the function/s that replaces the try_to_swap_out() in the 2.6.x 
series of kernels.

Thanks
Josef
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/