Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: virus scan application



On Aug 5, 2007, at 10:07 PM, Jim Clause wrote:

... one question that's never been definitively answered is how the kernel can block and then call out to a user level application.

You may not mean this literally, but just in case...

The kernel does not "call out" to user space. If you think of the issue this way you are likely to make some poor design choices and have a rough time of it.

The correct approach is to have a thread belonging to your background userland app call into your KEXT and block there waiting for something to do. Then, when some other event requires the utility app to do something it can (after arranging for some state or data to be passed to it) unblock that blocked thread. When it's done, it can call into the KEXT and block again.

The key difference is thread ownership. If a kernel thread were to execute userland code and that code were to fault it would be very hard to kill the process and clean up the thread without causing a kernel panic.

By doing this using a blocking user thread this problem is avoided.

Good luck!
-Mike

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-kernel/email@hidden

This email sent to email@hidden
References: 
 >Re: virus scan application (From: "Jim Clause" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.