multitasking

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.
Post Reply
northfuse

multitasking

Post by northfuse »

in my attempts to set up a multitasking environment, I get a page-fault in my timer handler whenever i try to use the stack. Maybe i'm not getting the kernel stack pointer correctly? This is how i do it:
(in nasm)

get_esp:
mov eax, esp;
sub eax, 8;
ret

should i do it in gcc inline assembly? and if so, how would i do that?

Thanks
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:multitasking

Post by Pype.Clicker »

honestly, i recommend you do not try to read/change the stack pointer from within a C code, but rather to handle the whole switch (e.g. pushing things, changing the pointer and popping things) in a full-asm snippet.
Post Reply