I'm reading some papers and source codes about OS implementation and have a questions about that.
In some operating systems, found on github, the context switch is made within the interrupt handling from timer interrupts.
They saved the registers rbx, r12, r13, r14, r15, rbp and rsp and recovered those registers from the saved state of the next thread.
These thread switches were made within the timer interrupt handling routine, before iret was called. My question is: When the mentioned registers where recovered by the interrupt handler, why is the iret called? On switching the thread, the next thread will start immediately - or is he starting after finishing the interrupt handler with the iret call?
iret. What else should it call? - Cody Grayiret, @MichaelPetch answered it. Thanks :) - jagemue