Hi Everyone
i'm developing a os in fasm assembly language using grub
i've printed the string on the screen, and set my own GDT and IDT and defined ISR
every thing works fine, whe i call interup, interupt is triggered and i get message on screen
but problem is if i don't call any interupt also my os throwing Double Fault Exception, please help!
Thanks in Advance
ISR Problem
Re: ISR Problem
Its broken. e.g. damned if I know, you need to debug more and/or give more information afterwards.
-
- Posts: 5
- Joined: Sat Dec 03, 2011 8:58 am
Re: ISR Problem
Where could be the Bugberkus wrote:There's a bug in your code.
I mean if,GDT not defined properly we get Double Fault Error
so what could be cause of Double Fault Eception GDT,IDT or ISR
sample of my os code
Code: Select all
; Global Descriptor Table (GDT)
InstallGDT:
cli ; clear interrupts
pusha ; save registers
lgdt [GDT] ; load GDT into GDTR
sti ; enable interrupts
popa ; restore registers
ret ; All done!
GdtData:
dd 0 ; null descriptor
dd 0
dw 0FFFFh ; limit low
dw 0 ; base low
db 0 ; base middle
db 10011010b ; access
db 11001111b ; granularity
db 0
dw 0FFFFh ; limit low
dw 0 ; base low
db 0 ; base middle
db 10010010b ; access
db 11001111b ; granularity
db 0
EndOfGdt:
GDT:
dw EndOfGdt - GdtData - 1 ; limit (Size of GDT)
dd GdtData
;Interupt Descriptor Table
InstallIDT:
cli
pusha
lidt [IDT]
sti
popa
ret
IdtData:
dw (isr0 and 0FFFFh)
dw 00001000b
db 0
db 10001110b
dw (isr0 shr 16) and 0xFFFF
dw (isr1 and 0FFFFh)
dw 00001000b
db 0
db 10001110b
dw (isr1 shr 16) and 0xFFFF
EndOfIdt:
IDT:
dw EndOfIdt - IdtData - 1
dd IdtData
macro isrStub errmsg
{
pusha
push ds
push es
push fs
push gs
mov ax, 0x10
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov eax, esp
push ebx
mov ebx,errmsg
call Puts
mov ebx,er
call Puts
hlt
pop ebx
pop gs
pop fs
pop es
pop ds
popa
add esp, 8
iret
}
isr0:
cli
isrStub err0
isr1:
cli
isrStub err1
er db 'Exception System Halted!',10,0
err0 db 'Division By Zero',10,0
err1 db 'Debug',10,0
Last edited by dilipcs1992 on Fri Apr 06, 2012 6:35 am, edited 2 times in total.
Re: ISR Problem
You provided none information on the issue.
Do you really want us to just wild guess on it? If so, okay I guess there is un-handled interrupt elsewhere.
Do you really want us to just wild guess on it? If so, okay I guess there is un-handled interrupt elsewhere.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: ISR Problem
It's a crystal ball.
It insists on predicting 90% cloud coverage.
The rest of the time it says "wrong forum"
It insists on predicting 90% cloud coverage.
The rest of the time it says "wrong forum"
Re: ISR Problem
i added code tags to your post, please do this yourself in the future
as for your problem, you first need to do a little investigating yourself, to at least find out where the problem is occurring, and then, if you still need help, give more information (the more the better -- most people here won't help someone who doesn't show that they tried to solve it themselves first) and relevant code (preferably the code that actually causes the error to appear, other things may be important, but at least start there)
for your own work: start by finding out exactly what your code does, and where it causes the problem, then look in the intel manuals:
intel 3A:5.14 for a list of reasons why that particular exception can occur
intel vol. 2 for the offending instruction to find which exceptions it can cause and why
for #DF i would recommend the former (since #DF is caused by something going wrong while fetching another exception handler, rather than caused directly by execution of an instruction)
as for your problem, you first need to do a little investigating yourself, to at least find out where the problem is occurring, and then, if you still need help, give more information (the more the better -- most people here won't help someone who doesn't show that they tried to solve it themselves first) and relevant code (preferably the code that actually causes the error to appear, other things may be important, but at least start there)
for your own work: start by finding out exactly what your code does, and where it causes the problem, then look in the intel manuals:
intel 3A:5.14 for a list of reasons why that particular exception can occur
intel vol. 2 for the offending instruction to find which exceptions it can cause and why
for #DF i would recommend the former (since #DF is caused by something going wrong while fetching another exception handler, rather than caused directly by execution of an instruction)