Re: switching from user stack to kernel stack

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Kiran,

   The switch to the kernel stack takes place automatically when the syscall is made. It is not done by software, but by the hardware. When the hardware detects a change in privilege level its changes esp to the value corresponding to ring 0 .. I think the esp values for different privilege levels are stored in the TSS  segment of the process. 

Cheers,
Bijoy.

----- Original Message -----
From: Kiran Kumar <immidi_kiran@yahoo.com>
Date: Saturday, July 3, 2004 11:05 am
Subject: switching from user stack to kernel stack

> Hi,
>  When a process makes a system call, in the kernel
> space a separate stack would have to be used. (the one
> associated with the task_struct of the process). This
> would mean that the %esp would have to be modified in
> the system call handler routine. I dont seem to find
> out where this is done. ENTRY(system_call) in entry.S
> does not seem to be doing this. I would like to know
> where the code to switch between user and kernel mode
> stacks is.
> 
> 
> =====
> Regards,
> Kiran Kumar Immidi
> 
> 
>        	
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - 50x more storage than other providers!
> http://promotions.yahoo.com/new_mail
> 
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/
> 
> 


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux