iPXE
Functions
fakee820.h File Reference

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
void fake_e820 (void)
void unfake_e820 (void)

Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
void fake_e820 ( void  )

Definition at line 64 of file fakee820.c.

References __asm__(), e820map, hook_bios_interrupt(), int15_fakee820(), real_int15_vector, and TEXT16_CODE.

Referenced by hide_etherboot().

                        {
        __asm__ __volatile__ (
                TEXT16_CODE ( "\nint15_fakee820:\n\t"
                              "pushfw\n\t"
                              "cmpl $0xe820, %%eax\n\t"
                              "jne 99f\n\t"
                              "cmpl $0x534d4150, %%edx\n\t"
                              "jne 99f\n\t"
                              "pushaw\n\t"
                              "movw %%sp, %%bp\n\t"
                              "andb $~0x01, 22(%%bp)\n\t" /* Clear return CF */
                              "leaw e820map(%%bx), %%si\n\t"
                              "cs rep movsb\n\t"
                              "popaw\n\t"
                              "movl %%edx, %%eax\n\t"
                              "addl $20, %%ebx\n\t"
                              "cmpl %0, %%ebx\n\t"
                              "jne 1f\n\t"
                              "xorl %%ebx,%%ebx\n\t"
                              "\n1:\n\t"
                              "popfw\n\t"
                              "iret\n\t"
                              "\n99:\n\t"
                              "popfw\n\t"
                              "ljmp *%%cs:real_int15_vector\n\t" )
                : : "i" ( sizeof ( e820map ) ) );

        hook_bios_interrupt ( 0x15, ( intptr_t ) int15_fakee820,
                              &real_int15_vector );
}
void unfake_e820 ( void  )