Kernel Mode vs User Mode

Kernel Mode vs User Mode

Post by anthony_sh » Wed, 07 Apr 2004 06:35:58


I was wondering if someone could explain to me the difference between
Kernel Mode and User Mode as it pertains to the ia32 architecture
modes. I was under the impression that the current standard had three
modes: protected mode, real-address mode, and system management mode.
Is there any correspondence between the different linux modes and the
ia32 modes or does linux create two segments within protected mode?
Thank you for anyone that can help.

Paul
 
 
 

Kernel Mode vs User Mode

Post by OTID » Wed, 07 Apr 2004 13:37:36


The latter is the case, although, of course, Linux is powerless
to do anything about SMM BIOS which continues to execute as it pleases.

-- Pete

 
 
 

Kernel Mode vs User Mode

Post by Jedidiah R » Wed, 07 Apr 2004 13:47:17

The ia32 architecture has segments, which may be code or data, and pages which may have read and write permissions. It has three protection rings such that calls into more inner rings must be done through gates. For Linux, the kernel is in ring 0 and user processes run in ring 3. Rings 1 and 2 aren't used. There are two different segments, but they both cover the entire 32-bit address space so only page-level protections protect the kernel space from user space. This is done because most other archite
ctures have pages, but no segments. As a consequence execute permissions are not enforced by the hardware (you can execute any page you can read.) All of this is done in protected mode. Virtually every other general purpose architecture I know of has pages with read/write/execute permissions and just user/supervisor modes so effectively two rings. The Itanium has something much more convoluted, of course.

Jed