process swtich in x86 real mode how to save/restore ss:esp

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
descent
Posts: 10
Joined: Wed Sep 05, 2012 1:25 am
Location: Taiwan

process swtich in x86 real mode how to save/restore ss:esp

Post by descent »

I write a process switch in dos, it can work switch proc_a, proc_b, but I don't know how to save/restore ss:esp. In protected mode, iret/int will save/restore ss:esp in different privilege.

my code:
https://github.com/descent/process/blob ... /process.S

Any suggestions are welcome.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: process swtich in x86 real mode how to save/restore ss:e

Post by Combuster »

Think about how you save all the other (segment) registers.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply