A History of UNIX That ClicksEpisode 9 / The Floor of Software

The very first machine in the world, with no one to borrow from — how was the first instruction ever entered?

The First Byte — Entered by Hand The very first machine, which had no one to cross-compile from (Episode 8) and nothing to borrow from at all. It has no assembler, and no paper tape to feed in. A human reads the instruction table, builds the machine-code numbers by hand, and enters them into memory one word at a time with toggle switches. Our watchword, "the first egg was carved by hand," becomes almost literal fact.

Tools you'll need: Episodes 7 & 8 (assembly / cross-compiling) The reveal: bootstrap = pulling yourself up by your own bootstraps

In Episode 8 we saw that a new machine is brought up by borrowing "another machine that already runs." But trace that chain all the way back and you always arrive — at the very first machine, with no one at all to borrow from. That first computer in the world had no other machine to assemble for it, and no ready-made paper tape. So how was the very first instruction entered? The answer was as plain as it could possibly be. A human, by hand. This is the floor of software's chicken-and-egg.

01First, a human becomes the assembler — hand-assembly

In Episode 7 we saw that the thing which turns assembly (human-readable) into machine code (numbers) is the assembler. If there is no assembler — then a human does that conversion themselves. Looking at the CPU's instruction table (the manual), "the opcode for this instruction is 6, the address goes here…", they compute the machine-code numbers by hand, on paper. This is called hand-assembly. Picture Episode 7's Figure 1 (assembly), but done with a pencil by a human instead of a machine.

// A human reads the manual and translates into numbers by hand (hand-assembly) Instruction: "Read memory, then go to next" → look up the opcode table … 6032 (octal) // decided by hand → next word … 5357 (octal) // decided by hand This column of numbers is what we'll now enter into the machine "by hand"

02One word at a time, with toggle switches

How do you get the hand-built numbers into memory? Early machines (the PDP-8, early PDP-11, Altair 8800, and so on) had a row of toggle switches (a front panel) on the front. Here's how it works — set the bits (0/1) for one word on the switches, press "DEPOSIT," and that one word is written to memory and the address advances by one. Repeat this once per word. Quite literally, you line up the bits by hand and feed them into the machine. Try touching the front panel below for yourself.

Figure 1: The front panel (touchable). Click the switches to set bits, and DEPOSIT writes one word to memory. Try entering the sample loader from the top down (values are in octal).
Switch = click to flip between 0/1 / operate with the buttons below
Set the switches, then DEPOSIT. Try matching the first value of the sample.
Connecting voice — memory that doesn't forget (core memory) Main memory back then was magnetic-core memory, which kept its contents even after the power was switched off. So a bootstrap you'd entered by hand once could survive a power-down. You didn't necessarily have to toggle everything in from scratch each time. Still, that very first time — someone did, after all, enter it by hand.

03You don't enter all of it — the bootstrap loader

Of course, toggling in an entire OS by hand would be insane. So what you enter is only a very short "loader." That little loader has just one job — to read a bigger program from paper tape (or, later, disk) into memory and hand execution over to it. The PDP-11's bootstrap loader was designed to be as short as possible, precisely because you toggle it in by hand. In many cases, the loading grows step by step, like a staircase: the tiny hand-entered loader → a second-stage loader on paper tape → the OS. Climb that staircase in the figure below.

Figure 2: The bootstrap staircase. Only the first few words are toggled in by hand. That tiny loader reads the second stage, and the second stage reads the OS. The higher you go, the bigger it gets, and the first seed is the few words carved by hand.
The crux this time — the watchword becomes literal

The series watchword, "the first egg was carved by hand," here almost stops being a metaphor. The OS you use now, the compiler, the self-hosting loop from Episode 0 — trace them all the way back and they rest on a few words that someone typed in by hand, on switches, with a manual in one hand. The foundation stone at the very bottom of the towering edifice of software was a human finger.

◇ ◇ ◇

04Etymology — pulling yourself up by your own bootstraps

The word bootstrap comes from a 19th-century turn of phrase, "to pull yourself up by your own bootstraps." Physically it's impossible — a tall tale. It carries the sense of getting something going out of nothing. In Episode 0 we said, "the loop can't start itself; it must be lifted once, from outside." The physical site of that "lift from outside" was this very front panel. And today, when we say to "boot" a computer — to turn it on — that too is rooted in this word bootstrap. The power button you press every morning is a distant descendant of the days when people flipped switches by hand.

Episode 0's watchword, redeemed

"Which came first, the chicken or the egg? — The first egg was carved by hand."
Neither the chicken (running software) nor the egg (its source and tools) sprang from nothing. Only at the very beginning did a human carve a few words by hand, and that tiny seed called a loader, the loader called an OS, a compiler ran on top of the OS, and the compiler entered the loop of reproducing itself. Once the seed is sown, the loop of software making software keeps on turning — this was the shape of the answer to chicken-and-egg.

