I have a little problem
My kernel works in protected mode.
Here is kernel's main function:
Code: Select all
#include <ktty.h>
#include <colors.h>
#include <ints.h>
#include <handler.h>
int kmain()
{
unsigned char *pmode = "Entered protected mode. [OK]\n\0";
unsigned char *ints = "Setting up interrupts. [OK]\n\0";
unsigned char *welcome = "Welcome to mOS.\n\0";
kclear(BgFgColors(COLOR_BLACK, COLOR_LIGHT_GREEN));
kputs(pmode, BgFgColors(COLOR_BLACK, COLOR_LIGHT_GREEN));
init_interrupts();
kputs(ints, BgFgColors(COLOR_BLACK, COLOR_LIGHT_GREEN));
kputs(welcome, BgFgColors(COLOR_BLACK, COLOR_LIGHT_GREEN));
for(;;);
asm("hlt");
return 0;
}
then it installs timer irq with type TRAP_GATE, and keyboard irq with same type.
With current code I can do nothing, i mean when i type something nothing happens. It just cycleing (for(;;);) and thats all. It's not responding to interrupts.
My question is: how can I put processor in state of doing nothing, just to wait for interrupts.
P.S: without multitasking, I don't need it now.
P.S2: sorry for my bad english