On 02/02/18 22:45, daniel.johns...@dell.com wrote:
I’m a colleague of Lynn’s and wanted to put my old C experience to use
here, but have hit a snag. I’m attempting to insert my hook early in
iPXE’s execution through __init_fn but it never executes. The debug
text strings don’t even appear in the final binary unless I stuff the
code into something else, like ‘core/device.c’. Am I missing something
in the following code?
The existence of an __init_fn doesn't cause the containing object to be
included in the final binary; it just means that if something _else_
causes that object to be included then the __init_fn will be slotted in
to the "init_fns" table and so the __init_fn will end up being called as
part of initialise().
Since this is one-time debugging code that you're writing, you probably
want to just call your dj1_wrap_init() function directly from the
earliest possible point, i.e. from somewhere within efi_init(). Note
that if it's too early in efi_init() then you may have some unexpected
NULL pointers (e.g. for efi_systab).
ipxe-devel mailing list