Ticket #5163: boot_keys.patch
File boot_keys.patch, 1.6 KB (added by , 14 years ago) |
---|
-
src/system/boot/platform/bios_ia32/keyboard.cpp
58 58 extern "C" uint32 59 59 check_for_boot_keys(void) 60 60 { 61 union key key;62 61 uint32 options = 0; 63 64 while ((key.ax = check_for_key()) != 0) { 65 switch (key.code.ascii) { 66 case ' ': 67 options |= BOOT_OPTION_MENU; 68 break; 69 case 0x1b: // escape 70 options |= BOOT_OPTION_DEBUG_OUTPUT; 71 break; 72 case 0: 73 // evaluate BIOS scan codes 74 // ... 75 break; 76 } 62 bios_regs regs; 63 regs.eax = 0x0200; 64 call_bios(0x16, ®s); 65 // Read Keyboard flags 66 // bit 7 Insert, bit 6 CapsLock, bit 5 NumLock, bit 4 Scroll Lock 67 if( (regs.eax & 0x40) != 0 ) { 68 // CapsLock - option menu 69 options |= BOOT_OPTION_MENU; 70 } else if( (regs.eax & 0x10) != 0 ) { 71 // Scroll Lock - debug output 72 options |= BOOT_OPTION_DEBUG_OUTPUT; 77 73 } 78 74 79 75 dprintf("options = %ld\n", options); -
src/system/boot/platform/bios_ia32/start.c
129 129 mmu_init(); 130 130 parse_multiboot_commandline(&args); 131 131 132 // wait a bit to give the user the opportunity to press a key133 spin(750000);134 135 132 // reading the keyboard doesn't seem to work in graphics mode 136 133 // (maybe a bochs problem) 137 134 sBootOptions = check_for_boot_keys();