Re: Problem in sending data between User Space & Kernel Space
Re: Problem in sending data between User Space & Kernel Space
- Subject: Re: Problem in sending data between User Space & Kernel Space
- From: "Arvind Dalvi" <email@hidden>
- Date: Tue, 24 Jul 2007 09:05:26 +0100
JanakiRam,
>I'm passing my custom defined structure from user space to kernel space. If i create the structure member on stack (
i.e char str[15] ="Hello World\0" & data = "" ) , then i'm unable to receive at kernel level.
>But if create memory using malloc then i'm able to access at kernel level.
This is how all nix systems and infact how all OS's will work....
If we forget the kernel space here, and try to run this across two process (process A & B) in user space, you might run into the same problem.....The reason for [might] is because if your call to the function in other process (process B) is synchronous, then the data could be copied over....
But what if they are asynchronous ???
Process A function might reach its completion even before process B gets a chance to receive it...and thus the data on the stack is lost.....
Now if you allocate the same data on the heap using malloc, the data will be available till process A dies....
Now when we jump to kernel space, we always deal asynchronously. Else the entire kernel will be blocked for our application to finish.
I hope you have got it....
Thanks,
Arvind
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden