I'm currently dealing with task switching, and I'm trying to use software switching (I know that the Intel arch' provides some technique to make it in a hardware way, but this is not what I currently want).
I was just wondering how it could be possible to achieve this with a C function. I mean, as I have to save/store the values of all the registers/selectors in a task structure, defined like this :
Code: Select all
typedef struct task_s
{
u32 eax;
u32 edx;
...
}task_t;
But if the scheduler is called, say by a system call (ie by a user level accessible int), a piece of assembly code is calling my C handler, and the code of these functions will change the values of mainly all registers.
Do I need to write the saving part in assembly only, or does another technique work ?