interrupts wont stop !!!

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
guest

interrupts wont stop !!!

Post by guest »

i have a few questions about interrupts handling ...
in my os if any interrupt is fire an error message is shown but
then it continously prints that message .. this means that the
interrupt keeps on firing .. why is that ? isnt it supposed
to stop
secondly i have my IRQ's masked and when i try to unmask them
it gives me a General Protection Fault error
and is their any way to get the current time and date from
computer
ur help would be appreciated
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:interrupts wont stop !!!

Post by Pype.Clicker »

guest wrote: i have a few questions about interrupts handling ...
in my os if any interrupt is fire an error message is shown but
then it continously prints that message .. this means that the
interrupt keeps on firing .. why is that ? isnt it supposed
to stop
this depends on what kind of interrupt you're receiving. If this is an hardware interrupt request (IRQ), you should not receive a second one as long as the "IF" flag is cleared (unless you explicitely STI in your handler, this means you're not interrupted in an IRQ handler by another IRQ) and sent 0x20 on the PIC.

Note that if what you receives is an exception, nothing prevents the exception to raise in loop if there is something wrong in your handler (for instance, at interrupt return !)
secondly i have my IRQ's masked and when i try to unmask them
it gives me a General Protection Fault error
You're probably doing something wrong with segments registers in your interrupt handlers. If what you receive is a triple fault (CPU reset), then probably something in your IDT configuration is wrong.
and is their any way to get the current time and date from
computer
ur help would be appreciated
The current time is stored in CMOS and can be accessed through ports 0x70 and 0x71 (check some tutorial about real time clock and BIOS CMOS -- there should be some good ones at "Operating System Resource Center")
It is usually updated by an interrupt while in real mode, but most pmode systems simply read it once at boot time and then use the PIT and IRQ0 to update it, then store the final value back to CMOS at shutdown.
mr. xsism

Re:interrupts wont stop !!!

Post by mr. xsism »

if this is what i think it is then this should fix it. I had the same problem. Is it an exception? If so, make sure that when you add the exception interrupts that you set them as trap gates, not interrupt gates. There is only '1 bit' difference between a int and a trap gate. Look over the intel online docs for more info :).

Regards,
mr. xsism
adeelmahmood1

Re:interrupts wont stop !!!

Post by adeelmahmood1 »

you should not receive a second one as long as the "IF" flag is cleared
how can i clear this IF flag

and yes i m sending 0x20 on the PIC but still the error is in loop ..
its raising a general protection fault is it because of ring 3 or ring
0 or something .. may be u have a better idea
You're probably doing something wrong with segments registers in your interrupt handlers
i m using the IDT from osdev.neopages.net .. but there are a
few things in it which i m not sure
what they are so if u can check these files which make up the
IDT .. may be there is something wrong in it
the attached file idt.txt will give u an idea of IDT

does any one has the C code for the keyboard led's .. making them on or off


thanx for ur help
i havent checked wat xsism indicated. ill check it later ;D

[attachment deleted by admin]
Whatever5k

Re:interrupts wont stop !!!

Post by Whatever5k »

how can i clear this IF flag
'cli' clears IF, 'sti' sets it.
Post Reply