[Prev][Next][Index][Thread]
OSKit & processes
    Since OSkit does not support processes 
directly, I decided I should give it a try and implement some of it myself. One 
of the easy ways is to use TSS and let the CPU handle all the state saving. I 
can easily put a task gate in the IDT, but how can I do an "iretd" 
from a TSS exception/interrupt handler? By coding it by hand, i.e. 
asm("iretd") or however gas requires? I don't think this should work, 
since the compiler inevitably places some "push"-es on the entry of 
the function and messes stacks. When I was fiddling with NASM and Visual C++ to 
make a simple 32-bit protected kernel, things were easy, because VC++ does 
_very_ simple code, and was easy to disassemble and see what it does in terms of 
asm instructions. Since I cannot do that here, and base_trap_* stuff obviously 
cannot handle task gates, and I do not want to make a software task switch, what 
should I do?
BTW, task switching can be very easily implemented this way, 
just change the back_link field in the kernel's TSS and iretd, that's 
all...
    Any 
advice? 10x in advance.
 
FtpDaemon