LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-23-2007, 01:00 AM   #1
manas_sem
LQ Newbie
 
Registered: Dec 2006
Posts: 29

Rep: Reputation: 15
how to switch from kernel mode to user mode


How to switch from kernel mode to user mode in linux (For i386)....what are the linux source files which have this switching code ?
 
Old 01-23-2007, 01:29 AM   #2
varun_shrivastava
Member
 
Registered: Jun 2006
Distribution: Ubuntu 7.04 Feisty
Posts: 79

Rep: Reputation: 15
code can be found at
/usr/src/linux-2.6.19.2/include/asm-i386/unistd.h
 
Old 01-23-2007, 04:59 AM   #3
manas_sem
LQ Newbie
 
Registered: Dec 2006
Posts: 29

Original Poster
Rep: Reputation: 15
From Kernel to user mode

Quote:
Originally Posted by varun_shrivastava
code can be found at
/usr/src/linux-2.6.19.2/include/asm-i386/unistd.h

the code in "include/asm-i386/unistd.h " is for system calls ,i.e.,
to go to kernel mode. i want to know the code for switching to user mode from kernel mode....
 
Old 01-23-2007, 09:14 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
The code to switch from kernel to user mode is simply an assembly code RTI (return from interrupt) or equivalent, just like the code to initiate a system call is triggering some kind of interrupt with TRAP, or equivalent, depending on the architecture.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
kernel and user mode communication yhus Linux - Kernel 5 06-03-2006 10:00 AM
Interface between user mode and kernel mode santosh_pn Linux - Software 1 06-17-2005 07:20 AM
how to open /proc file in RW mode in user mode? cranium2004 Programming 3 03-06-2005 03:03 AM
How can I change display mode from character mode to graph mode wuzhong Linux - Hardware 1 08-08-2004 09:36 AM
IPC between kernel and user mode bun_zee Programming 1 06-04-2004 12:08 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration