Persistent Programming With Speedos and Timor
Persistent Programming With Speedos and Timor
net/publication/394403687
CITATIONS READS
0 9
1 author:
SEE PROFILE
All content following this page was uploaded by James Leslie Keedy on 08 August 2025.
Abstract
Speedos (an acronym for Secure Persistent Execution Environment for Distributed Operating
Systems) is an unconventional design for a very secure capability-based operating system,
which supports an automatically persistent virtual memory. Timor (an acronym for Types,
Implementations and more) is a programming language designed to support Speedos (and
other) systems.
The paper first introduces the concept of persistence and its background in computer science.
It then describes the main features of the Speedos architecture and in particular its virtual
memory mechanism, its process model, its protection mechanism and its technique for logging
users in and out. This is followed by a short description of Timor, which is an unconventional
object-oriented programming language designed inter alia to support the Speedos architec-
ture.
1
see also https://en.wikipedia.org/wiki/PS-algol.
The persistent programming groups set about demonstrating the feasibility of persistent
programming by implementing "persistent object stores" for PS-Algol and Napier above con-
ventional hardware, using the basic facilities of conventional file systems. Such a software-
oriented approach, which inevitable has a high performance overhead because it had to be
implemented in a conventional virtual memory environment, was forced upon them by a lack
of appropriate hardware.
1.4.1 Multics
In the mid-1960s, when mainframe computer systems carried out their work in a batch pro-
cessing mode and personal computers had not yet been invented, computer architecture re-
searchers at MIT in Cambridge, Massachusetts, developed a significant research system
called Multics [4, 5]. Its aim was to demonstrate ideas relevant for time-sharing, i.e. for com-
puter systems where individual users sit at terminals and interact directly with the (shared)
central computer.
Among the many revolutionary design ideas which appeared in Multics was an idea
called "direct addressability" by Multics designers. What they aimed to achieve with this idea
was to allow all the information in a system to be directly addressable in the virtual memory,
including information held in the file system. The fundamental advantage which they saw was
that it avoids much copying of information between the file system and the computational
(virtual) memory. The lack of success of this idea – in my view the most significant of all the
Multics ideas – in the last six decades is due not to a fault in the basic idea, but in the way it
had to be implemented on the hardware available at that time. The Multics idea is discussed in
chapter 12 of the book "Making Computers Secure" (volume 1) which can be downloaded on
the Speedos website (https://www.speedos-security.org/).
1.4.2 Monads
In the late 1970s and early 1980s my team at Monash University in Melbourne, Australia
tackled the problem of providing a uniform mechanism for managing the persistence problem
in a radically different way. Whereas Multics accepted the existence of and need for a file
system, Monads completely rejected this concept and chose to view all the memory which
holds information as a very large virtual memory which can be directly addressed by pro-
grams. This implied that virtual addresses must be much larger than 32 bits, which was the
standard at that time. Consequently my PhD students David Abramson and John Rosenberg
designed and built a system known as the Monads-PC [6], which had 60 bit virtual addresses.
This system proved the concept of a directly addressable large virtual memory which func-
tioned without an additional file system. Several Monads-PC computers were actually built
and successfully used at several universities in Australia and in Germany for research and
teaching purposes. The Monads website (https://www.monads-security.org/) contains exten-
sive diagrams, text and references which explain both the hardware and the software for the
Monads-PC including the Persistent Virtual Memory concept, and also the idea of orthogonal
paging and segmentation, which allows both paging and segments of any size (both smaller
and larger than the single page size).
2
For an overview of the system architecture see https://www.speedos-security.org/. From
this website various books and papers providing further information about Speedos can
be downloaded free of charge.
Main Memory Disc Subsystem
Computational Extended
Memory Computational Memory
File Memory
Computational
Virtual Memory
This solution, which eliminates entirely the idea of a separate file system, allows pro-
grams directly to address the entire file system via a single addressing mechanism. This
mechanism solves many operating system problems (e.g. that of the Multics designers) and
allows programmers to use the persistent programming paradigm proposed by Atkinson and
Morrison [1].
This view of virtual memory implies that virtual addresses must be very much larger
than conventional virtual addresses. In the Speedos solution these are 256 bits long and pro-
vide a worldwide addressing mechanism, as is shown in Figure 3.
256 bits
A virtual address advises the Speedos system at which node in the internet the address
was first assigned, the disk number within node defines the disc on which the addressed ob-
ject was initially created, the container (the physical file) describes where it was created and
the address within container indicates the offset in container of the byte or word which is ad-
dressed. All of these are used as aids to finding a file and its contents. But these are not fixed
in cement. To discover how Speedos virtual addresses are actually managed (including
movements between nodes, etc.) and how such long virtual addresses can be efficiently trans-
lated into main memory addresses, volume 2 of the book "Making Computers Secure" [10]
should be consulted. This can be downloaded from the Speedos website at
https://www.speedos-security.org/.
Enqueue
First
Not all information-hiding modules need to conform exactly to this scheme. For exam-
ple the persistent data structure(s) may be absent, with the result that programs can be defined
which might have only a single entry point or might have multiple entry points, in which case
a compendium of board games can be programmed, for example.
Such modules are the only free-standing units in a system, i.e. the entire persistent
memory is populated only by information-hiding modules. They communicate with each oth-
er via inter-module calls.
In order to make a call from one module to another the calling module must present the
kernel with a valid module capability (see Figure 5) which identifies both the module to be
called and the number of the entry point which it wishes to call. The access rights consist pri-
marily of a bit list indicating which entry points can be called via this capability. If the kernel
is satisfied with the module capability, it then makes an in-process call to the called module,
on the calling user's process stack. Eventually, possibly following further inter-module calls
and returns (also executed by the kernel), the called module will be reactivated at the instruc-
tion following the inter-module call.
Open
Account
The Manager's Program The Tellers' Program
Close
Account
Account
Balance?
The Accountant's Program
Authorise
Overdraft
Add Account Total ...... ......
Interest Balance? Balance?
In Speedos all of this can easily be avoided by providing a semantically appropriate interface
to an information hiding file, e.g. a method for adding interest to an account, one to authorise
an overdraft, etc. (see Figure 7).
The Tellers' Program
Open Close
Account Account
Authorise Deposit
The Overdraft A Set of
Manager's Bank
Program Account Accounts Withdraw
Balance?
Total Add
Balance Interest
Notice also that this arrangement allows the designer of a system to provide internal protec-
tion within a file, in that different agents can be given appropriate (but potentially different)
access rights to the same file, as Figure 8 illustrates.
Open Account √ √ x x
Close Account √ √ x x
Deposit √ √ x x
Withdraw √ √ x x
Transfer √ √ √ x
Add Interest x x √ x
Authorise Overdraft x √ x x
Customer Number √ √ x √
Overdraft Limit √ √ √ √
Current Balance √ √ √ √
A tick indicates that the subject at the head of the column
may carry out the operation in the corresponding row.
On this basis different agents within an organisation (here a bank) can be given different
module capabilities with access rights appropriate for their role in the organisation. For exam-
ple a Head Office Accountant might have a module capability as shown in Figure 9.
Bank Account 0000110011
Module Identifier
Figure 9: A Module Capability for the Head Office Accountant
2.4 Qualifiers
Qualifiers are a new and unusual kind of module. In addition to having normal methods
a qualifier can have "bracket" methods. These can qualify the behaviour of a different object
(the "target" object) with which the qualifier is associated. They may have automatically acti-
vated methods (called "call-in" methods) which "catch" a call to a method of the target in-
stance. They may also have "call-out" methods which are triggered by a call from a qualified
object to some other object (the call-out object). Although they can be used to implement fea-
tures such as synchronisation and protection, qualifiers have no special role with respect to
persistence and so are not further described here. They are explained in detail in volume 1 of
the book "Making Computers Secure" and an implementation is described in volume 2 of the
same book. These can both be downloaded from the Speedos website3. A description of quali-
fiers, with examples explaining how they can be used to protect and confine the information
held in other modules, appears in [14], which can also be downloaded at the Speedos website.
3
see https://www.speedos-security.org/
scheduler that his process should be temporarily deactivated) he can do this from a logout
module of his own choice. Such a module (which is owned by the user, who can also deter-
mine what it does) can contain arbitrary checks devised by the user to check his own identity.
This need not be a simple password, it can for example be a dynamic password, a cognitive
password and/or whether the person attempting to log in has to conform to some required ac-
tions4. The kernel's part in the login and logout mechanism is trivial. In the case logging in of
simply advises the process scheduler that the user is active. This then activates the user's pro-
cess in the latter's logout module, which then validates the user or, if the checks fail, informs
the process scheduler to deactivate the process again. Notice also that there is no central file
which can be hacked to obtain login information.
That concludes our simplified description of those parts of the Speedos architecture
which are relevant to the theme of persistence. Much more information can be obtained at
https://www.speedos-security.org/, including a two volume book on Speedos which can be
downloaded free of charge.
3 Persistence in Timor
Timor is an unconventional object-oriented programming language designed inter alia to sup-
port programs written for the Speedos architecture. A description of the language appears in
the book "TIMOR-An Object- and Component Oriented Language" which can be downloaded
free of charge at the Timor website5. The website also provides a list of published papers de-
scribing various aspects of Timor, which varies in the following ways from conventional ob-
ject-oriented programming languages. It
• replaces OO classes with a type definition that can potentially have a number of dif-
ferent implementations, each with a single constructor which can have implementation-
oriented parameters that can differ in different implementations of the same type;
• supports inheritance in the case of subtype hierarchies which derive from a common
abstract ancestor, where the subtypes primarily vary the behaviour of their supertypes rather
than add new methods (although new methods can also be added), e.g. as in the case of a col-
lection hierarchy;
• adds the concept of views, which are incomplete types (with implementations), that
can be usefully incorporated into different type definitions;
• supports diamond inheritance, and multiple and repeated inheritance with separate
types, using a technique known as parts inheritance;
• replaces subclassing by a flexible new implementation technique based on re-use vari-
ables;
• introduces a new kind of component, known as a qualifying type, which contains
bracket methods that allow instance methods of other objects to be "qualified" in a modular
way, e.g. to protect or synchronise them, thus supporting the separation of concerns;
• provides uniform support for distribution and persistence in the form of persistent ob-
jects and persistent processes;
• introduces an unusual way of handling makers (the Timor name for application-
oriented constructors), binary methods, and class (static) variables and methods, in a new kind
of type, known as a co-type, which can be automatically adjusted covariantly to reflect a sub-
type hierarchy;
• supports genericity in forms which reflect the unusual features of Timor, adding func-
tion parameters which allow programmers considerable flexibility, for example by allowing a
programmer to redefine what is meant by such issues as equality.
4
Login Security checking is discussed in Making Computers Secure, volume 1, chapters
4 and 15, and in volume 2, chapter 22 which can be downloaded from the Speedos
Website https://www.speedos-security.org/
5
https://www.timor-programming.org/
3.1 Support for Collections of Objects
Of particular significance for a persistent system is that Timor has strong support for collec-
tions of objects, since it must provide an alternative for conventional file systems and data-
base systems, which are usually primarily concerned with accessing large numbers of "rec-
ords". Timor fills this gap by supporting a library of collection types with various implemen-
tation possibilities, known as the Timor Collection Library (TCL). The library, which is based
on the doctoral thesis of my former assistant Dr. Gisela Menger [16], has as its starting point
an abstract type Collection, which defines the methods shared by all its subtypes.
Collection
Ordered DuplFree
User
Sorted Bag Set Table
Ordered
Sorted Ordered
List Table
Sorted Ordered
Set Set
Sorted
List
Table
The TCL is based on two basic criteria. The first determines whether duplicate items are
permitted, are ignored or whether a warning signal is raised when an attempt to insert a dupli-
cate is detected. The second concerns the ordering of items in the collection, i.e. whether there
is no ordering, whether the user determines the ordering, or whether they are automatically
sorted. This results in a type hierarchy with five abstract types and nine concrete types. The
names of the 9 concrete types are shown in Figure 12.
Figure 13 shows all 14 types, including the abstract types (which are shaded). This is de-
signed to allow a maximum of polymorphism. The items in a collection are defined generical-
ly.
In derived types the actions of the insert method are specified more precisely, depending on
the node in question. Thus the insert method of the abstract type UserOrdered defines that
insert appends the element at the end of the collection (and adds new methods for inserting at
other positions) but without defining its duplication properties further. On the other hand the
insert method of the concrete type Bag is defined without specifying ordering, but indicating
that duplicates are accepted (with the effect that the duplicate exception DuplEx can be re-
moved from Bag's insert method).
6
Timor types strictly follow the information-hiding principle by not permitting "raw"
data declarations (i.e. fields) to appear in interface definitions. Only methods are permit-
ted. However, to simplify programming, Timor allows some methods to be defined in a
type interface as if they were variables. But in reality the compiler treats each such vari-
able declaration as a pair of methods, often known as "setters" and "getters".
7
Often for programming in the small, a type definition may consist entirely of abstract
variables; this is often called a "record". In this case the compiler produces a standard
implementation of the entire type with the implementation name <typename>::Impl. If
abstract variables are not explicitly initialised default methods are provided automatical-
ly.
can immediately recognise that any implementation of the type can be used.)
A re-use variable may even be another implementation of the type being implemented.
On the other hand the type of a re-use variable does not necessarily have any formal relation-
ship with the type being implemented, except that some (or all) of the interface methods may
have the same definition.
The important difference between a re-use variable and a normal variable is that the
compiler compares the definitions of its interface methods with those of the type being im-
plemented. If some of these have matching signatures, it uses the methods of the re-use varia-
ble to implement them, unless the programmer has also declared the same method explicitly
in the instance section. In the latter case the explicit method in effect overrides that provided
by the re-use variable. Interface methods of a re-use variable which do not match the type
definition are ignored. However they can be invoked in the implementation by programmers.
Re-use variables can greatly simplify implementations of the TCL. The first type to be
implemented is List, and the code of this implementation is declared as a re-use variable in
standard implementations of all the other concrete types, with remarkably few modifications.
This is illustrated in more detail in chapter 13 of the book "TIMOR-An Object- and Compo-
nent Oriented Language", which provides an outline of both the type definitions and imple-
mentations of the TCL methods. This can be downloaded from either the Speedos website8 or
the Timor website9.
8
https://www.speedos-security.org/
9
https://www.timor-programming.org/
instance:
enq10 Int size(); // returns current number of elements
op void clear(); // removes all elements in this collection
enq Boolean contains(ELEM e) throws NullEx;
// returns true if e is an element in this collection
op void insert(ELEM e) throws DuplEx, NullEx;
/* a general method to insert elements; a DuplEx exception or
a NullEx exception may be thrown by appropriate subtypes */
op void remove(ELEM e) throws NullEx, NotFoundEx;
/* removes e (at most once) if this is contained in the
collection */
}
In this example the template identifier is Collection and the single template parame-
ter is <ELEM>, where ELEM is a generic identifier and type indicates what kind of template it
is. The keyword abstract indicates that in this case the type defined in the following tem-
plate is an abstract type. The template body consists of the remaining lines of the example.
Like normal Timor types, each type template can have more than one implementation.
These are defined in implementation templates, which also consist formally of a template
header followed by a template body. The identifier of an implementation template is the name
of the implementation. Here is an example:
template <ELEM>
impl List::Impl{ /* List::Impl is the template id; it is followed by
the code of the generic implementation */
}
However, as the template header of an implementation cannot differ from that of its ge-
neric type, this can be abbreviated simply to the keyword template, as follows:
template impl List::Impl{
...
// code of the implementation
}
Actualising a generic template consists of substituting an actual type name for each generic
parameter which appears in the template header. A variable of an actual type can be declared
as follows.
List<Person*> personList;
// a variable for a List of Person references
Instances of generic types are initialised by invoking a constructor of one of the implementa-
tions of the type. Here is an example showing how a constructor for a List<Person*>
might be called:
List<Person*>::Impl();
Further information about templates, including how they can be derived from other templates,
can be obtained from the book "TIMOR-An Object- and Component Oriented Language".
We have now shown how the Speedos persistent memory can be populated with capa-
bility protected information-hiding file modules which correspond to, and in effect also re-
place the need for, conventional files systems. Depending on the implementation selected
these can produce similar results say to conventional sequential files, to indexed sequential
10
enq and op are keywords which introduce instance methods. These are important for
synchronisation purpose. An enquiry (enq) may not modify the state data, an operation
(op) can change the state data.
files, to random access to B-tree files, etc. but also to multi-indexed files, etc. Furthermore,
the maximum file size of 242 bytes (or words, depending on the implementation, see Making
Computers Secure vol. 2 chapter 23) makes Speedos/Timor suitable for managing big data.
Finally both new type definitions and new implements can be added to the TCL.
3.4.2 Qualifiers
These are types which can modify the behaviour of other types (see section 1.5 above). How
they achieve this is illustrated diagrammatically on both the Timor website
(https://www.timor-programming.org/qualifier-based-protection.html)
and on the Speedos website
(https://www.speedos-security.org/qualifier-based-protection.html).
Qualifying types are normal types which also have bracket methods. These are methods
which can "catch" calls from one module (the client object) to another module (the target ob-
ject) and can access and modify the parameters being passed between them. They can, for
example, invalidate a capability being from the client object to the target. They can also ac-
cess their own state data and thus for example examine an access control list to determine
whether the call is permitted, and if not the can block the call, or make an entry in a log mod-
ule.
As just described these are call-in brackets but qualifier modules can also contain call-
out brackets which can examine and modify the parameters being passed out of a module, and
can from their own state data or via calls to other modules determine whether the call-out may
proceed. Such bracket methods can neutralise attempts by hackers to obtain information to
which they are not entitled. How such qualifiers function is described in chapter 13 section 19
of Making Computers Secure volume 1 and how they can be implemented is described in
chapter 24 of Making Computers Secure volume 2.
4 Conclusion
As Atkinson and Morrison [1] have convincingly demonstrated, the concept of persistence is
significant in principle because it greatly simplifies programming, but without adequate
hardware support it is difficult to implement. The Monads-PC system [17] was the first (and
only) system which has effectively implemented such a hardware system in practice. Howev-
er, the size of its virtual addresses, although revolutionary in the 1980s, has proved to be far
too small for potential use over the Internet. Nevertheless the basic concept underlying the
Monads-PC system was sound and Speedos, a successor system, has now been proposed and
designed using the same basic concept (see the Speedos website https://www.speedos-
security.org/). Speedos uses 256-bit addresses which are unique over all Speedos nodes on the
internet, and are structured in such a way that such addresses provide clues to locating the
objects and processes to which they refer. Speedos also has a technique which allows such
long virtual addresses to be translated into main memory paged addresses as efficiently as
normal pages addresses in RISC systems11. Currently no actual capability hardware exists, but
Keedy has described elsewhere how existing RISC system hardware designs [18] could be
easily adapted to function as capability systems, known as S-RISC, while still supporting pro-
grams previously developed as conventional RISC programs (after a recompilation). It has
become impossible (as a result of the miniaturisation of chips) for normal software research-
ers to build complete hardware systems, so we must rely on Microsoft or Apple or Intel, etc.
to build the hardware required to implement an S-RISC design. This would at last enable
software designers to build a really secure system. The costs to industry12 and to the war ef-
fort for Ukraine and Israel of not having really secure systems are immense. Solutions for the
difficult problems in building a Speedos operating system are described in volume 2 of "Mak-
ing Computers Secure" [10].
A different issue arises at the software level. In a genuinely persistent environment there
is no place for a conventional file system! The Speedos design envisages that the virtual
memory is populated by persistent information-hiding modules. This encourages good soft-
ware design practice, but raises the question of what happens as a replacement for a file sys-
tem. The answer given in this paper is twofold.
First, there is the fact that a persistent information-hiding module, as we envisage it, can
be organised to implement semantic routines in information-hiding modules. These can reflect
the various functions which users want/need in order to carry out their work. They can be pro-
tected by capabilities with separate access rights which are relevant to their different roles in
an organisation.
Second, the programming of such modules can be carried out using the Timor pro-
gramming language. This is a flexible way of organising data structures which opens up many
possibilities for implementing the data. In particular the Timor Collection Library encourages
a maximum of polymorphism while at the same time implementations of these collection
types can be defined to provide the equivalents of conventional access methods, such as se-
quential access, indexed sequential access, random access, B-trees, multi-level indexing or
any other access method, e.g. for managing big data.
Funding: This research did not receive any specific grant from funding agencies in the
public, commercial, or not-for-profit sectors.
11
see Making Computers Secure volume 2 chapter 23 section 1.
12
see https://www.speedos-security.org/the-costs-of-existing-systems.html
References