Switch a task... and stop IRQs!

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
JoeKayzA

Re:Switch a task... and stop IRQs!

Post by JoeKayzA »

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 .
User avatar
Pype.Clicker
Member
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!

Post by Pype.Clicker »

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.
JoeKayzA

Re:Switch a task... and stop IRQs!

Post by JoeKayzA »

That would be an elegant solution - I think I'll have a look at your memory-class concept. ;D

cheers Joe
Post Reply