Kernel and user stack Confusion?
Posted: Thu Apr 02, 2009 2:34 am
Hi
I had to edit it as it was posted from my cellphone, reason My DSL ip is frequently blacklisted.
So any way, let me discuss now!
I am trying to do multitasking and paging together. What is confusing me now is STACK.
Thanks for clearing Kernel Mapping confusion.
If we will have a look at JamesM tutorials he uses movestack() to relocate stack reason :
"it'll be linked instead of copied when PD is changed "
Lets create a new task ( not fork() ), that task's address space no doubt will have all the kernel space mapped rather linked but when we create that task we will definitely add some new pages to directory, allocated frames, load program from disk and set appropriatly esp, ebp and eip.
I will set esp and ebp to the end of the program (i.e. end of last allocated frame/page) as i plan to load flat binaries and have set let 8KB of stack at compile time in my program, then where lies the problem?
If above is possible as it seems to me as i myself will set stack pointers for my new task avoiding conflict with kernel stack,then
Why JamesM needs stack relocation?
What does it mean actually?
I no I am wrong otherwise JamesM wont have used movestack(), so please correct me!
Thanks a lot
I had to edit it as it was posted from my cellphone, reason My DSL ip is frequently blacklisted.
So any way, let me discuss now!
I am trying to do multitasking and paging together. What is confusing me now is STACK.
Thanks for clearing Kernel Mapping confusion.
If we will have a look at JamesM tutorials he uses movestack() to relocate stack reason :
"it'll be linked instead of copied when PD is changed "
Lets create a new task ( not fork() ), that task's address space no doubt will have all the kernel space mapped rather linked but when we create that task we will definitely add some new pages to directory, allocated frames, load program from disk and set appropriatly esp, ebp and eip.
I will set esp and ebp to the end of the program (i.e. end of last allocated frame/page) as i plan to load flat binaries and have set let 8KB of stack at compile time in my program, then where lies the problem?
If above is possible as it seems to me as i myself will set stack pointers for my new task avoiding conflict with kernel stack,then
Why JamesM needs stack relocation?
What does it mean actually?
I no I am wrong otherwise JamesM wont have used movestack(), so please correct me!
Thanks a lot