The System Call

Atlas has no instruction for entering the operating system. An instruction that asks the supervisor for something looks exactly like one that does not: the same forty-eight bits, the same four fields, the same encoding. What decides is one digit of the function code. A nought and the hardware obeys the instruction, unless the code is one nobody ever allocated, in which case it interrupts instead. A one and it does not execute it at all — it puts the address aside, advances the program counter, turns the remaining nine digits into an address in a table the program cannot write to, and changes what the machine is allowed to touch.

New to the user and kernel boundary? Start here

A program cannot be allowed to do everything. It must not write over another program's memory, drive a disc directly, or turn off the thing that stops it doing those. So the processor runs in more than one mode, and what is permitted depends on which mode it is in.

But the program still needs those things done, so there has to be a way to ask. The way is not a jump: a jump to an address of the program's choosing would put the operating system's privileges under the program's control. It is an instruction the hardware refuses to execute, and which sends the machine to a fixed place instead. Everything a program may ask for is one of a small, numbered set.

That mechanism is what a system call is, and this page is about the machine where it is easiest to see, because the whole thing is one digit of one field and both of its manuals are online.

What a processor actually does

A processor fetches an instruction, works out what it says, does that one small thing, and moves to the next. Add these two numbers. Put this number there. If that number is zero, carry on somewhere else. That is the job, and it repeats a few billion times a second.

Everything that looks like cleverness is arrangement around that loop: keeping the next instruction ready before it is asked for, keeping recently used numbers close by, letting a slow part and a fast part work at once. The machines here are those arrangements, and most of them exist because one part of the machine is thousands of times slower than another.

The machine for this idea on its own is Stored Program, if you would rather press it than read about it.

Machines here that come first: The Interrupt, Stored Program.

One digit of a function code, and two different machines

1 One forty-eight-bit word, and the digit that says whether the hardware obeys it

An Atlas instruction is one forty-eight-bit word. The archive's own description: “An instruction, specifying a function F (most-significant 10 bits), two index registers Ba and Bm (7 bits each) and an address N (least-significant 24 bits)”. A function code is written as one binary digit followed by three octal digits, and that first digit is the whole of the boundary between a program and the operating system.

fieldbitspositionthis instruction
F100 to 91714 (1111001100)
Ba710 to 16whichever index register the instruction names
Bm717 to 23whichever index register the instruction names
N2424 to 47whatever address the instruction names
leading function digit
1
so this instruction is
an extracode: A-type
and the hardware
enters the fixed store
control switches
main to extracode

the address goes to B119, the control counter is advanced, and the nine digits below the mode digit make a fixed store address: table 7, register 12, which is word 1804

One digit of the function code, and the hardware does not execute this instruction at all. It files it. This one is an extracode: A-type, the hardware enters the fixed store, and control switches: main to extracode.

2 Where a one sends it: 512 numbered doors, and no way to make a 513th

A one in that digit does not run a subroutine of the program's choosing. The nine digits below it are an address in a table the program cannot write to, and there are only so many of them. The count is fixed by the encoding: nine digits, and no instruction a program can write reaches a five hundred and thirteenth. Howarth: “An object program enters the supervisor via one of a possible maximum of 512 instructions known as Extracode Instructions”, and “the finite number of entry points to the supervisor enable complete protection to be enforced by the Supervisor program”.

The nine digits split three and six: one of eight jump tables at intervals of 256 words, and one of 64 registers in it.

jump table
7
register in it
12
word of the fixed store
1804

And the register the hardware builds to get there, twenty-four bits of extracode control:

100000000011100001100000

That register is built here twice: once from the Ferranti manual's table, which numbers its bits from the top, and once from the Atlas design description's, which numbers them from the bottom and calls the same function digits by the opposite names. All 24 bits agree.

3 How many of the 512 one published list allocates

512 is what the encoding permits, and it is never the number that existed. The design description's own allocation table says what each pattern of the top four function digits is for. Six digits are free below them, so every pattern is 64 codes, and counting the table gives the split the same document states in prose one paragraph later.

