VirtualBox

Ticket #14927: cbrk_bug.patch

File cbrk_bug.patch, 3.0 KB (added by yjh, 9 years ago)

Patch for correct described BUG

  • src/VBox/Devices/PC/BIOS/keyboard.c

    old new  
    4949#  define BX_DEBUG_INT16(...)
    5050#endif
    5151
     52#if 1 //@todo: should be implement as inline asm?
     53extern void invoke_int1B(void);
     54#endif
     55
    5256extern  void    post(void);
    5357#pragma aux post "*";
    5458
     
    456460        break;
    457461
    458462    case 0x46: /* Scroll Lock press */
     463        if (mf2_state & 0x02) { // Ctrl-Break
     464            uint16_t  buffer_start;
     465            shift_flags |= 0x80;
     466            write_byte(0x0040, 0x17, shift_flags);
     467#if BX_CPU < 2
     468            buffer_start = 0x001E;
     469#else
     470            buffer_start = read_word(0x0040, 0x0080);
     471#endif
     472            write_word(0x0040, 0x001A, buffer_start); // buffer_head
     473            write_word(0x0040, 0x001C, buffer_start); // buffer_tail
     474            enqueue_key(0, 0);
     475#if 0 //@todo: should be implement as inline asm?
     476            ASM_START
     477                push  bp
     478                mov   bp, sp
     479                int   0x1B
     480                pop   bp
     481            ASM_END
     482#else
     483            invoke_int1B();
     484#endif
     485            break;
     486        }
    459487        mf2_flags |= 0x10;
    460488        write_byte(0x0040, 0x18, mf2_flags);
    461489        shift_flags ^= 0x10;
     
    463491        break;
    464492
    465493    case 0xc6: /* Scroll Lock release */
    466         mf2_flags &= ~0x10;
    467         write_byte(0x0040, 0x18, mf2_flags);
     494        if ((mf2_state & 0x02) == 0) {  // not Ctrl-Break released
     495            mf2_flags &= ~0x10;
     496            write_byte(0x0040, 0x18, mf2_flags);
     497        }
    468498        break;
    469499
    470500    case 0x53: /* Del press */
  • src/VBox/Devices/PC/BIOS/orgs.asm

    old new  
    940940                pop     ax
    941941                iret
    942942
     943if 1    ;@todo: should be implement as inline asm?
     944public invoke_int1B_
     945invoke_int1B_:
     946                push    bp
     947                mov     bp, sp
     948                int     1Bh
     949                pop     bp
     950                retn
     951endif
    943952
    944953;; --------------------------------------------------------
    945954;; INT 06h handler - Invalid Opcode Exception
  • src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    old new  
    14311431
    14321432void UIMachineLogic::sltTypeCtrlBreak()
    14331433{
    1434     static QVector<LONG> sequence(4);
     1434    static QVector<LONG> sequence(6);
    14351435    sequence[0] = 0x1d;        /* Ctrl down */
    1436     sequence[1] = 0x46;        /* Break down */
    1437     sequence[2] = 0x46 | 0x80; /* Break up */
    1438     sequence[3] = 0x1d | 0x80; /* Ctrl up */
     1436    sequence[1] = 0xe0;        /* Ctrl-... */
     1437    sequence[2] = 0x46;        /* ...-Break down */
     1438    sequence[3] = 0xe0;        /* Ctrl-... */
     1439    sequence[4] = 0x46 | 0x80; /* ...-Break up */
     1440    sequence[5] = 0x1d | 0x80; /* Ctrl up */
    14391441    keyboard().PutScancodes(sequence);
    14401442    AssertWrapperOk(keyboard());
    14411443}

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy