[ipxe-devel] PXE API - nbp start function questions

Michael Brown mbrown at fensystems.co.uk
Mon Jun 30 14:07:34 UTC 2014

On 29/06/14 13:41, Yossef Efraim wrote:
> Few questions regarding pxe_start_nbp function
> (arch/i386/interface/pxe/pxe_call.c)  - inline asm code:
> 1.Why STI command is used ?

git blame arch/i386/interface/pxe/pxe_call.c shows that this was 
introduced in commit


Without remembering the details, I'm assuming that PXE NBPs generally 
expect to be started with interrupts enabled.

> 2.Why we have “esi” & “ebp”  At the clobber list ( ::: XXX) ? , using
> real mode debugger I noticed that esi , ebp values have changed prior to
> 0x7c00 far call:

"ebp" is not in the clobber list, unless you're using an old version of 
iPXE.  As of a year ago in commit


we no longer place "ebp" in any clobber lists, because it triggers a bug 
in some versions of gcc.  We now explicitly save and restore %ebp in the 
inline asm instead.

PXE NBPs may change any register values; hence any register not used as 
an output operand must be specified as clobbered.

> As you can see – cx holds the code segment , EDI & EBX holds !PXE &
> PXENV+ addresses and ESI , EBP values are not clear (at least to me). I
> would expect ESI value to equal ECX as first asm command is (in the
> inline asm )  : */"movw %%cx, %%es\n\t", /*

%esi and %es are completely different registers.


More information about the ipxe-devel mailing list