Yet Another Problem with SetInterrupts()

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
StartOS
Member
Member
Posts: 29
Joined: Wed Dec 24, 2014 8:06 am
Location: Germany

Yet Another Problem with SetInterrupts()

Post 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.
All a good OS needs to do is to run Linux inside QEMU :-)
Techel
Member
Member
Posts: 215
Joined: Fri Jan 30, 2015 4:57 pm
Location: Germany
Contact:

Re: Yet Another Problem with SetInterrupts()

Post by Techel »

So you hope no interrupt-handlers from your not existing idt will be called when telling the cpu to receive interrupts?
StartOS
Member
Member
Posts: 29
Joined: Wed Dec 24, 2014 8:06 am
Location: Germany

Re: Yet Another Problem with SetInterrupts()

Post 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?
All a good OS needs to do is to run Linux inside QEMU :-)
User avatar
Combuster
Member
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: Yet Another Problem with SetInterrupts()

Post by Combuster »

I haven't set up the PIC and PIT
What do you think happens in the 10 seconds before your OS runs?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply