it also works in practice. the only catch was that fault386 does:
if(!user){
if(vmapsync(addr))
return;
-> if(addr >= USTKTOP)
panic("kernel fault: bad address pc=0x%.8lux
addr=0x%.8lux", ureg->pc, addr);
if(up == nil)
panic("kernel fault: no user process pc=0x%.8lux
addr=0x%.8lux", ureg->pc, addr);
}
so when moving the TSTK above the USTK, you need to change the addr >= USTKTOP
to addr >= TSTKTOP.
the arm kernels use USTKTOP as the end of userspace and size...
i think your approach with dynamically finding the address hole for the
temporary
stack is the most flexibe and requires the least change. i think one can
ignore the additional computational overhead and get rid of the TSTK all
together.
--
cinap