mirror of
https://github.com/FDOS/kernel.git
synced 2025-12-09 06:00:15 +01:00
entry.asm: fix Critical Error caller 386 registers
Fixes #210, fixes #212
This commit is contained in:
parent
032523a2bb
commit
6094067574
@ -135,6 +135,8 @@ irp_hi equ 26
|
|||||||
; error 1 2 3
|
; error 1 2 3
|
||||||
%macro Protect386Registers 0
|
%macro Protect386Registers 0
|
||||||
%endmacro
|
%endmacro
|
||||||
|
|
||||||
|
%assign Size386Registers 0
|
||||||
|
|
||||||
%macro RestoreSP 0
|
%macro RestoreSP 0
|
||||||
mov sp, bp
|
mov sp, bp
|
||||||
@ -151,8 +153,10 @@ irp_hi equ 26
|
|||||||
push gs
|
push gs
|
||||||
%endmacro
|
%endmacro
|
||||||
|
|
||||||
|
%assign Size386Registers 4
|
||||||
|
|
||||||
%macro RestoreSP 0
|
%macro RestoreSP 0
|
||||||
lea sp, [bp-4]
|
lea sp, [bp - Size386Registers]
|
||||||
%endmacro
|
%endmacro
|
||||||
|
|
||||||
%macro Restore386Registers 0
|
%macro Restore386Registers 0
|
||||||
@ -176,8 +180,10 @@ irp_hi equ 26
|
|||||||
pop dx
|
pop dx
|
||||||
%endmacro
|
%endmacro
|
||||||
|
|
||||||
|
%assign Size386Registers 6
|
||||||
|
|
||||||
%macro RestoreSP 0
|
%macro RestoreSP 0
|
||||||
lea sp, [bp-6]
|
lea sp, [bp - Size386Registers]
|
||||||
%endmacro
|
%endmacro
|
||||||
|
|
||||||
%macro Restore386Registers 0
|
%macro Restore386Registers 0
|
||||||
|
|||||||
@ -611,6 +611,8 @@ CritErr05:
|
|||||||
mov bp,sp
|
mov bp,sp
|
||||||
push si
|
push si
|
||||||
push di
|
push di
|
||||||
|
Protect386Registers
|
||||||
|
|
||||||
;
|
;
|
||||||
; Get parameters
|
; Get parameters
|
||||||
;
|
;
|
||||||
@ -659,6 +661,13 @@ CritErr05:
|
|||||||
;
|
;
|
||||||
cld
|
cld
|
||||||
cli
|
cli
|
||||||
|
Protect386Registers
|
||||||
|
; ecm: The extended stack frame must be restored here
|
||||||
|
; in case the response isn't Abort. The int 21h handler
|
||||||
|
; will expect the extended stack frame to be still
|
||||||
|
; intact, but the stack written by the int 24h (even
|
||||||
|
; only the int instruction) will have overwritten it.
|
||||||
|
|
||||||
mov bp, [cs:_DGROUP_]
|
mov bp, [cs:_DGROUP_]
|
||||||
mov ds,bp
|
mov ds,bp
|
||||||
mov ss,bp
|
mov ss,bp
|
||||||
@ -672,7 +681,13 @@ CritErr05:
|
|||||||
pop word [es:PSP_USERSP]
|
pop word [es:PSP_USERSP]
|
||||||
pop word [es:PSP_USERSS]
|
pop word [es:PSP_USERSS]
|
||||||
mov bp, sp
|
mov bp, sp
|
||||||
mov ah, byte [bp+4+4] ; restore old AH from nFlags
|
mov ah, byte [bp + 4 + 4 + Size386Registers]
|
||||||
|
; restore old AH from nFlags
|
||||||
|
; ecm: One 4 is the displacement of nFlags from the
|
||||||
|
; usual bp, the other 4 accounts for the si and di
|
||||||
|
; on the stack, the Size386Registers is added to
|
||||||
|
; skip the fs and gs (OpenWatcom 386 build) or high
|
||||||
|
; words that are a part of the stack frame, if any.
|
||||||
sti ; Enable interrupts
|
sti ; Enable interrupts
|
||||||
;
|
;
|
||||||
; clear flags
|
; clear flags
|
||||||
@ -715,6 +730,8 @@ CritErr30:
|
|||||||
|
|
||||||
CritErrExit:
|
CritErrExit:
|
||||||
xor ah,ah ; clear out top for return
|
xor ah,ah ; clear out top for return
|
||||||
|
|
||||||
|
Restore386Registers
|
||||||
pop di
|
pop di
|
||||||
pop si
|
pop si
|
||||||
pop bp
|
pop bp
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user