Read Just for Fun : The Story of an Accidental Revolutionary Online

Authors: Linus Benedict Torvalds

Tags: #Autobiography and memoir

Just for Fun : The Story of an Accidental Revolutionary (7 page)

BOOK: Just for Fun : The Story of an Accidental Revolutionary
5.25Mb size Format: txt, pdf, ePub
ads
So I spent close to $2,000 for the Sinclair QL. Most of what I did with it was one programming project after another. I was always searching for something interesting to do. I had a Forth language interpreter and compiler, just to play around with. Forth was a strange language that nobody uses anymore. It was kind of a fun, niche-market language that was fairly widely used in the 1980s for different things, but it never became very popular, being difficult to follow for non-techie people. Actually it was kind of useless.
I wrote programming tools for myself. One of the first things I bought for the machine was an expansion bay with an EEPROM card (Electrically Erasable and Programmable Read Only Memory). It’s memory you write yourself with special modules, and it stays around when you turn the power off. That way, I could have the tools easily available to me whenever I wanted, without having to load them into RAM (random access memory) and use precious RAM for programs.
What got me interested in operating systems: I bought a floppy controller so I wouldn’t have to use the microdrives, but the driver that came with the floppy controller was bad so I ended up writing my own. In the process of writing that I found some bugs in the operating system—or at least a discrepancy between what the documentation said the operating system would do and what it actually did. I found it because something I had written didn’t work.
My code is always, um, perfect. So I knew it had to be something else, and I went in and disassembled the operating system.
You could buy books that contain partial listings of the operating system. That helps. You also need a disassembler, a tool that takes the machine language and turns it into assembly language. That’s important because when you only have a machine language version, it’s difficult to follow the instructions. You find that an instruction will jump to a numerical address, which makes it very hard to read. A good disassembler will make up names for the numbers and also allow you to specify names. It also can be used to help you identify particular instruction sequences. I had my own disassembler that I could use to create reasonably nice listings. When something didn’t work, I could go in and tell it to find the listing from a particular spot, and I could see everything that the operating system was going to do. Sometimes I used the disassembler not because something was buggy but because I was trying to understand what it was supposed to do.
One of the things I hated about the QL was that it had a read-only operating system. You couldn’t change things. It did have hooks—places where you can insert your own code to take over certain functions—but only at particular places. It’s so much nicer to be able to replace your operating system completely. Doing an operating system in ROM (read-only memory) is a bad idea.
Despite what I’ve said about Finland being such a technology butt-kicker, the Sinclair QL wasn’t making big inroads in Europe’s seventh-largest nation. Because the market was so small, whenever you wanted to buy upgrades for the iconoclastic, leading-edge machine, you had to do it from England, via postal order. It involved scouring catalogues until you found someone who sold whatever it was you wanted. Then you had to get together certified checks and wait weeks for delivery (this being before the days of Amazon.com and credit cards). That’s what I had to do when I wanted to expand my RAM from 128 kilobytes to 640 kilobytes. That was the drill when I bought a new assembler, to translate assembly language into machine code (the ones and zeros), and an editor, which is basically a word-processing program for programming.
Both the new assembler and editor worked fine, but they were on the microdrives and couldn’t be put on the EEPROM. So I wrote my own editor and assembler and used
them
for all my programming. Both were written in assembly language, which is incredibly stupid by today’s standards. It’s complicated and time-consuming—I’d guess it takes a hundred times longer to solve a problem in assembly language than in the C language, for example, which was available at the time.
I added a few commands to the basic interpreter that came with the machine so that when I wanted to edit something I basically just ran my editor automatically and it was instantly there. My editor was faster than the one that came with the machine. I was particularly proud of how fast I could write characters to the screen. Normally, with a machine like that, it would take so long to fill the screen with characters that you could see text scroll. And I was pleased with the fact that with my editor, you wrote text so fast that when you scrolled quickly down you created a blur. That was important to me. The improvement made the machine feel much snappier, and I knew that I had done a lot of work to make it operate so fast.
At this time, there weren’t very many people I knew who were as involved in computers as I was. There was a computer club at school, but I didn’t spend much time there. It was basically for kids who wanted to know about computers. There were only about 250 students in my entire high school, and I don’t think anybody else had been using one since the age of ten.
One of the big things I liked doing on my Sinclair QL was to make clones of games. I wrote clones of the games from the VIC-20 that I had enjoyed and sometimes I added enhancements. But mostly they were not better: a better machine, not a better concept.
My favorite game was probably Asteroids, but I could never make a good clone of it. The reason was that, at the time, all the arcade Asteroids games were done with real vector graphics. Instead of having graphics based on small dots—pixels—they had graphics that were actually done the way a cathode-ray tube (CRT) works, which is to have electrons shot out from an electron cannon from behind the CRT and deflected with magnets. They got much higher-resolution graphics that way, but you couldn’t reproduce this very easily. You could make a clone, but it wouldn’t look like the original Asteroids game if you wrote it on a computer that didn’t have the special graphics capability.
I remember making a Pac Man clone in assembly language. The first step is to kind of remember what the Pac Man characters are supposed, to look like. Then you try to draw them on a sixteen-by-sixteen grid of paper, with color. And if you are artistic, you can do a good job. But if you are Mr. Non-Artistic, like I am, it ended up looking like Pac Man’s sick cousin.
Okay, so it wasn’t a very good clone. But I was really proud of it. The game was actually playable, and I sent it in to one of the magazines that published computer code. I had sold other programs to magazines and thought this would be a natural.
Not.
One of the problems was that the program had been written in assembly language. That meant that if you made the slightest,
slightest
mistake copying it from the magazine, it wouldn’t work.
I wrote some of my own games, too. But it takes a certain mindset to create games. Because games require a lot of performance, you have to get really low down into the hardware of the computer. I could do that, but I didn’t have the game play mentality. What makes a great game is not usually how fast it is or how good the graphics are. There has to be something that makes you play it—something that keeps you with it. It’s just like movies. Special effects are one thing, but you also need a plot. And my games never had a plot. A game has to have a progression, an idea. Often, the progression is just that the game gets faster. That’s what Pac Man does. Sometimes the maze changes or the monsters get better at following you.
One of the things that interested me about Pac Man was tackling the problem of making graphics that don’t flicker. It’s a fairly common problem in older computer games, because without special hardware your characters just flicker. The way you move your characters around is to take away the old copy and write a new copy. If you happen to have bad timing, people can actually see when there’s no copy, so it flickers. You can get around this in multiple ways. You can actually draw the new guy first and
then
remove the old guy, but you must be careful not to remove that part of the old guy that was occluded by the new guy. Instead of seeing an irritating flicker, you get a good effect—you sometimes see the shadow of the old character on the screen. The brain interprets that in a good way. It doesn’t flicker, but it creates a motion blur. The trouble with this solution is that it is fairly expensive and time-consuming to create.
There’s a reason that games are always on the cutting edge, and why they often are the first types of programs that programmers create. Partly it has to do with the fact that some of the smartest programmers out there are fifteen-year-old kids playing around in their rooms. (It’s what I thought sixteen years ago, and I still suspect it’s true.) But there’s another reason games are so pioneering: Games tend to push hardware.
If you look at computers today, they’re usually fast enough for anything. But the place you test the limits of the hardware are with action games, like some of the 3-D ones that are now popular. Fundamentally, games are one of the few things on computers where you can tell if things aren’t happening in real time. In word processing, you don’t mind a delay of a second here or a second there. But in a game, it starts to be noticeable at a sub-tenth of a second. Games used to be fairly simple. These days, programming is actually a fairly small part of any game. There’s music, there’s the plot. If you compare it to making a movie, the programming component is just the camera work.
So I had the Sinclair QL for three years. It took me from high school to the University of Helsinki to the Finnish Army. It was fine, but we were definitely ready to part ways. In the last year or so I had discovered its shortcomings. The 68008 was a good enough CPU, but I was reading about the next generation 68020, and learning about such virtues as memory management and paging. These new computers could do things that are really important when you are working on low-level stuff.
What irritated me about the Sinclair QL was that while the operating system was capable of multitasking, you could still crash at any time because there was no memory protection. One task that decided to do something bad could just crash the machine.
The Sinclair QL was Sir Clive Sinclair’s last foray into designing and making computers. One of the reasons: It wasn’t commercially successful. It had interesting technology, but the company had production problems and quality assurance problems and the inevitable bad press. Moreover, the market was beginning to become more competitive.
The late 1980s were the years when you could start to imagine that, yes, maybe someday your average trolley rider would own a computer, if only to perform word processing. And all signs pointed to the PC. Yes, the original IBM PCs had started flooding the shelves and becoming successful despite numerous technical shortcomings. Those ubiquitous beige creatures had the IBM stamp of approval, after all, and that meant a lot. Another attraction: The peripherals were standard and easy to obtain.
I was reading about all these newer CPUs that
could
do what I wanted. It became clear that the 68020, which
looked
interesting, wasn’t going anywhere. I could have considered buying a CPU upgrade for the QL. In those days that meant basically rebuilding the machine. And the operating system didn’t know about memory management, anyway, so I would have had to write my own version. So it was like:
Hhhmmm. Doing that will be a big step. And it will be expensive to get a new CPU.
And then there was still the increasing headache of buying things for the computer. It wasn’t as if there was a Sears catalogue for the Sinclair QL and you just picked up the phone and ordered more memory. The postal-order-from-England routine was getting old. (I didn’t mind that there was no shrink-wrapped software because I was able to write all that myself.)
There was a positive side effect to this pain-in-the-neck. When I was thinking about getting rid of the machine, I decided to sell my peripherals—the real hard drive I had purchased because I couldn’t take the microdrive one second longer, and my expansion RAM. But there weren’t people lined up in the streets searching for such stuff, so you had to advertise in a computer magazine and pray. And that’s how I met my good friend Jouko Vierumaki, who turned out to be probably the only other person in all of Finland who owned a Sinclair QL. He answered my ad and took the train from Lahti and bought some of my peripherals. Then he introduced me to snooker.
II
My first year at university, the Sinclair QL sat on a desk against my first-floor bedroom window on Petersgatan, but I didn’t do much in the way of programming. Partly it was a matter of wanting to concentrate on my studies. But also, I simply found myself lacking a project to do on my computer. Lack a project and you lack enthusiasm. You’re trying to come up with something that might motivate you.
It seemed like the perfect time to join the army, which I knew I would have to do anyway. I was nineteen years old and irritated with my computer’s shortcomings and unattached to any interesting computer project. I boarded a train for Lapland.
I’ve already indicated how clueless I was about, among other things, the physical demands of army service. So after the eleven months of phys ed-with-firearms, I felt perfectly justified in spending the remaining decades of my life in blissful inactivity, with the only exercise coming from tapping code into a keyboard or gripping my fingers around a glass of pilsner. (In fact, the first nearsport activity after leaving the army didn’t take place until almost ten years to the day following my discharge, when David coerced me into going boogie-boarding with him in the killer waves at Half Moon Bay. I practically drowned, and my legs were sore for days.)
Army service ended on the 7th of May, 1990. Although Tove would tell you I have trouble remembering our anniversary, I can’t possibly forget the date I was discharged.
The first thing I wanted to do was get a cat.
I had a friend whose cat had produced a litter a few weeks earlier, so I bought the sole remaining kitten, which was white, male, beautiful—and, because he had spent his first few weeks in the outdoors, easily able to live both inside and outside my mother’s apartment. I named him Randi, short for Mithrandir, the white wizard in
Lord of the Rings.
He is now eleven years old and, like his owner, has become totally adjusted to the California lifestyle.
BOOK: Just for Fun : The Story of an Accidental Revolutionary
5.25Mb size Format: txt, pdf, ePub
ads

Other books

The Fury Out of Time by Biggle Jr., Lloyd
Fool's Fate by Robin Hobb
Mark of the Witch by Maggie Shayne
David Waddington Memoirs by David Waddington
Fears and Scars by Emily Krat
The Dragon Scroll by I. J. Parker
Letter from a Stranger by Barbara Taylor Bradford
To Bed or to Wed by Sandra Sookoo
Domesticated by Jettie Woodruff