bios: Get rid of self-modifying interrupt call code

This commit is contained in:
mintsuki 2022-07-10 18:58:17 +02:00
parent b1672e4ab9
commit 5e0f85727a

View File

@ -39,8 +39,9 @@ rm_hcf:
global rm_int
rm_int:
; Self-modifying code: int $int_no
mov al, byte [esp+4]
mov byte [.int_no], al
mov eax, dword [esp+4]
mov eax, dword [0 + eax*4]
mov dword [.int_offset], eax
; Save out_regs
mov eax, dword [esp+8]
@ -100,14 +101,9 @@ rm_int:
pop eax
mov esp, dword [ss:.esp]
sti
; Indirect interrupt call
db 0xcd
.int_no:
db 0
cli
pushf
call far [ss:.int_offset]
; Load out_regs
mov dword [ss:.esp], esp
@ -164,3 +160,5 @@ align 16
.idt: dq 0
.rm_idt: dw 0x3ff
dd 0
dw 0
.int_offset: dd 0