Linux-kernel mailing list archive 2000-06,: (newbie) Questions on kernel thread and socket interface

# (newbie) Questions on kernel thread and socket interface

Athanasios Papathanasiou (papathan@cs.rochester.edu)
Wed, 9 Feb 2000 22:35:24 -0500 (EST)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Luca Montecchiani: "[2.3.43-pre6] swapon and pppd oops"
- Previous message: James Simmons: "Re: [PATCH] updated vfb.c"
- Next in thread: Tigran Aivazian: "Re: (newbie) Questions on kernel thread and socket interface"
- Reply: Tigran Aivazian: "Re: (newbie) Questions on kernel thread and socket interface"

Hello everybody,

I have a couple of questions about the linux-kernel.
My first one is related to kernel-threads.

Can I create a kernel-thread from a user-level program? I tried to create
a system calll which makes a call to the function to the
kernel_thread(thrad_function, flags), but it does not seem to work
correctly (see next wuestion). Is this a correct approach? My other
question related to kernel threads is if I have to use lock_kernel and
unlock_kernel before and after a call to kernel_thread().

The reason I am creating this thread is because I need a network service
inside the kernel. My idea was to use the kernel thread for receiving
messages from other remote nodes (by blocking on a receive). So for the
network code I tried to use the sys_socket, sys_bind and sys_receivefrom
calls. This approach works correctly if I initiate the thread during the
kernel's intialization, but if I initiate the thread through a system call
the system craches.

The reason for the crash seems to be the call to the move_addr_to_user
function (in the sys_bind) system call. I tried to re-implement the
sys_bind function by duplicating everything except the call to
move_addr_to_kernel. In this case the system did not crash, but the thread
does not receive anything after blocking. -- Athanasios Papathanasiou -
papathan@cs.rochester.edu Graduate Student, Computer Science Dept.
University of Rochester

Thank you in advance,
Thanos Papathanasiou

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

- Next message: Luca Montecchiani: "[2.3.43-pre6] swapon and pppd oops"
- Previous message: James Simmons: "Re: [PATCH] updated vfb.c"
- Next in thread: Tigran Aivazian: "Re: (newbie) Questions on kernel thread and socket interface"
- Reply: Tigran Aivazian: "Re: (newbie) Questions on kernel thread and socket interface"