Re: Share a semaphore between process and a kernel task.
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=LqZYAYv/8fVue4/aRsTFGm5RG/3o2jEZJmau0q6Cpe4=; b=G6JVEt9k+aaiDVzcMMFfGSJN8OFVRxB99qi+P8CywyNDWjmiEx7dhOUADR3GwKPgGK jMOqNnsOqg+OY+3Pc4iiVRvvR82mN0dDYPlrHfoDN232OHaivo5qiVvtr6FR9uZj08ws 6jCGxZdUcyOiIjfO7gvm1EC2SYQRe7bhZHyrs= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=FWA4zUn33NnfOHD55zNmrxcU/ZzWUDSLPkJe5coJ/xMozkYQQwSanzRYLhF7u8ZF+g i521iVfHgdmYmd2+8CSGSYSbAdPh+CDLrIO+G1sfar00saZ0IkvL9jnE8qqfmdWHeY3i lKYi95cWlNACYjHiQZEkDQIy84zZ8V131letk= Michael, I am not sure yet what i am trying to do :) I am exploring possibilities. The major task at hand is as follows. I have an IOService in kernel that stores encryption keys and services crypto requests. Don't ask why crypto is in kernel - this is something i can't currently change. There is a large chunk of work that can be precomputed if several requests use the same encryption key (encryption key extension). I want to create a persistent kernel service that precomputes this chunk of work on initialization, shares a memory page with a user process, a mach port and a semaphore. The plan is for user process to initialize this kernel object with a single key then for all further requests put the data to encrypt or decrypt in the shared memory, send a message through mach port and block on the semaphore while kernel processes the data from the shared memory. After completion kernel wakes the user process through the semaphore. The user process then takes encrypted/decrypted data from the same shared memory buffer. This is how similar functionality was implemented on Windows and i was hoping to directly port the same idea on OS X. If there is a better way to do this i would be glad to know. Thanks. Inso Reiges On Sat, Apr 30, 2011 at 10:04 AM, Michael Smith <drivers@mu.org> wrote:
On Apr 29, 2011, at 6:13 AM, Inso Reiges wrote:
Can i share a semaphore between a user space process and a kernel task? If yes, how can i do this?
This is almost always the wrong thing to do. In general, the kernel services requests from user space, it does not compete on equal standing for resources with user space processes. What are you actually trying to do? = Mike -- True terror is to wake up one morning and discover that your high school class is running the country. -- Kurt Vonnegut
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Inso Reiges