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.
for multitasking we must create structure which stores the register values and program counter values.
this structure must be created dynamically based on newly created processes
and must be put back on registers based on scheduling algoritms..
If you'd have read all the tutorials and posts on the matter, you'd know the answer to that.
"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 ]
You don't have to do anything in your os. You can do task switching any way you want. You could use some fancy assembly and come up with something new.
My point is that there is no standard way to do things. However, the method you described is a very common method(but not the only one possible).