Ticket #5113: warm_boot.2.patch
File warm_boot.2.patch, 2.5 KB (added by , 14 years ago) |
---|
-
src/system/boot/platform/bios_ia32/keyboard.h
29 29 extern void clear_key_buffer(void); 30 30 extern union key wait_for_key(void); 31 31 extern uint32 check_for_boot_keys(void); 32 extern void warm_boot(void); 32 33 33 34 #ifdef __cplusplus 34 35 } -
src/system/boot/platform/bios_ia32/bios.S
231 231 ret 232 232 233 233 //-------------------------------------------------------------- 234 /** void warm_boot() 235 * Warm booting computer via BIOS int 0x19. save_crx() have to be called before paging setup. 236 */ 237 FUNCTION(warm_boot) 238 cli 239 movl saved_cr0,%eax 240 movl %eax,%cr0 241 movl saved_cr3,%eax 242 movl %eax,%cr3 243 movl saved_cr4,%eax 244 movl %eax,%cr4 245 lidt saved_idt 246 call switch_to_real_mode 247 .byte 0xCD 248 .byte 0x19 249 ret 250 //-------------------------------------------------------------- 251 /** void save_crx() 252 * Save CRx registers state. Required for warm_boot. 253 */ 254 FUNCTION(save_crx) 255 cli 256 movl %cr0,%eax 257 movl %eax,saved_cr0 258 movl %cr3,%eax 259 movl %eax,saved_cr3 260 movl %cr4,%eax 261 movl %eax,saved_cr4 262 sidt saved_idt 263 ret 264 //-------------------------------------------------------------- 265 .p2align 4 266 saved_idt: 267 .long 0x0 268 .long 0x0 269 saved_cr0: 270 .long 0x0 271 saved_cr3: 272 .long 0x0 273 saved_cr4: 274 .long 0x0 234 275 276 .p2align 4 235 277 .globl idt_descriptor 236 278 idt_descriptor: 237 279 .short 0x7ff // IDT at 0x0, default real mode location -
src/system/boot/platform/bios_ia32/keyboard.cpp
69 69 case 0x1b: // escape 70 70 options |= BOOT_OPTION_DEBUG_OUTPUT; 71 71 break; 72 case 'w': 73 case 'W': 74 warm_boot(); 72 75 case 0: 73 76 // evaluate BIOS scan codes 74 77 // ... -
src/system/boot/platform/bios_ia32/start.c
126 126 serial_init(); 127 127 console_init(); 128 128 cpu_init(); 129 save_crx(); 129 130 mmu_init(); 130 131 parse_multiboot_commandline(&args); 131 132