x86-64 context switch

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
User avatar
22OsC
Member
Member
Posts: 35
Joined: Tue Jul 13, 2021 5:15 am
Libera.chat IRC: 22OsC
Location: Metaverse

x86-64 context switch

Post 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).
The code does get a bit quirky at night.
vhaudiquet
Member
Member
Posts: 43
Joined: Sun Aug 20, 2017 10:59 am

Re: x86-64 context switch

Post 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' ?
User avatar
22OsC
Member
Member
Posts: 35
Joined: Tue Jul 13, 2021 5:15 am
Libera.chat IRC: 22OsC
Location: Metaverse

Re: x86-64 context switch

Post by 22OsC »

vhaudiquet wrote:By 'context switching', do you mean 'scheduling' ? Do you mean more generally 'multitasking' ?
Yeah
The code does get a bit quirky at night.
Post Reply