The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] mmap origin (was Systematic approach to command-line interfaces)
@ 2021-09-30  9:01 Paul Ruizendaal via TUHS
  2021-09-30 10:39 ` [TUHS] Early shared library implementations arnold
  2021-09-30 12:56 ` [TUHS] mmap origin (was Systematic approach to command-line interfaces) Dan Halbert
  0 siblings, 2 replies; 9+ messages in thread
From: Paul Ruizendaal via TUHS @ 2021-09-30  9:01 UTC (permalink / raw)
  To: TUHS main list


On Wed, Sep 29, 2021 at 09:40:23AM -0700, Greg A. Woods wrote:

> I think perhaps the problem was that mmap() came too soon in a narrow
> sub-set of the Unix implementations that were around at the time, when
> many couldn't support it well (especially on 32-bit systems -- it really
> only becomes universally useful with either segments or 64-bit and
> larger address spaces).  The fracturing of "unix" standards at the time
> didn't help either.
> 
> Perhaps these "add-on hack" problems are the reason so many people think
> fondly of the good old Unix versions where everything was still coming
> from a few good minds that could work together to build a cohesive
> design.  The add-ons were poorly done, not widely implemented, and
> usually incompatible with each other when they were adopted by
> additional implementations.

mmap() did come from those days and minds.

The first appearance of mmap() was in 32V R3, done by John Reiser in 1981. This is the version of 32V with full demand paging; it implemented a unified buffer cache. According to John, that version of mmap() already had the modern 6 argument API. John added mmap() because he worked with Tenex a lot during his PhD days and missed PMAP. He needed some 6 months to design, implement and debug this version of 32V as a skunkworks project.

I am trying to revert early VAX SVr1/r2 code to get a better view of what 32V R3 looked like, but unfortunately I did not have much time for this effort in last couple of months. It would seem that 32V R3 assumed that disk blocks and memory pages were the same size (true on a 1980 VAX) and with that assumption a unified buffer cache comes natural in this code base.

For 4.2BSD initially Joy cs. had a different approach to memory mapped files in mind (see the 1981 tech report #4 from CSRG). By the time of 4.2BSD’s release the manual defined a mmap() system call, but it was not implemented and it appears to have been largely forgotten until SunOS 4 and dynamic libraries six years later.

In the SysV lineage it is less clear. For sure mmap() is not there, but the first implementation of the shmem IPC feature might derive from the 32V R3 code. On the inside, SVr2 virtual memory appears to implement the segments (now called regions) that Joy envisaged for 4.2BSD but did not implement.

CB Unix had a precursor to shmem as well, where a portion of system core was reserved for shared memory purposes and could be accessed either via the /dev/mem device or could be mapped into the PDP-11 address space (using 1 of the 8 segment registers for each map). Here too the device and the map were unified.

So far, I have not come across any shared library implementations or precursors in early Unix prior to SunOS 4.

Paul


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-10-17 22:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-30  9:01 [TUHS] mmap origin (was Systematic approach to command-line interfaces) Paul Ruizendaal via TUHS
2021-09-30 10:39 ` [TUHS] Early shared library implementations arnold
2021-09-30 14:12   ` Charles H Sauer
2021-10-11  6:43   ` Rob Gingell via TUHS
2021-10-11  7:08     ` George Michaelson
2021-10-11 14:22       ` Clem Cole
2021-10-17 22:19     ` Chris Hanson
2021-10-17 22:15   ` Chris Hanson
2021-09-30 12:56 ` [TUHS] mmap origin (was Systematic approach to command-line interfaces) Dan Halbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).