[syslinux] EFI: HP + syslinux = crash

Oscar Roozen oscar.roozen at brightcomputing.com
Wed Aug 5 08:42:29 PDT 2015


[ merging a few sub-threads into one ]

 > Weird as it sounds I was able to send debug info to COM2
 > (redirected to a pipe) on EFI64 VMware workstation clients.

Ports 0x3f8 and 0x2f8 are so hardwired into my brain from back in the 
old BBS-days that I did not expect them NOT to work. Apparently some 
firmware engineers have this problem too. ;-)


 >>>>
 >   If there is nothing yet, I think a wrapper around printf
 >   (and *prinf) is
 >   needed. This should [v]sprintf() to a buffer and then print the
 >   resulting buffer using APrint("%a", buffer) if EFI_BUILD is
 >   defined.
 > <<<
 > It sounds logical.

Even Print("%a", buf) would work. I first used APrint() because the 
format string for it is a const char *, whereas Print() expects a const 
unsigned short * pointing to an unicode string. But then I found that 
any %s in both format string formats, also expects unicode strings. To 
print a good old ascii string, one needs to use %a. A "#define printf 
APrint" did not work very well because of this.



On 05-08-15 16:47, Patrick Masotta wrote:
 > This is a big issue. Probably lot of code doing this in EFI...mmmhhh
 > You can try redirecting printf to an empty function and see if it
 > crashes the same way..

I'm quite sure it isn't the printf that causes the crashing. It just 
doesn't appear. At one time I had this in efi/main.c:

         if (!setjmp(load_error_buf)) {
                 printf("Is printf still working?\n");
                 Print(L"Entering: load_env32\n");
                 load_env32(NULL);
         }

The output for this is:

| Entering: load_env32

The printf's i put in load_env32 itself didn't output anything either, 
but now i can see the output of dprintf's on COM2.

(Grammar question, is printf's the correct plural of printf?)


 > I would try with a minimalistic (1 entry) menu

I am doing that just now.


More information about the Syslinux mailing list