Re: switching from user stack to kernel stack

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

 



Yes,you are wrong.
Linux does not make use of TASK GATE to swith current context,
but it does use interrupt gate to implement syscalls.
The hardware behaviors of interrupt gate cannot be modified by software.


On Monday 05 July 2004 21:39, prasanna wakhare wrote:
> hi,
> Is it?
> i'm thinking that this is done by software in linux
> beacuse as linux not used the TSS switch when context
> switch,and anyway that is not relevent here in
> syscalls made where the process entering into kernel
> mode.
> 
> but i beleive that the kernel stack switch may be done
> in software mightbe i would be wrong.
> prasanna
> --- Bijoy Thomas <bijoyjth@gwu.edu> wrote:
> > 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/
> > 
> > 
> 
> 
> 
> 		
> __________________________________
> 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