
Restoring YC's Xerox Alto: how our boot disk was trashed with random data - dwaxe
http://www.righto.com/2016/09/restoring-ycs-xerox-alto-how-our-boot.html
======
russellsprouts
The shift-xor "random" number generator described actually has an interesting
property. The algorithm looks like this:

1\. If the value is 0, output the magic number.

2\. If the value has only its high bit set, output 0.

3\. Otherwise, shift the value to the left

4\. if there was an overflow (the high bit was 1 before the shift), xor the
value by a magic constant.

For certain values of the magic constant, this has the property of generating
every integer in the range exactly once.

~~~
mzs
And with 077213 and 012345 octal that is what happens. That's why the
distribution was so uniform when Ken checked.

~~~
userbinator
[https://en.wikipedia.org/wiki/Linear-
feedback_shift_register...](https://en.wikipedia.org/wiki/Linear-
feedback_shift_register#Uses_in_circuit_testing)

I suspect it was deliberately chosen to do this for the purposes of testing
the disk; the sequence is random-looking so it exercises all the bits, but is
also deterministic so that written data can be verified by reading it back and
comparing without having to store a copy of all the written data somewhere
else.

------
vcarl
I love these posts. I don't properly understand the majority of what's being
done, but a step by step of somebody solving a difficult problem in a space I
know nothing about is so fascinating.

~~~
monkpit
I love these posts too, but man is it a pain to read on mobile. Quit hijacking
my input!

Edit: I know I can use the readability mode, but I don't like being
essentially forced to do so.

~~~
kens
Can you explain what the problem is? I recently switched the mobile formatting
so Google would stop complaining that my page wasn't optimized for mobile. But
maybe that made things worse.

~~~
monkpit
I left a more detailed reply
([https://news.ycombinator.com/item?id=12514009](https://news.ycombinator.com/item?id=12514009))
to the other person in the thread, but basically while trying to zoom I get
sent to other posts or images.

------
drbawb
Out of curiosity: what would it take to turn that disk back into a working
boot disk? I can only imagine how difficult it must be to find an Alto _with
two disk drives_ these days to dub a boot disk onto your scrubbed one.

Does the Alto have any sort of recovery environment? e.g: boot from the
(3Mbit?) Ethernet, or boot from a floppy/tape, etc. that would aid in such a
task?

~~~
kens
The easiest thing would be to boot the Alto off a good disk, then swap the
disks and write a good boot environment to the bad disk. (You can switch disks
while the system is running.)

One of the guys working on the restoration (Carl) is building a FPGA-based
disk emulator, which we could use to re-write the bad disk (as well as read
and archive disks).

The Alto supports network boot over Ethernet; I'm working on a BeagleBone-
based Ethernet emulator/gateway so that's another option. (The Alto's 3 Mbit
Ethernet isn't compatible with anything modern, so I can't just plug an
Ethernet cable into it.)

~~~
rogerbinns
> You can switch disks while the system is running

Is that something you can do at any time, or only at the "home" screen when no
apps are running?

~~~
kens
I think you can switch disks pretty much any time. The Alto doesn't swap to
disk so the disk is only being used when you're loading a program or
loading/saving a file. As far as how it's used, think of the Alto's disk more
like a floppy drive than a hard drive. (Although since it takes a minute for
the disk to spin up to speed, you don't want to switch disks too often.)

------
ChuckMcM
Hah! Nice job on inverting the random number generator. And note that RNGs for
testing data patterns have much less stringent requirements than
cryptographically secure RNGs :-). I'm hopeful that a known good disk will
actually boot something.

~~~
jandrese
Getting a good RNG on 1970s hardware is almost impossible without some kind of
custom device. There is no end to examples of horrible RNGs from that era,
sometimes manifesting in amusing ways. There was an implementation of
Minesweeper that naively used the rand() call from C's standard library and
generated utterly predictable boards.

I am rather impressed at how the author of the article actually tracked down
the appropriate RNG function to verify exactly what happened. This is only
possible because the PARC community was so small there would only be a couple
of ways something like this could have possibly happened?

~~~
kens
What made it possible to track down the RNG function was that the Computer
History Museum has a big archive of Alto code [1]. By searching that site with
Google, I found the random number source code. Of course figuring out the code
is a bit of a challenge since it's in BCPL or Nova assembly.

Hopefully as part of our Alto restoration we'll be able to add more old Alto
disks to the online archive. Maybe the disk labeled "Alan Demo" will have an
exciting long-lost Alan Kay demo on it :-)

[1]
[http://xeroxalto.computerhistory.org](http://xeroxalto.computerhistory.org)

------
dboreham
Typo: "7141 TTL chip" should be "7414 TTL chip"

~~~
kens
Fixed. The spell-check didn't catch that for some reason :-)

~~~
dboreham
Where's that machine learning when you need it ;)

------
Animats
They'll have to find or build a 3Mb/s Ethernet anyway. Ask around; maybe
someone still has a 3Mb/s to 10Mb/s gateway. If they can get to 10Mb on coax,
they can get an off the shelf box to go to 10baseT and to the modern world.

~~~
kens
The Living Computer Museum is working on a 3Mb/s Ethernet gateway. I'm also
looking into making one with a BeagleBone (which is why I've been looking at
its PRU microcontrollers lately).

------
coverband
Reading this effort is as exciting as watching a good detective show.. I'll
almost be disappointed if they don't come across any other blocking issues on
the way to success (as long as they find a way to overcome it, of course ;-)

------
dalke
I know it's not really relevant to the repair work, but I jumped back to the
first article, at [http://www.righto.com/2016/06/y-combinators-xerox-alto-
resto...](http://www.righto.com/2016/06/y-combinators-xerox-alto-
restoring.html) . It says

> The biggest impact of the Alto was in 1979 when Steve Jobs famously toured
> Xerox and saw the Alto and other machines. When Jobs saw the advanced
> graphics of the Alto and Star, he was inspired to base the user interfaces
> of the Lisa and Macintosh systems on Xerox's ideas, making the GUI available
> to the mass market.

The reference is " Malcolm Gladwell describes Steve Jobs' visit to Xerox in
detail in Creation Myth."

But quoting
[http://web.stanford.edu/dept/SUL/sites/mac/parc.html](http://web.stanford.edu/dept/SUL/sites/mac/parc.html)
:

> The closest thing in the history of computing to a Prometheus myth is the
> late 1979 visit to Xerox PARC by a group of Apple engineers and executives
> led by Steve Jobs. According to early reports, it was on this visit that
> Jobs discovered the mouse, windows, icons, and other technologies that had
> been developed at PARC. ... It's a good story. Unfortunately, it's also
> wrong in almost every way a story can be wrong. ...

> Both the Macintosh and Lisa projects were underway before the 1979 visit.
> Documents in The Book of Macintosh (a collection of essays, technical specs,
> and brainstorms written by Jef Raskin on and others) dating from the fall of
> 1979-- months before the PARC visit-- show that the Macintosh was going to
> feature user-friendly interfaces; a screen that could handle multiple fonts
> (that is, bitmapped screens); graphics capabilities; and a graphical input
> device. ...

> Finally, as several authors have pointed out, there were actually two visits
> by groups from Apple to Xerox PARC in 1979. Steve Jobs was on the second of
> the two.

~~~
kens
Chapter 23 of "Dealers of Lightning" points out that everyone describes the
Steve Jobs visit(s) in contradictory ways. "No anecdote from PARC's history is
burdened by so much contradictory testimony. PARC engineers disagree about who
delivered what portions of the demonstration; on how many demos there were and
when they took place; whether Jobs and his people saw an Alto or a Dorado..."

I recommend "Dealers of Lightning" for the best description of Steve Jobs'
visits and their impact on him. The short summary is there were two visits to
PARC in December 1979. Adele Goldberg tried to demonstrate just the publicly-
announced technology (WYSIWYG browser, mouse, drawing program) but was forced
by management to show Steve Jobs all the secret stuff (e.g. Smalltalk,
overlapping windows). Steve Jobs considered the three mind-bending things he
saw to be the user interface, object-oriented programming and networking, but
he was "saturated" by the UI and missed the significance of the others. The
book goes into detail on exactly what Apple was doing before the visit and how
it changed their plans. The book has a whole chapter on this, way more than I
can cover here, so please read the book if you're interested in this.

~~~
digi_owl
No surprise that Jobs would fixate on the UI thing. He never struck me as a
techie, but someone that got into tech because it was easy to mesmerize people
with. The UI was a perfect tool for that.

~~~
bane
Yeah, that makes a certain kind of sense. I'm spending some spare time
listening to interviews with old Atari employees on the ANTIC podcast and one
thing comes through again and again. Lots of investment was being made in
networking and programming languages and almost nobody outside of PARC had any
real ideas about GUIs. A couple Atari employees who came from PARC at the time
tried to get it into products, but just couldn't.

Apple likewise didn't produce a GUI for their contemporary computers.

The most that people seemed to really be shooting for was higher density text
displays and colorful graphics, but nobody had really figured out the magical
combination of manipulation device and interface metaphor and Jobs did just
"get it" and understood why it would be a major differentiator - few people
had more than one computer to network, and few people liked programming.

