iPXE
|
#include <realmode.h>
Go to the source code of this file.
Macros | |
#define | hooked_bios_interrupts __use_text16 ( hooked_bios_interrupts ) |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
uint16_t | __text16 (hooked_bios_interrupts) |
Hooked interrupt count. More... | |
void | hook_bios_interrupt (unsigned int interrupt, unsigned int handler, struct segoff *chain_vector) |
Hook INT vector. More... | |
int | unhook_bios_interrupt (unsigned int interrupt, unsigned int handler, struct segoff *chain_vector) |
Unhook INT vector. More... | |
void | check_bios_interrupts (void) |
Dump changes to interrupt vector table (for debugging) More... | |
#define hooked_bios_interrupts __use_text16 ( hooked_bios_interrupts ) |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
uint16_t __text16 | ( | hooked_bios_interrupts | ) |
Hooked interrupt count.
At exit, after unhooking all possible interrupts, this counter should be examined. If it is non-zero, it means that we failed to unhook at least one interrupt vector, and so must not free up the memory we are using. (Note that this also implies that we should re-hook INT 15 in order to hide ourselves from the memory map).
void hook_bios_interrupt | ( | unsigned int | interrupt, |
unsigned int | handler, | ||
struct segoff * | chain_vector | ||
) |
Hook INT vector.
interrupt | INT number |
handler | Offset within .text16 to interrupt handler |
chain_vector | Vector for chaining to previous handler |
Hooks in an i386 INT handler. The handler itself must reside within the .text16 segment. chain_vector
will be filled in with the address of the previously-installed handler for this interrupt; the handler should probably exit by ljmping via this vector.
Definition at line 24 of file biosint.c.
References code, copy_from_real, copy_to_real, DBG, DBG_HDA, DBG_LOG, hooked_bios_interrupts, interrupt(), segoff::offset, rm_cs, segoff::segment, and vector.
Referenced by bios_inject_startup(), call_bootsector(), fake_e820(), hide_etherboot(), hook_comboot_interrupts(), int13_hook_vector(), pxe_activate(), rtc_hook_isr(), and undinet_hook_isr().
int unhook_bios_interrupt | ( | unsigned int | interrupt, |
unsigned int | handler, | ||
struct segoff * | chain_vector | ||
) |
Unhook INT vector.
interrupt | INT number |
handler | Offset within .text16 to interrupt handler |
chain_vector | Vector containing address of previous handler |
Unhooks an i386 interrupt handler hooked by hook_i386_vector(). Note that this operation may fail, if some external code has hooked the vector since we hooked in our handler. If it fails, it means that it is not possible to unhook our handler, and we must leave it (and its chaining vector) resident in memory.
Definition at line 69 of file biosint.c.
References copy_from_real, copy_to_real, DBG, EBUSY, hooked_bios_interrupts, interrupt(), segoff::offset, rm_cs, segoff::segment, and vector.
Referenced by bios_inject_shutdown(), call_bootsector(), int13_unhook_vector(), pxe_deactivate(), rtc_unhook_isr(), undinet_unhook_isr(), unfake_e820(), unhide_etherboot(), and unhook_comboot_interrupts().
void check_bios_interrupts | ( | void | ) |
Dump changes to interrupt vector table (for debugging)
Definition at line 98 of file biosint.c.
References copy_from_real, dbg_printf(), memcmp(), memcpy(), offset, segment, and vector.