[TUHS] Memory management in Dennis Ritchie's C Compiler

Paul Winalski paul.winalski at gmail.com
Tue Aug 18 05:50:29 AEST 2020


On 8/17/20, Larry McVoy <lm at mcvoy.com> wrote:
> On Mon, Aug 17, 2020 at 03:27:15PM -0400, Noel Chiappa wrote:
[regarding mmap(2)]
>
> Bill Joy imagined it, the prototype is in one the 4.x BSD releases.
> Sun (Joe Moran) actually implemented it first in any Unix variant.
> It's possible the concept existed in some other OS but I'm not aware
> of it.
>
VAX/VMS had the equivalent of mmap(2) back in 1978.  You can specify a
range of contiguous pages in virtual memory and associate that with a
(page-aligned) range of blocks in a file.  The blocks in the file act
as backing store for the virtual memory.  VMS also has a system call
$CRETVA (create virtual address space) that lets you associate a VA
range using the system page file as backing store.  The VMS image
activator (runtime loader in Unix-speak) used these primitives to load
program images into virtual memory.  More than one process can map the
same region of a file.  This is how sharing of read-only program
segments such as .text is implemented.

I think Burroughs OSes had this concept even before VMS.

There is also $EXPREG (expand address region), which is more or less
equivalent to sbrk().

-Paul W.


More information about the TUHS mailing list