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

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



--- "SHRIDHAR N. DAITHANKAR"
<shridhar.daithankar@xxxxxxxxxxxxxxxx> wrote:
> 
> Hi
> 
>  Two paisa from me too. -:)
> 

Boy isthisML gettin' rich or what?!?!? ;-)

> Direct access *is* allowed otherwise it will be
> overhead for the hardware.
> But there is a difference. When you access a memory
> address, memory
> translation(This is hardware translation)  using
> GDT/LDT takes place. This
> operation *can* check
> permissions and deny access if you are trying to
> access memory that is not
> yours. That generatea an interrupt and OS is
> notifies for the action.
> Result, you see segmentation fault and core dump
> under Unix/linux(and
> viruses under doze -:) )
> 

But U see this overhead is unavoidable when u require
a protected mode of memory framework, which gives the
stability that is present in the UNIX way of system
management. I think the compromise in the overhead is
very rightly justified. And talking about "directly"
accessing the memory, this ceases u're code from being
cross-plat, which is one of the major advantages of
the way The Linux Kernel is written. Imagine, if u
write to a device memory directly, the same memory
address is never gonna work on a different CPU
architecture. And if u're talking PCI, the bus is
present even on a Mac and the Alpha also (AFAIK). And
each of these arch. have a differnt way of mapping
device memory. I think the method of "requesting"
memory from the kernel, and then letting the kernel
instruct the proccessor to do the dirty work of
translation, and giving us back a clean structure and
functions to access the memory is a kewl feature.

> This all EMS/XMS funda is a waste of time and effort
> from 386 onwards.
> What you see is 32 bit i.e. 4GB address space. Plain
> and simple. All
> locations are same in all manners as others. Your
> CS:IP can be anywhere.
> Only thing is that your OS need to be capable of
> handling that. Windows ke
> bas ke baat nahee hai.
> Furthermore original EMS/XMS ws designed by
> Intel+Lotus+IBM(correct me if
> I am wrong). Those were memory cards like other
> cards because motherboards
> were designed to host 640KB of memory only. It's not
> the case with 386
> onward motherboards. Whatever memory available *can*
> be seen as homogenous
> and continous on those machines. I don't know why
> Microsoft continued with
> old funda.
> 

agreed! i hated those days when XMS/EMS was u're only
hope to run big progs. DPMI rulez mann! ;-)

> In protected mode CS:IP stands for code selector:IP
> offsset. CS points to
> code selector that in turn points to actual segment
> address in which the
> offset is added. The length of segment can be
> checked. And walking into
> other segment by incrementing offset is not
> possible. You will get a
> segmentation fault.

I personally think CS=code segment, and in PM,
selectors are used synonymously as segments, but have
a higher address space. correct me if i am wrong
please.

chow,
Nikhil. 
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
--------------------------------------------------------------------
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.