Remove intr function not in line with int 21h
If we have them, use them for setting up ourselves
This commit is contained in:
parent
e86bde72f8
commit
d5ba0f3e30
@ -28,59 +28,3 @@ isr_intr_register:
|
||||
pop es
|
||||
|
||||
iret
|
||||
|
||||
; Register a interrupt handler
|
||||
; in: AL interrupt number
|
||||
; ES:DI far ptr to routine/data
|
||||
intr_register:
|
||||
; backup original values
|
||||
push ax
|
||||
push es
|
||||
push di
|
||||
|
||||
; pop as ax later
|
||||
push es
|
||||
push di
|
||||
|
||||
; DI = AL * 4
|
||||
mov ah, 4
|
||||
mul ah
|
||||
mov di, ax
|
||||
|
||||
; ES = 0
|
||||
xor ax, ax
|
||||
mov es, ax
|
||||
|
||||
; store offset
|
||||
pop ax
|
||||
stosw
|
||||
|
||||
; store segment
|
||||
pop ax
|
||||
stosw
|
||||
|
||||
pop di
|
||||
pop es
|
||||
pop ax
|
||||
ret
|
||||
|
||||
; Get address for a interrupt vector
|
||||
; in AL interrupt number
|
||||
; out DS:SI far ptr to routine/data
|
||||
intr_load:
|
||||
push ax
|
||||
|
||||
; SI = AL * 4
|
||||
mov ah, 4
|
||||
mul ah
|
||||
mov si, ax
|
||||
|
||||
; DS = 0
|
||||
xor ax, ax
|
||||
mov ds, ax
|
||||
|
||||
; load segment and offset in one go
|
||||
lds si, [si]
|
||||
|
||||
pop ax
|
||||
ret
|
||||
|
@ -7,10 +7,12 @@ isr_dos_main:
|
||||
je isr_getc_echo
|
||||
cmp ah, 0x02
|
||||
je isr_putc
|
||||
cmp ah, 0x25
|
||||
je isr_intr_register
|
||||
jmp isr_invalid
|
||||
|
||||
%include "chario.asm"
|
||||
%include "intr.asm"
|
||||
%include "chario.asm"
|
||||
|
||||
%include "cache.asm"
|
||||
|
||||
@ -32,14 +34,15 @@ isr_return:
|
||||
iret
|
||||
|
||||
init:
|
||||
push cs
|
||||
pop es
|
||||
mov di, isr_dos_main
|
||||
mov ax, 0x21
|
||||
call intr_register
|
||||
mov ax, cs
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
|
||||
mov di, kernel_end
|
||||
call cache_init
|
||||
mov dx, isr_dos_main
|
||||
mov ax, 0x2521
|
||||
pushf
|
||||
push cs
|
||||
call isr_dos_main
|
||||
|
||||
int3
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user