The honest line — carefully drawing the lines on "one byte" and "by hand"

(1) The "1 byte" in the title is symbolic; the unit you actually enter by hand is the word (18 bits, 16 bits, and so on, depending on the machine). (2) You didn't hand-toggle everything every time — some of it survived in core memory, and later machines burned the bootstrap into ROM and graduated from hand-toggling (the way today's PCs boot is a continuation of that). "Entered by hand" is about the very first time / bringing up a brand-new machine.

(3) The values, bit counts, and step-by-step procedure in Figure 1 are a simplification to convey the feel of operating a front panel, not a rigorous reproduction of any specific model (storing to memory with toggle switches and the bootstrap loader are real practice). (4) And the biggest caveat of all — what turns those hand-entered numbers into "meaning" is still the "machine itself," which lies below. What executes the 0s and 1s of the switches as instructions is wired-up circuitry. We've reached the floor of software, but there is hardware still beneath it — on to the finale, Episode 10.

Practice problems (solvable with this episode alone)
  1. What is hand-assembly? In one sentence, contrasting it with Episode 7's assembler.
    See the answer
    The "assembly → machine-code numbers" conversion that an assembler (a program) performs, done by hand by a human reading the manual. The human plays the role of the assembler themselves.
  2. Briefly describe the operation of putting one word into memory on the front panel.
    See the answer
    Set the bits (0/1) for one word on the toggle switches, and press DEPOSIT to write to the current address. The address advances by one, so you repeat once per word.
  3. Why do you enter only a short loader, rather than the whole OS by hand?
    See the answer
    Because hand-toggling the whole thing is impractical. You enter a tiny loader by hand and have it read a bigger program (the second-stage loader or the OS) from paper tape and the like. The loading grows step by step, like a staircase.
  4. What is the etymology of "bootstrap" and "boot," and how does it relate to Episode 0's watchword?
    See the answer
    bootstrap = pulling yourself up by your own bootstraps (an impossibility), carrying the sense of getting going out of nothing. The physical site of Episode 0's "the loop is lifted once, from outside" is the front panel. Today's "boot" (start-up) shares this root. The watchword "the first egg was carved by hand" here becomes literal.

SummaryThe floor of software was a human finger

Trace the cross-compiling chain of Episode 8 back and you arrive at the first machine, with no one at all to borrow from. There is no chicken (running software) and no egg (tools). So a human reads the CPU's manual, builds the machine-code numbers by hand (hand-assembly), and enters them into memory one word at a time with the front panel's toggle switches. You don't enter all of it — what you enter by hand is only a tiny bootstrap loader, which reads a second stage from paper tape, and the second stage becomes a staircase that reads the OS.

bootstrap is the name of the impossibility of "pulling yourself up by your own bootstraps," and the site of that "single lift from outside" was this front panel (the root of today's "boot"). Episode 0's watchword, "the first egg was carved by hand," here becomes almost literal — the foundation stone of the towering edifice of software is a human finger. But what turns the hand-entered 0s and 1s into meaning (execution) is still the machine itself, lying below. We've reached the floor of software. One question remains — who made the hardware that turns that machine code into "action"? In the finale, down to the very bottom floor.

This document is Episode 9 of the series "A History of UNIX That Clicks." Historical facts: early computers (the IBM 650, DEC PDP-5 through PDP-8, early PDP-11, Altair 8800, and others) were equipped with a row of front-panel toggle switches, and the operator manually entered the start-up instructions into memory before handing control to the CPU. Because main memory's magnetic-core memory retained its contents even when powered off, an already-entered bootstrap could survive. The bootstrap loader was designed to be as short as possible because it was toggled in by hand, and it read a second-stage loader (such as a checksummed Binary Loader) or the OS from a paper-tape reader. Hand-assembly is a human working out machine code by hand from the manual, without using an assembler. "bootstrap" derives from the 19th-century "pulling yourself up by your own bootstraps" and is the root of today's "boot" (start-up). The figures, values, and bit counts are simplifications to convey the concept of the operation, not rigorous reproductions of any specific model. What turns the hand-entered machine code into execution (meaning) is the hardware (the instruction decoder and the like), which the next Episode 10 covers. — To print, use your browser's "Print" and "Save as PDF" (in the print version, the figures' controls and the answers are frozen / hidden).

Print / save as PDF: ⌘+P (Ctrl+P on Windows). On screen, in Figure 1 you can click the front-panel switches and DEPOSIT to write to memory (try entering the sample loader). Figure 2's slider lets you climb the bootstrap staircase. "See the answer" opens each solution.