Index: /trunk/src/VBox/Devices/PC/BIOS/orgs.asm
===================================================================
--- /trunk/src/VBox/Devices/PC/BIOS/orgs.asm	(revision 75232)
+++ /trunk/src/VBox/Devices/PC/BIOS/orgs.asm	(revision 75233)
@@ -214,4 +214,11 @@
 endif
 
+;; Keyboard related constants
+KBDC_DISABLE    EQU     0ADh
+KBDC_ENABLE     EQU     0AEh
+KBC_CMD         EQU     64h
+KBC_DATA        EQU     60h
+
+
 ;; NOTE: The last 8K of the ROM BIOS are peppered with fixed locations which
 ;; must be retained for compatibility. As a consequence, some of the space is
@@ -250,9 +257,15 @@
 
 eoi_jmp_post:
-                call    eoi_both_pics
+;; Calling eoi_both_pics can't be done because it writes to stack, potentially
+;; corrupting memory. AT BIOS also only clears the master PIC, not both.
+                ;; clear keyboard buffer (and possible interrupt)
+                in      al, KBC_DATA
+                mov     al, PIC_CMD_EOI
+                out     PIC_MASTER, al
+
 no_eoi_jmp_post:
-                xor     ax, ax
+                mov     ax, 40h
                 mov     ds, ax
-                jmp     dword ptr ds:[0467h]
+                jmp     dword ptr ds:[67h]
 
 seg_40_value:   dw 40h ;; Replaces a push 40; pop ds.
@@ -353,4 +366,5 @@
 check_next_std:
 
+                mov     sp, 400h
                 ;; 05h = EOI + jump through 40:67
                 cmp     al, 5
@@ -945,9 +959,4 @@
 
 
-KBDC_DISABLE    EQU     0ADh
-KBDC_ENABLE     EQU     0AEh
-KBC_CMD         EQU     64h
-KBC_DATA        EQU     60h
-
 ;; --------------------------------------------------------
 ;; INT 09h handler - Keyboard ISR (IRQ 1)
