Thanks Nick !
在2015年06月17日 11:30,nick 写道:
On 2015-06-16 11:11 PM, hitmoon wrote:
>
> Thanks for your reply!
> I read the manual, it is said that the esp0 is a static field of tss, and it
> will not change for a particular task. So it is initialized with kernel stack
> top (empty kernel stack)of a process when it is executed for the first time, right?
> 在2015年06月17日 04:46,David Matlack <mailto:matlackdavid@xxxxxxxxx> 写道:
>
> On Tue, Jun 16, 2015 at 4:27 AM, hitmoon <zhaoxiaoqiang007@xxxxxxxxx> wrote:
> > Hi:
> > I recently read the book "understanding the linux kernel 3rd", in the
> > task switch process, there are two esp in thread_struct. In macro
> > 'switch_to' , The esp is loaded to switch to the next's kernel stack, but
> > in '__switch_to', esp0 is copied to tss's esp0 field, what the esp0 mean?
> > What the difference between them?
>
> esp0 is the stack pointer that is loaded into esp when the privileged level
> changes to 0. For example, when a process running in user mode (level 3)
> jumps into the kernel via a system call.
>
> You can read more about it in the Intel SDM, Volume 3 Chapter 7.
> http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html
>
>
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@xxxxxxxxxxxxxxxxx
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
I haven't read the manual for Intel Programmers in a few months and don't remember it all but
that seems 100% percent correct from my memory :).
Nick
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies