people i don'nt know if this belongs here or not but i am having some problem developing an ISR which will actually extends the BIOS routines.
It's a 16 bit ISR which is trying to extend int 13h services.
Code: Select all
ISR Code
; /* This is the new Interrupt handler to be
; * replace with the old interrupt handler.
; */
_new_int13:
???jmp near start_isr
; /* saved GP registers. */
oldax dd 0
oldbx dd 0
oldcx dd 0
olddx dd 0
; /* saved index registers. */
oldsi dd 0
olddi dd 0
; /* saved segment registers. */
oldes dw 0
oldfs dw 0
oldss dw 0
oldds dw 0
oldsp dw 0
offs dw 0
oldflags dw 0
_old_int13:
???dw 0
???dw 0
start_isr:
???push ds
???pushf
???push cs
???pop ds
???mov dword [oldax], eax
???; save the flag registers
???
???pop ax
???mov word [oldflags], ax
???; save DS register
???pop ax
???push ax
???mov word [oldds], ax
???
???; save other registers.
???mov eax, dword [oldax]
???mov dword [oldbx], ebx
???mov dword [oldcx], ecx
???mov dword [olddx], edx
???mov dword [oldsi], esi
???mov dword [olddi], edi
???mov word [oldsp], sp
???mov word [oldss], ss
???mov word [oldes], es
???
???; /* setup our own stack. */
???cli
???mov ax, ds
???mov ss, ax
???mov sp, stack_top
???mov eax, dword [oldax]
???sti
???cmp byte ah, 42h
???jz lbamode
???
???cmp byte ah, 43h
???jz lbamode
???cmp byte ah, 02h
???jz chsmode
???cmp byte ah, 03h
???jz chsmode
???
jmp_to_org:
???; /* Just jump to the default handler. */
???mov eax, dword [oldax]
???mov ebx, dword [oldbx]
???mov ecx, dword [oldcx]
???mov edx, dword [olddx]
???mov esi, dword [oldsi]
???mov edi, dword [olddi]
???
???cli
???mov ss, word [oldss]
???mov sp, word [oldsp]
???sti
???; /* restore the flags. */
???push word [oldflags]
???popf
???pop ds
???jmp far [cs:_old_int13]
; /* CHS mode is used here. */???
chsmode:
lbamode:
???
???; /* check the disk number. */
???; cmp byte dl, 80h
???; jnz jmp_to_org
???
???mov eax, dword [oldax]
???mov ebx, dword [oldbx]
???mov ecx, dword [oldcx]
???mov edx, dword [olddx]
???mov esi, dword [oldsi]
???mov edi, dword [olddi]
???
???cli
???mov ss, word [oldss]
???mov sp, word [oldsp]
???sti
???; restore the flags.
???push word [oldflags]
???popf
???pop ds
???push word 0
???call far [cs:_old_int13]
???pushf
???jb error
???; /* do extra processing here. */???
???
error:
???popf
retf 2
I am not able to understand what the problem could be.
Any help will be appretiated.
Inder.
[edit by candy] please do use code tags for your code[/edit]