25 struct segoff *chain_vector ) {
31 DBG (
"Hooking INT %#02x to %04x:%04x\n",
34 if ( ( chain_vector->
segment != 0 ) ||
35 ( chain_vector->
offset != 0 ) ) {
37 DBG (
"...already hooked\n" );
42 sizeof ( *chain_vector ) );
43 DBG (
"...chaining to %04x:%04x\n",
70 struct segoff *chain_vector ) {
73 DBG (
"Unhooking INT %#02x from %04x:%04x\n",
78 DBG (
"...cannot unhook; vector points to %04x:%04x\n",
83 DBG (
"...restoring to %04x:%04x\n",
86 sizeof ( *chain_vector ) );
99 static struct segoff vectors[256];
105 for ( i = 0; i < (
sizeof ( vectors ) /
sizeof ( vectors[0] ) ); i++ ) {
112 "%04x:%04x\n", i, vectors[i].
segment,
uint16_t segment
Code segment.
#define EBUSY
Device or resource busy.
void check_bios_interrupts(void)
Dump changes to interrupt vector table (for debugging)
uint32_t vector
MSI-X vector.
static unsigned int code
Response code.
void hook_bios_interrupt(unsigned int interrupt, unsigned int handler, struct segoff *chain_vector)
Hook INT vector.
int unhook_bios_interrupt(unsigned int interrupt, unsigned int handler, struct segoff *chain_vector)
Unhook INT vector.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
#define hooked_bios_interrupts
uint16_t offset
Offset to command line.
#define DBG(...)
Print a debugging message.
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
void interrupt(int intr, struct interrupt_frame32 *frame32, struct interrupt_frame64 *frame64)
Interrupt handler.
void dbg_printf(const char *fmt,...)
Print debug message.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)