Re: Accessing to a file from a KEXT
Re: Accessing to a file from a KEXT
- Subject: Re: Accessing to a file from a KEXT
- From: Quinn <email@hidden>
- Date: Mon, 9 May 2005 15:15:24 +0100
At 13:07 -0700 3/5/05, Mike Smith wrote:
As John noted in his followup, this approach is strongly frowned upon.
Let me try to explain why it's frowned upon...
The issue here is one of dependency. Once you're inside the kernel,
you should try to avoid taking dependencies on user space code. The
problem with opening files from kernel code is that you can't control
where the file is coming from (it may require a user space process to
service the request, like for WebDAV). The makes the approach
inherently dangerous.
There are also issues with resource management. The kernel squirrels
away certain resources to try to ensure that it can make progress
under pathological load conditions. If your kernel code 'leaves' the
kernel and then comes back in, you're double dipping from that pool,
which can cause the system to run out of these resources, which never
ends well.
Obviously this is a guideline. In some cases there's no way to avoid
this sort of thing. However, be mindful of what Mike wrote:
At 13:07 -0700 3/5/05, Mike Smith wrote:
Since you need to rev your driver for Tiger anyway, consider taking a
little extra time to do it the right way...
The most common reason for why folks want to open a file from within
the kernel is that they're writing a driver and they want to download
a large firmware image to the device. There are other ways to solve
this problem. If that's what you're trying to do, let us know and
we'll outline them.
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden