[lkml]   [1996]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Is the Linux memory 'flat' ?
Followup to:  <199606251923.MAA00206@redshirt.tholian.web>
By author: Tom May <>
In newsgroup:
> Alan Cox says:
> >> Beeing Linux a 32 bits OS, does it means _necessary_ that the memory
> >> space of a process is 'flat' ? That is continuous, with no need
> >> of far/near stuff.
> >It is flat in Linux but if you are warped enough you can run segmented mode
> >32bit segments in 32bit mode. Nobody is quite that sad however
> The linux kernel code is :-) I was glad to see that Linus plans to
> drop the segmented stuff in the kernel in the near future.

The Linux kernel just uses two set of segments for address space
separation. There is nothing funny about it; it was mostly a "it's
there, we might as well use the bloody thing for something." Of
course, some of us remember when Linux only had one linear address
space for all processes, and actually used segmentation for isolating
processes; this also limited these early Linux systems to 63 64MB
processes. Back then we were much more worried about the 16MB RAM and
64MB partition size limitations; the former which still lives in the
form of a question, since long obsolete...

I think what Alan was referring to was the possibility of running
Multics-style segmentation (the i386 segmentation and ring mechanisms
were basically Multics rip-offs, and Intel still managed to get a
patent on it!) complete with 48-bit pointers (16-bit selector+32-bit
offset). The advantage is that most fandango on core and array
overruns are automatically caught, the disadvantage is that lugging
around those 48-bit pointers and reloading segment registers all the
time is a bloody waste of time.

I still, however, believe we should use %gs for the glocal storage
pointer on the i386 (for multithreaded apps.) On machines with a real
register file this would of course be kept in a normal register, but
on the i386 there are only five registers left once %ebp is made frame
pointer and %ebx PIC pointer.

I would personally have been much happier had base-index addressing
been implemented from %esp (this is a flaw in the i386 instruction
set, not a Linux flaw) and left %ebp a general-purpose
register... *sigh*.

PGP public key available - finger
I don't work for Yggdrasil, but they sponsor the linux.* hierarchy.
"The earth is but one country, and mankind its citizens." -- Bahá'u'lláh
Just Say No to Morden * Save Babylon 5:

 \ /
  Last update: 2005-03-22 13:37    [W:0.059 / U:1.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site