digits 47 to 44allocated to
0000unallocated
0001basic B
0010basic test
0011basic A
0100unallocated
0101basic B, and extracode return
0110basic test
0111basic A, and extracode return
1000extracode B entry
1001extracode B entry
1010extracode B entry
1011extracode B entry
1100extracode B entry
1101extracode A entry
1110extracode A entry
1111extracode A entry
B-type extracodes possible
320
A-type
192
and so in all
512

How many were ever allocated, counted from the extracode list the Computer Conservation Society publishes with its Atlas emulator:

allocated
272 of 512
which is
53.1 per cent
tabletypeallocated
0B-type54 of 64
1B-type51 of 64
2B-type29 of 64
3B-type23 of 64
4B-type31 of 64
5A-type21 of 64
6A-type14 of 64
7A-type49 of 64

Five of the sixteen four-digit patterns are B entries and three are A entries, six free digits below each, so 320 and 192. The design description states those two numbers in prose a paragraph after the table this is counted from.

4 The same word in the other control, and what the door costs

Two of the sixteen patterns are basic functions that also carry a return. Change the control the machine is in, at the top of this page, and watch what the same forty-eight bits do. The design description: a code of that shape “is decoded whilst on main control the corresponding basic function with digit 46 = 0 is performed” — the return half is not an error and not a trap. It is dropped.

codein the control chosen abovein the other one
0521does its basic work onlydoes its basic work and returns
0720does its basic work onlydoes its basic work and returns

Under main control these do their ordinary arithmetic and the return half of the instruction is discarded. Not an error and not a trap: ignored.

And the door is cheap. The design description lists, for each extracode, how many basic orders it obeys, and says the count “includes the extracode order and its entry in the jump table”. Two of them obey exactly 2, which is the entry and nothing else: the pure cost of changing control is two instruction issues. Reaching the supervisor's own long routines is a different thing entirely, and Howarth measures it: “the time to switch the central computer from an object program to an S.E.R. and back again is generally around 40 instructions”. Two against forty, both measured in 1962, and both of them are called entering the supervisor. They are not the same measurement: the two counts the extracode order and its jump-table entry, one way, and Howarth’s forty counts the trip out and back.

These ran in this browser when the page loaded. Each claim, whether it held, and the number behind it.

Each claim, whether it held, and the values behind it
claimheldmeasured
of the 1,024 function codes, 512 are extracodes, and it is the leading digit that says so every timeyesten function digits, one of them the mode. Howarth calls it a possible maximum of 512 and so does the 1961 paper
the manufacturer's manual and the design description agree on all 24 bits of the extracode control register, for every one of the 512yesone numbers its bits from the top and the other from the bottom, and the layouts are the same register
the allocation table gives 320 B-type and 192 A-type extracodes, which is 512 in allyesthe design description states 320 and 192 in prose a paragraph later; this is its own table counted
the 512 entries land on 512 distinct fixed store words, the last at 1855, inside the 2,048 the document reservesyeseight tables at intervals of 256 words, 64 registers in each
128 of the 1,024 function codes carry a return to main control, and every one of them is a basic instructionyestwo of the sixteen patterns of the top four digits, six free digits below each. The table says which two; nothing here names them
the jump table a code enters is the first octal digit of the way it is written, for all 512yesand the register within it is the other two digits, so 1714 is table 7, register 14 in octal, which is 12
function 521 returns to main control when it runs under extracode control, and does not when it runs under main controlyesthe manual's own two examples, 521 and 720, are one of each of the allocation table's two return-carrying patterns
of the 512 possible extracodes, 272 were ever allocated, which is 53.1 per centyes84 A-type of 192 and 188 B-type of 320, counted from the Computer Conservation Society's published table
the four fields are 10, 7, 7, 24 bits and cover the whole 48-bit wordyesthe manual prints them as a row of dots, one per bit, and they count out to the same four numbers

