VirtualBox

Changeset 75233 in vbox


Ignore:
Timestamp:
Nov 2, 2018 6:22:20 PM (6 years ago)
Author:
vboxsync
Message:

BIOS: Improved CMOS shutdown code path to avoid possible memory corruption and other nasties.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/BIOS/orgs.asm

    r75229 r75233  
    214214endif
    215215
     216;; Keyboard related constants
     217KBDC_DISABLE    EQU     0ADh
     218KBDC_ENABLE     EQU     0AEh
     219KBC_CMD         EQU     64h
     220KBC_DATA        EQU     60h
     221
     222
    216223;; NOTE: The last 8K of the ROM BIOS are peppered with fixed locations which
    217224;; must be retained for compatibility. As a consequence, some of the space is
     
    250257
    251258eoi_jmp_post:
    252                 call    eoi_both_pics
     259;; Calling eoi_both_pics can't be done because it writes to stack, potentially
     260;; corrupting memory. AT BIOS also only clears the master PIC, not both.
     261                ;; clear keyboard buffer (and possible interrupt)
     262                in      al, KBC_DATA
     263                mov     al, PIC_CMD_EOI
     264                out     PIC_MASTER, al
     265
    253266no_eoi_jmp_post:
    254                 xor     ax, ax
     267                mov     ax, 40h
    255268                mov     ds, ax
    256                 jmp     dword ptr ds:[0467h]
     269                jmp     dword ptr ds:[67h]
    257270
    258271seg_40_value:   dw 40h ;; Replaces a push 40; pop ds.
     
    353366check_next_std:
    354367
     368                mov     sp, 400h
    355369                ;; 05h = EOI + jump through 40:67
    356370                cmp     al, 5
     
    945959
    946960
    947 KBDC_DISABLE    EQU     0ADh
    948 KBDC_ENABLE     EQU     0AEh
    949 KBC_CMD         EQU     64h
    950 KBC_DATA        EQU     60h
    951 
    952961;; --------------------------------------------------------
    953962;; INT 09h handler - Keyboard ISR (IRQ 1)
Note: See TracChangeset for help on using the changeset viewer.

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