MichaelPetch wrote:
Because your function that detects if the IF flag is set return a bool which you have defined as `typedef unsigned char bool;` The compiler is likely returning 0 because the 9th bit is beyond the extent of a byte return value. If you want to return a value of 0 or 1 you'll have to modify what you return. One way is to change what you return to:
Code:
return !!(flags & (1 << 9));
to convert a non zero value to 1 or a zero value to 0..
How would it be more correct to declare
bool to avoid such problems?
It helped. But I found that I do not call
lidt() before
idt_init(), maybe this is the problem?
Now, if there is an interruption, for example when a button is pressed on the keyboard, then
irq2_handler() will be called?
And another small question: Now
kmain() immediately terminates after execution and I do not see a reaction to the interrupt(I tried to check this with the keyboard and
irq2_handler()), how can I make
kmain() not terminate but work as much as I need?
MichaelPetch wrote:
I'd also recommend compiling with -Wall -Wextra -Werror so that you eliminate all the warnings. -Werror is convenient as it will refuse to continue generate an object file when an error is encountered forcing you to deal with the warnings.
Understood, in the future I will compile like this.