IRQs or PIT don't work, don't know why

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
Arnolxu
Posts: 1
Joined: Sat Jun 11, 2022 4:49 am
Location: Istanbul, Turkey
Contact:

IRQs or PIT don't work, don't know why

Post by Arnolxu »

I'm trying to make a simple OS by following JamesM's kernel development tutorials:
http://www.jamesmolloy.co.uk/tutorial_h ... 20PIT.html

But when I tried to implement PIT, nothing happened. I think it didn't work because the tutorial was using C and I was using C++, and I did something wrong while implementing it.

Here's the git repository: https://github.com/ardatdev/arus
What did I do wrong? I'm new to OS development and I have no idea what's wrong.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: IRQs or PIT don't work, don't know why

Post by neon »

Hi,

You should really be enabling hardware interrupts after having already set up the PIT not before. Move timer::init right after init_descriptor_tables. What happens if the timer goes off after that STI but before you install its ISR?
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Post Reply