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
interrupts wont stop !!!
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:interrupts wont 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.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
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 !)
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.secondly i have my IRQ's masked and when i try to unmask them
it gives me a General Protection Fault error
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")and is their any way to get the current time and date from
computer
ur help would be appreciated
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.
Re:interrupts wont stop !!!
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
Regards,
mr. xsism
Re:interrupts wont stop !!!
how can i clear this IF flagyou should not receive a second one as long as the "IF" flag is cleared
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
i m using the IDT from osdev.neopages.net .. but there are aYou're probably doing something wrong with segments registers in your interrupt handlers
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]
Re:interrupts wont stop !!!
'cli' clears IF, 'sti' sets it.how can i clear this IF flag