Maybe you should consider implementing the stack tunneling logic at userspace, in a runtime library. You would just need a mechanism that delivers page faults to userspace handlers (the kernel space handlers have higher priority, of course). Adjusting the userspace %esp and %ebp should work without problems, then. IMHO, this mechanism fits better into a runtime library, because you could change the implementation depending on the programming language that was used, or leave it away for minimalistic ASM programmers (no offense ). At kernel level, you could do the same, if you need the mechanism there.
cheers Joe
EDIT: sorry, just noticed that I forgot about segmentation, that you mentioned you will use in your OS. Maybe my designs are 'too flat' ;D .
Switch a task... and stop IRQs!
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Switch a task... and stop IRQs!
indeed, that could be handled at userlevel, but the cost might be too high, especially since we'll need extra syscalls to remap the shared section. As, in clicker, we have the concept of "memory object" and that the application can give hints at what implementation of "stack" it wants for its threads, whether tunnelling will be available or not is the matter of picking the proper memory class when you create your thread.
Re:Switch a task... and stop IRQs!
That would be an elegant solution - I think I'll have a look at your memory-class concept. ;D
cheers Joe
cheers Joe