On Apr 30, 2005, at 6:57 AM, John Dalgliesh wrote:
Please don't do this. Load your firmware as part of the kext and
then drop it,
or load it with a startup item, but please don't make any assumptions
about
the state of the filesystem inside your kext.
So KUNCExecute is out too? It uses the filesystem. This just gets
better
and better.
The entire KUNC* family of functions should be avoided when possible;
they exist primarily as a sop to driver authors unwilling to
structure their
driver architecture naturally.
Since they're implemented using exactly the model I'm describing, the
only real difference is that because they're hopelessly generic and
restricted you get bad UE and poor customisation.
Maybe that is because there isn't a good solution to it yet? I know
that
on linux, drivers only stopped reading files in the kernel when the
hotplug system was introduced.
How is this relevant, other than to demonstrate that despite the best
efforts of the system developers, third parties will continue to ignore
sensible advice?
And I was only using APIs in ways that other parts of the kernel were.
You're not part of the kernel; you're a third-party component. When
changes are made to the kernel, it can be updated in lock-step.
The only parts of the kernel that do file-level I/O are the ones that
provide basal services. Otherwise, why does the system have
inetd, cron, or the shell? After all, I'm sure the kernel could just
launch
services and interpret commands directly.
There's a division of labour in the system; one part of that division
is that you don't do anything in the kernel that can reasonably be
done outside it.
The other thread describes why I can't compile it into a kext (no
permission from copyright owner) and why a startup item is
inappropriate
(PCMCIA cards; also PCI cards only activated/initialised on demand).
No, it doesn't. There's absolutely no reason why you need firmware
in-core unless you have legitimately set OSBundleRequired to LocalRoot;
for every other application a startup item watching for device
arrival is
more than adequate.