VirtualBox

Opened 3 years ago

#20997 new defect

Scancode returned by int15h call in BIOS keyboard handler(int09h) is ignored.

Reported by: Yamu Owned by:
Component: other Version: VirtualBox 5.2.34
Keywords: BIOS Cc:
Guest type: other Host type: Linux

Description

Keyboard scancode is handled as below:
in int09_handler ( src/VBox/Devices/PC/BIOS/orgs.asm )
(step1) get a scancode from keyboard hardware.
(step2) execute pusha(save the scancode in al into the stack).
(step3) call int15h(ah=04fh) to be able to modify the scancode.
(step4) call _int09_function to process the scancode.

in int09_function ( src/VBox/Devices/PC/BIOS/keyboard.c )
(step5) get the scancode from the stack saved at (step2)

So, the scancode modified at (step3) is ignored.

Here is the code snippet(from VirtualBox-6.1.34.tar.bz2):

[src/VBox/Devices/PC/BIOS/orgs.asm]
  int09_handler:
          ...
          in      al, KBC_DATA  ;(step1)
          push    ds
          DO_pusha      ;<===(step2) save scancode in AL
          cld
          mov     ah, 4Fh
          stc
          int     15h   ; (step3)
          ...
  int09_process_key:
          push    es
          C_SETUP
          call    _int09_function ; (step4)

[src/VBox/Devices/PC/BIOS/keyboard.c]
  void BIOSCALL int09_function(uint16_t ES, uint16_t DI, uint16_t SI, uint16_t BP, uint16_t SP,
                               uint16_t BX, uint16_t DX, uint16_t CX, uint16_t AX)
  {
    ...
    scancode = GET_AL();  // <===(step5) get scancode from the stack

[src/VBox/Devices/PC/BIOS/biosint.h]
  #define BIOSCALL    __cdecl
  #define GET_AL() ( AX & 0x00ff )

Change History (0)

Note: See TracTickets for help on using tickets.

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