[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

RE: [LI] user space, kernel space and .........



Intel Pentium processor has 4 levels. The levels are :

1] level 0 :- kernel resides in this level, includes mm, fs,scheduler,etc...
2] level 1 :- system calls reside in this level
3] level 2 :- shared objects reside in this level
4] level 4 : user programs reside in this level

At each instance a running program resides at a particular level  which is
represented by the 2-bits of PSW. Segments reside in different levels. Until
and unless the program running in one level doesn't access the segments
which are in other level everything works fine.If program running in a level
requests segments of its higher level the accessing is Ok & it's permitted.
But if it requets for lower level segments the operation is illegal and a
trap occurs. Attempts to access data of different level(lower or higher) can
be accessed, but in really controlled manner. To make a interlevel jump
we'll have to provide selector of the segment, in which the program is, in
the CALL instruction, not the address of the program. This selector points
to a descriptor known as "call gate" which contains the address of the
procedure. Thus you can't jump to some address between an arbitrary code
segment. You can jump only to official intermediate entry point.
 
Ajit 
----------------------------------------------------------------------------
-------------------------
Best way to learn Linux is to put comments in the source code
___________________________________________________

> -----Original Message-----
> From:	skhader@xxxxxxxxxx [SMTP:skhader@xxxxxxxxxx]
> Sent:	Wednesday, January 12, 2000 7:02 PM
> To:	linux-india@xxxxxxxxxxxxxxxxxxxxx
> Subject:	[LI] user space, kernel space and .........
> 
> Hi there,
> I am presently going thro the book " Linux Device Drivers" By Alessandro
> Rubini.
> There is a sentence here which is as follows:
> " The chosen approach is to implement different operating modalities ( or
> levels ) in the CPU itself.
> The levels have different roles, and some operations are disallowed at the
> lowest levels; program code can switch from one level to another only
> through a
> limited number of "gates". Unix systems are designed to take advantage of
> this
> hardware feature, but they use two such levels (while, for example, Intel
> processros
> have four levels). Under Unix, the kernel executes in the highest level (
> also called
> ^^^^^^^^^^^^^^^^^^
> "superuser mode "), where everything is allowed, while applications
> execute
> in the lower
> level,( the so-called "user mode"), where the processor inhibits direct
> access to hardware and
> unauthorized access to memory."
> 
> And can anybody elaborate why Unix uses only two levels and
> why not all the four ?? And anybody here knows what are the four levels in
> the Intel
> processors.
> Thanks
> Regards
>     Khader
> 
> ----------------------------------   @}--------
> Syed Khader Vali                  Debian 2.2.1 ( potato )
> skhader@xxxxxxxxxx             Kernel 2.3.39
> Live Free or Die                       http://www.cfp2000.org
> 
> 
> --------------------------------------------------------------------
> The Linux India Mailing List Archives are now available.  Please search
> the archive at http://lists.linux-india.org/ before posting your question
> to avoid repetition and save bandwidth.
--------------------------------------------------------------------
The Linux India Mailing List Archives are now available.  Please search
the archive at http://lists.linux-india.org/ before posting your question
to avoid repetition and save bandwidth.