GLneo wrote:
ok, i've done a little research, and it sayed that the return address is stored at ebp + 1 so should i do this:
Where did you read this? It doesn't make any sense... If it didn't come from the Intel Manuals, I don't consider it to be a reliable source.
Quote:
Code:
stack->esp = (unsigned int)(malloc(64*4) + (64*4));
stack->ebp = stack->esp;
*(&(stack->esp) + 1) = (unsigned int)entry;
Why the heck are you allocating yet another stack? You already allocated it at the beginning of make_task()! Did my suggestion not make any sense?
Quote:
p.s. whats your code look like???
I haven't implemented task creation yet, so my code is exactly what I'm suggesting to you in this thread.
You need to take a step back and really try to understand what you're doing. Otherwise, you're operating on pure superstition and you're not going to get anywhere. Read the Intel Manuals. Grab a good book (the Minix book includes source, and is worth reading). Just chill out and stop making random guesses.
But first, try my suggestion and tell me if it works.