Page 1 of 1

x86-64 context switch

Posted: Fri Dec 17, 2021 12:34 pm
by 22OsC
Does anyone got a tutorial (preferred video) about context switching in x64 bit mode? I watched some videos on YouTube and tried to do some research on my own but it didn't help me to understand too much (because it was only the source code or the explanation was too straightforward).

Re: x86-64 context switch

Posted: Fri Dec 17, 2021 1:24 pm
by vhaudiquet
You should not rely on nor look for tutorials.

Context switching is just changing the virtual address space (i.e. page directories/pdpts) and the content of the registers, basically.
There can be some issues with specific registers but i don't believe they apply to x64.

Context switching is just that. Saving current state in a structure somewhere and restoring state from another structure.
Why are you looking for a tutorial ?

By 'context switching', do you mean 'scheduling' ? Do you mean more generally 'multitasking' ?

Re: x86-64 context switch

Posted: Sat Dec 18, 2021 11:49 pm
by 22OsC
vhaudiquet wrote:By 'context switching', do you mean 'scheduling' ? Do you mean more generally 'multitasking' ?
Yeah