See some historical notes on the hardware concept of address.
When this pattern was applied to very small objects, the code could be compiled with fixed virtual addresses into the data segment. The context of the code was determined by the current map. Indeed the map supplanted the role of the register in defining the instance at hand. Alas this trend gets us back to wanting large addresses in the instruction stream. I think now that this is a bad idea and that current processors are moving in the right direction. In an environment where all addresses are deemed to be 64 bits, is awkward to compile C code for:
extern int x; void xx(void){x = 0;}On the 64 bit SPARC I get
xx: sethi %hh(x), %o1 sethi %lm(x), %g5 or %o1, %hm(x), %g1 sllx %g1, 32, %g4 add %g4, %g5, %g1 retl st %g0, [%g1+%lo(x)]Forty years later, I finally agree that addresses do not belong in the instruction stream. (Incidental note: IBM’s 64 bit version of the 360 architecture finally ameliorates the problem of code pointing to code. In the original 360, conditional branches could span only 4K from some general register. Compilers (and humans) had a terrible time maintaining registers to access code in a routine larger than 4KB.)
The programmer had to choose one of three powers of 16 as the size of his external variable and the unused part of that address range could not be used for other purposes. This was a trade-off between efficiency and economy of address space. The resulting economies transcend several abstraction levels from involved nodes thru hardware mapping tables and caches. For situations where better economy of virtual addresses was required more complex library routines could provide more flexible mapping. We did not find such a need. In summary Keykos enjoys large virtual address spaces even as it limits the demand for them by segmenting large complex applications into many spaces.
Another pattern which I think was not used in Keykos was its ability for hierarchical sharing. Such an application might be where one program would produce a segment each of whose pages was the most recent weather prediction for some particular city. The entire segment would be shared among several users of the data. This requires two levels of assembly of segments into larger segments. The hardware does this well, but few if any kernels export this hardware ability.