Re: File Access with VFS
Re: File Access with VFS
- Subject: Re: File Access with VFS
- From: Godfrey van der Linden <email@hidden>
- Date: Fri, 11 Apr 2003 11:50:24 -0700
Actually Scott,
This is good news.
There are 3 major phases in a boot.
1> The firmware. For a driver to work here it MUST have an open
firmware driver, i.e. Forth The firmware is actually 2 phases as
well. First the rom loads the OS relocator and loader, i.e. the OS
Booter. The OSBooter then loads the kernel and all drivers (kexts)
that claim to be required i.e. all drivers that have the appropriate
OSBundleRequired settings.
2> The boot to single user. This phase of the boot starts the OS
proper up, i.e. VM, threading and Unix Init, and brings enough of the
system up to mount the root device, usually the disk but if we have a
firmware enabled network driver then we can 'netboot'. This part of
the boot is what I was loosely calling the boot and where we are
confusing nomenclature.
3> The remainder of the boot to multi-user, aka login window. This
phase does many jobs but briefly it loads all drivers that aren't
required for the root device or single user. Then it mounts the
non-root filesystems and starts the networking up.
So stage three is still a boot loaded driver but it isn't the same as
being required for rooting, sorry for the confusion.
Stage three is where your driver is should load. Fortunately IOKit
is designed for exactly this phase. Load you driver normally as a
'late' loadable kext. Then setup a StartupItem, see
/System/Library/StartupItems for an example on how do to this.
I recommend using the IO
Service::setProperties subclass to get the
load the firmware.
Your driver will overload this function, and your startup script will
discover the driver in the registry and send down a firmware by using
the IORegistryEntrySetCFProperties() function. The data will be read
into your helper APPs memory, or mapped if you wish to use mmap().
Then you wrap the address in a CFData object. In the kernel you grab
the corresponding OSData object and create an IOMemoryDescriptor for
the current_task() in your setProperty.
There is an example of a simple implementation of
IO
Service::setProperties in the IOSerialFamily/IOSerialBSDClient.cpp.
Yes this example is a User Client but remember that the setProperties
call can be passed to ANY object in the registry.
I know I have been a little handwavy in my descriptions here. This
technique will work but you will have to do some research. If you
have any questions don't hesitate.
Godfrey
At 11:25 -0700 03-4-11, Scott Lance wrote:
The device is a 802.11g cardbus adapter. No I don't think that this driver
is netbootable, as for the firmware, I didn't write it, it was obtained from
the company who made the chip (as will be all the updates). In anycase I
would like to be able to turn on my laptop with the card in and have it load
during boot time (as for it being required, yes it is, and well lets just
say I don't make those decisions) ;)
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.