Two kernels? One in ring 0 another in ring 3?
Posted: Sun Mar 16, 2008 12:10 pm
So, I got usermode working...
anyway...
Because when you move into usermode you get everything including the kernel code after the call switched, why not fork() the kernel?
Does anyone see a problem with this form of code?
It does work, just does anyone see problems?
-JL
anyway...
Because when you move into usermode you get everything including the kernel code after the call switched, why not fork() the kernel?
Does anyone see a problem with this form of code?
Code: Select all
int ul;
if(!(ul=fork())) MoveToUserMode(); //Creates a second kernel process, one in usermode
if(!ul){
//Usermode
execute_init; //Note: The actual code for these are long asm() commands
exit;
}
if(!ul){
//Usermode kernel
for(;;) delay(100); //Sleeps for a second and repeats (basically do nothing for now)
} else {
//Kernel mode kernel
for(;;) schedule();
}
-JL