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?

/* Relevant includes: */
#include <stdio.h>
#include <errno.h>
#include <ipxe/efi/efi.h>
#include <ipxe/init.h>

/* Skipping the meat of the hook/wrap code */

static void dj1_wrap_init(void) {
        printf("DJ1_wrap_init - Called\n");
        /* The start/stop logic depends on this value being NULL when we start 
*/
        dj1_orig_FreePool = NULL;

        /* CAUTION: If this is uncommented we enable wrapping for ALL of these 
calls! */
        dj1_wrap_start();
}

/**
* Prepare for FreePool wrapping - This tells core/init.c to call dj1_wrap_init()
*/
struct init_fn dj1_efi_wrap_init_fn __init_fn ( INIT_EARLY ) = {
        .initialise = dj1_wrap_init,
};



Daniel Johnson
Master Engineer, Enterprise Solutions Support Team
Dell EMC | Global Support & Deployment
Office +1-512-728-0913
daniel.johns...@dell.com<mailto:daniel.johns...@dell.com>

My work schedule is 07:00 am - 6:00 pm Wednesday-Saturday CT.
Customer feedback | How am I doing? Please contact my manager 
steve.k...@dell.com<mailto:steve.k...@dell.com>

_______________________________________________
ipxe-devel mailing list
ipxe-devel@lists.ipxe.org
https://lists.ipxe.org/mailman/listinfo.cgi/ipxe-devel

Reply via email to