Jump to preloaded bootsector.
65 {
67
68
70
72
73
78
79
80
81
82
83
84
86 "popw %%cs:saved_retaddr\n\t"
87
88 "movw %%ss, %%ax\n\t"
89 "movw %%ax, %%cs:saved_ss\n\t"
90 "movw %%sp, %%cs:saved_sp\n\t"
91
92 "movl %%ebp, %%cs:saved_ebp\n\t"
93
94 "pushw %%bx\n\t"
95 "pushw %%di\n\t"
96
97 "xorl %%eax, %%eax\n\t"
98 "xorl %%ebx, %%ebx\n\t"
99 "xorl %%ecx, %%ecx\n\t"
100
101 "xorl %%esi, %%esi\n\t"
102 "xorl %%edi, %%edi\n\t"
103 "xorl %%ebp, %%ebp\n\t"
104 "movw %%ax, %%ds\n\t"
105 "movw %%ax, %%es\n\t"
106 "movw %%ax, %%fs\n\t"
107 "movw %%ax, %%gs\n\t"
108
109 "sti\n\t"
110 "lret\n\t"
111
112 "\nsaved_ebp: .long 0\n\t"
113 "\nsaved_ss: .word 0\n\t"
114 "\nsaved_sp: .word 0\n\t"
115 "\nsaved_retaddr: .word 0\n\t"
116
117 "\nbootsector_exec_fail:\n\t"
118
119 "movl %%cs:saved_ebp, %%ebp\n\t"
120
121 "movw %%cs:saved_ss, %%ax\n\t"
122 "movw %%ax, %%ss\n\t"
123 "movw %%cs:saved_sp, %%sp\n\t"
124
125 "jmp *%%cs:saved_retaddr\n\t" )
126 :
"=b" ( discard_b ),
"=D" (
discard_D ),
127 "=d" ( discard_d )
130 : "eax", "ecx", "esi" );
131
132 DBG (
"Booted disk returned via INT 18 or 19\n" );
133
134
139
141}
__asm__ __volatile__("call *%9" :"=a"(result), "=c"(discard_ecx), "=d"(discard_edx) :"d"(0), "a"(code), "b"(0), "c"(in_phys), "D"(0), "S"(out_phys), "m"(hypercall))
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.
static struct segoff int19_vector
Vector for storing original INT 19 handler.
static struct segoff int18_vector
Vector for storing original INT 18 handler.
void bootsector_exec_fail(void)
Restart point for INT 18 or 19.
uint16_t offset
Offset to command line.
#define DBG(...)
Print a debugging message.
uint8_t drive
Drive number.
#define ECANCELED
Operation canceled.
static void console_reset(void)
Reset console.
#define REAL_CODE(asm_code_str)
uint16_t segment
Code segment.
__asm__(".section \".rodata\", \"a\", " PROGBITS "\n\t" "\nprivate_key_data:\n\t" ".size private_key_data, ( . - private_key_data )\n\t" ".equ private_key_len, ( . - private_key_data )\n\t" ".previous\n\t")