What is real here, and what is not

The trap is not the only way to reach the supervisor, and the page must not say it is

Howarth's sentence is narrower than it is usually quoted. He writes that entering by extracode “is the only means by which an object program can use extracode control” — and two sentences earlier he writes that “Object programs call the supervisor into action either by causing an interruption and initiating a short interrupt routine, or by initiating an S.E.R.” Faults, overflow, a page that is not there and a peripheral that wants attention all reach the supervisor without any extracode at all. What the 512 entry points bound is the set of places a program may deliberately enter.

Two documents, opposite bit numbering, and that is why they are worth comparing

Ferranti's extracode manual calls the most significant function digit f0 and numbers a register's bits from the top. The Atlas design description calls the same digit f9 and numbers from the bottom, 23 down to 0. This page builds the extracode control register twice, once from each document's own printed table, and compares all twenty-four bits for every one of the 512 codes. Nothing here would have caught a shared mistake; what it catches is a transcription error, which is the mistake actually available to make.

512 is a maximum and never a count

Both 1962-era papers say so. Howarth: “a possible maximum of 512”. The 1961 paper, describing the machine that existed: “The fixed store contains about 250 subroutines which can be called in from an object program by single instructions called extracodes”. The Computer Conservation Society's published list for its emulator carries 272 distinct codes, which is a later and fuller accounting. This page prints 272 and says whose count it is; it does not reconcile the two. A later list being fuller is a reason for the gap and not a measurement of it, and nothing here separates how much of it is extracodes added over the machine’s life from how much is a difference in what the two counts were counting.

Atlas does not say user mode and kernel mode

It says main control, extracode control and interrupt control, and each has its own program counter, so there are three and not two. It says object program for what we would call a process, and private store for the region a program may not touch. Those are the words used here. The modern pair is a fair translation and it loses the third control, which is the most privileged of the three.

The per-group counts are somebody else's, and this page says whose

The 320 and the 192 are derived here from the allocation table, and the design description states the same two numbers independently. The 272 and its breakdown by jump table are transcribed from the Computer Conservation Society's own list and are not derived from anything: what can be checked here is that they are consistent with the A and B split, which they are, and the test parses the archived table and derives them again rather than trusting the transcription.

Nothing here executes an Atlas program

This page decodes instructions and computes where an extracode would land. It does not simulate the fixed store, the one-level store, the drum, or any extracode's actual work. There is a real Atlas emulator and it is not this: the Computer Conservation Society's runs real Atlas jobs and enters most extracodes by the authentic method. This is an explanation of one bit, checked against the documents.

Not the first system call, and this page does not claim it

The Burroughs B5000's operator for entering its control program is documented in 1961, and Stretch's mode changes are earlier still; the Ferranti Orion had a similar mechanism. What Atlas is, is early and unusually well documented, and its documents are open. That is the reason it is the machine on this page rather than a claim about who was first.

One number here is not what an earlier draft of this page had

An earlier count of how many extracodes the design description lists was reported as a range, 249 to 261, because a line-anchored search over the extracted text was defeated by page breaks in it. Re-parsed, the figure is 259. The range was not a scan problem and it was not honest uncertainty: it was a parse that could not see the whole document reporting the width of its own blind spot as a property of the source. This page does not print that figure at all, and the reason it does not is here rather than nowhere.

Two 1962 dates that are easy to swap

Howarth's The Atlas Supervisor Program is July 1962 and is his alone. The Kilburn, Payne and Howarth paper it cites, The Atlas Supervisor, is the Eastern Joint Computer Conference of December 1961, and both the archive's own page and its usual citations date it 1962, which is the proceedings volume's imprint rather than the conference. Howarth's own reference list calls it F.J.C.C., which is a different conference again.

Sound: no

Asked and answered. There is nothing here with a duration except two instruction counts, and both are printed. A click per mode switch would be a decoration of a number already on the screen.

Sources