Re: creating process from kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



prasanna wakhare (prasannawakhare@xxxxxxxxx) wrote:
> Hi ,
> You can do that rather there is tutorial on how to do
> socket programming from kernel space by Allesandro
> rubini.
> Somthing like this.
>         int error;
>         static int sockfd;
>         static struct completion startup =   
> [... snip ... ]
>                
> pid=kernel_thread(sock_thread,&startup,0);
> although  abovs code snippet is for simple UDP data
> transfer.
> I dont think much difference for 
> tcp data transfer as well.

If I remember, you could find in kernelnewbies archive a good example of
how use socket... in kernel space. My remember tells me thats is something
like a kernel thread with send datetime in broadcast mode within UDP
patckets.

Good search ...

	http://marc.theaimsgroup.com/?l=kernelnewbies&m=107117544928518&w=2

So :
Kernel Thread: 
	http://www.scs.ch/~frey/linux/kernelthreads.html
	http://www.ar.linux.it/docs/ksys/ksys.html
Networking in kernel:
	http://web.tiscali.it/bellucda/randomhacks/knetlog-stat.tgz

After it is _your_ work.

	~Christophe

> --- jhoney jhoney <jhoney_joney@xxxxxxxxxxxxxx> wrote:
> > Hello All,
> > 
> > I am calling socket function (sock_*) from the
> > kernel. In my work no application is being run,
> > everything should be done from the kernel only. The
> > actual application runs on other boad and
> > communicates with the pci add-on card which runs
> > linux and I have to make use of the TCP/IP stack.To
> > test this I have written one server programe which
> > is running from the kernel.
> > 
> > I faced the following problem. when I connected more
> > than two clients from other machine to the server
> > progarm, it is getting hanged, I guess it is due to
> > the accept() function.
> > 
> > But in actual application program, the process is
> > going to block until the accept returns. Since I do
> > not have any application, how to simulate this. 
> > 
> > I had one plan of using kernel threads for accept.
> > will it be appropriate?
> > 
> > Can I create process from the kernel so that for
> > each connection , process is going to block when
> > accept is called .
> > 
> > Thanks in advance.
> > 
> > Regards
> > Jhoney


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux