I want to implement my system calls via call gates. It is my understanding that the application programs transfer the parameters to the kernel using the stack and when it arrives to the kernel a 'stack switch' happens.
My OS has just 2 levels (ring 0 and ring3) so I just need to set ss0/esp0 to pass parameters from the application programs to the kernel.
My question is: could I use the kernel's stack to set ss0/esp0, or do I need to create a special stack to pass parameters? How big should that stack be?
Thank you
pepito
Stack for ring 0
RE:Stack for ring 0
You probably can't use your kernel's stack, unless you can make sure that your kernel's stack is empty every time an application needs a ring 0 stack (including for interrupts that don't use task gates). You need to make sure that no two tasks are using the same ring 0 stack at the same time. If you're using call gates, I would recommend using a separate ring 0 stack for each task. It probably doesn't need to be very big.
RE:Stack for ring 0
OK, I need use a separate ring 0 stack for each task...
Is correct to create a stack segment (at the GDT) and divide it into 'n' tasks?
How big each split must be, if I use 31 parameters by call gate?
pepito
(sorry my poor english)
Is correct to create a stack segment (at the GDT) and divide it into 'n' tasks?
How big each split must be, if I use 31 parameters by call gate?
pepito
(sorry my poor english)