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