Page 1 of 1

Yet Another Problem with SetInterrupts()

Posted: Sat Aug 08, 2015 6:06 am
by StartOS
I have the following files:
int.asm:

Code: Select all

global ClearInterrupts
	ClearInterrupts:
	cli
	ret
global SetInterrupts
	SetInterrupts:
	sti
	ret
int.h:

Code: Select all

void ClearInterrupts(void);
void SetInterrupts(void);
some c file:

Code: Select all

#include "int.h"
...
SetInterrupts();
...
ClearInterrupts();
...
Unfortunately my kernel crashes, falls into an infinate loop of reboots (probably Triple Fault).
By commenting out different parts of my code i.e. changing the code to:

Code: Select all

#include "int.h"
...
SetInterrupts();
...
/*ClearInterrupts();*/
...
, which doesn't crash, I figured out that its the SetInterrupts function that breaks.
Any ideas what's wrong with it?
NOTE:
I haven't set up the IDT yet.

Re: Yet Another Problem with SetInterrupts()

Posted: Sat Aug 08, 2015 6:18 am
by Techel
So you hope no interrupt-handlers from your not existing idt will be called when telling the cpu to receive interrupts?

Re: Yet Another Problem with SetInterrupts()

Posted: Sat Aug 08, 2015 6:48 am
by StartOS
Roflo wrote:So you hope no interrupt-handlers from your not existing idt will be called when telling the cpu to receive interrupts?
Why should any interrupt occur?
I haven't set up the PIC and PIT, I don't divide by 0, Paging is off.
What can cause an interrupt?

Re: Yet Another Problem with SetInterrupts()

Posted: Sat Aug 08, 2015 7:02 am
by Combuster
I haven't set up the PIC and PIT
What do you think happens in the 10 seconds before your OS runs?