Re: Understanding kexts in the early boot process
Re: Understanding kexts in the early boot process
- Subject: Re: Understanding kexts in the early boot process
- From: Nik Gervae <email@hidden>
- Date: Mon, 15 Jun 2009 10:28:04 -0700
On 14 Jun, 2009, at 14:38, Thomas Tempelmann wrote:
Question 4: How does the mkext, if loaded separately, get linked to
the kernel? (i.e. does the boot loader contain a linker that works
like the kextcache command?)
The kernel contains a linker that handles this.
If the kernel contains a linker to link in the kexts, that means that
it's also the kernel that initializes them, I suppose. Correct?
Perhaps there's some confusion over what you mean by "initialize"
here. Initialization would be one step in loading a kext, which
happens after linking.
However, on q 2 you replied that the bootloader parses kexts.
What I haven't seen yet is the part that links the kexts (apparently
loaded by the boot loader) to the kernel. Does the boot_args struct
have a new parameter (not doc'd in Amit's book) which passes a pointer
to a list of loaded kexts to the kernel, or how does this work?
Again some confusion in terminology. The boot loader copies kexts into
memory that the kernel knows how to find, it does not load kexts (in
the sense of getting them actually running, as it does for the
kernel). To "load a kext" is a pretty involved process, which varies
between early boot and when kextd starts, of which linking is only a
part.
Shantonu's reference to the libsa/catalogue.cpp file definitely where
you want to start.
Background is this: It appears that a 3rd party boot loader is able to
load two sets of kexts from different locations and get them used by
the kernel. I try to understand how that works, because so far all I
learned was that there's only one single group of kexts that the
kernel sees, not several.
I have no idea what they are doing in their boot loader; as Shantonu
said, you'll have to ask them.
I'm a bit of a stickler on terminology as one of the implementers of
the kext loading stack, and people often come to me with questions
about many distinct things using the single word "load" for them
all. :-)
--Nik
_______________________________________________
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