how do i change timer interrupts speed?(1 seconds instead 1 milliseconds)

JIN WON JEONG Answered 3 answers
Question by JIN WON JEONG 6 months ago

Question

how do i change timer interrupts speed?(1 seconds instead 1 milliseconds)

Answers

Answered by Daniel McCarthy

Instructor

Hello,
Ideally you would not change the speed to one second your kernel would barely function properly you would see intense lag between processes. Instead what you would do is store the current TSC clock and then everytime theres an interrupt you can compare between the old value and the new, when it exceeds one second you can perform what action you want. This way it will still tick 1000 times but you will have an IF statement IF ONE SECOND HAS PASSED THEN DO THIS. which will be based on the old clock vs the new caclulated clock. It is more efficient and is how you are supposed to handle senarios like this. By the way this is shown to you in the part two series where you will learn how to do this

Thanks
Dan

Follow-up by JIN WON JEONG

Question author

when I call enable_interrupts function in 64 bit mode then error occurs (blinking screen)

Answered by Daniel McCarthy

Instructor

You have to check the attached source code to see the mistake you made