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

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

Authors: Linus Benedict Torvalds

Tags: #Autobiography and memoir

BOOK: Just for Fun : The Story of an Accidental Revolutionary
10.77Mb size Format: txt, pdf, ePub
When you try and load a real program from disk, invariably there’s a bug in the disk driver or in the loader because it doesn’t understand what it’s reading in. So it prints out a running commentary on what it’s doing. It’s important because that’s how you can find out what is going wrong.
I got to the point where my program was loading the shell and generating a printout of every system call that the shell contained that I hadn’t yet implemented. I booted, ran the shell, and it would spit back something like: “system call 512 is not done.” Day and night I was looking at printouts of system calls, trying to determine which ones I was doing wrong. But this was much more fun than taking a list of calls and just implementing them. You got to see progress being made.
It was late August or early September when I finally got the shell working. From that point, things got a lot easier.
This was a big deal.
When I got the shell working, I was pretty much immediately able to compile a few other programs. The shell was more complicated than the cp (copy) program, for example, or the 1’s (for getting a directory listing) program. Everything you needed had to be there for the shell already, so once the shell was working it went from close to zero to 100 in nothing flat, because all these pieces had been in place. At some point there was enough in place that I experienced a Let
There Be Light
moment, because until then, nothing had really worked.
Yes, I felt a great sense of satisfaction. I think that was particularly important because I hadn’t been doing anything that summer except working on the computer. This is not an exaggeration. The April through August period is pretty much the best time of the year in Finland. Folks are sailing in the archipelago, sunning themselves on beaches, sitting in their summer-cottage saunas. But I rarely even knew if it was day or night, weekend or weekday. Those thick black curtains blocked out the near round-the-clock sunshine, and the world. Some days—nights?—I’d roll out of bed directly into the chair at my computer, less than two feet away. Apparently my dad was bugging my mom to make me get a summer job. But she didn’t mind: I wasn’t bothering her. Sara was a bit annoyed that the phone lines were always tied up when I went online. She could probably write that sentence with a little less diplomacy. It’s not an exaggeration to say that I had virtually no contact with the world outside my computer. Okay, maybe once a week a friend would knock on my window and if I wasn’t scrolling through important code I would invite him in. (It was always a him—remember, this was before geeks were considered cool.) We would drink tea and maybe watch an hour of MTV in the tiny kitchen. Now that I think of it, yes, I do recall going out for an occasional beer or for some snooker after having my window pounded by someone like Juoko (I call him “Avuton,” which means “he who slays dragons,” but that’s another story). But, in all honesty, nothing else was going on in my life at the time.
And I didn’t feel the least bit like some pathetic, paleskinned, propeller-head loser. The shell was operational, which meant that I had actually built the foundation of a working operating system. And I was having fun.
With the shell working, I started testing its built-in programs. Then I compiled enough new programs to actually do something. I was compiling everything in Minix, but I moved the shell over to a special partition that I had created for the new operating system. Privately I called it Linux.
Honest: I didn’t want to ever release it under the name Linux because it was too egotistical. What was the name I reserved for any eventual release? Freax. (Get it? Freaks with the requisite X.) In fact, some of the early make files—the files that describe how to compile the sources—included the word “Freax” for about half a year. But it really didn’t matter. At that point I didn’t need a name for it because I wasn’t releasing it to anybody.
VIII
From:
[email protected]
(Linus Benedict Torvalds)
To: Newsgroups: comp.os.inix
Subject: What would you like to see most in minix? Summary: small poll for my new operating system Message-ID:
Hello everybody out there using minix-I’m doing a (free) operating system (just a hobby, won’t be big and professional like gnu) for 386 (486) AT clones. This has been brewing since April, and is starting to get ready. I’d like any feedback on things people like/dislike in minix, as my OS resembles it somewhat (same physical layout of the file-system (due to practical reasons) among other things).
I’ve currently ported bash (1.08) and gcc (1.40), and things seem to work. This implies that I’ll get something practical within a few months, and I’d like to know what features most people would want. Any suggestions are welcome, but I won’t promise I’ll implement them:-)
PS. Yes-it’s free of any minix code, and it has a multi-threaded fs. It is NOT portable (uses 386 task switching etc.), and it probably never will support anything other than AT-harddisks, as that’s all I have:-(.
The most hard-core operating system enthusiasts among the Minix crowd felt a spark. Not many suggestions about Minix features came my way, but there were other inquiries.
>Tell us more! Does it need a MMU?
Answer: Yes
>How much of it is in C? What difficulties will there be in porting? Nobody will believe you about non-portability;-), and I for one would like to port it to my Amiga.
Answer: It’s mostly in C, but most people wouldn’t call what I write C. It uses every conceivable feature of the 386 I could find, as it was also a project to teach me about the 386. Some of my “C” files are almost as much assembler as C.
As already mentioned, it uses an MMU, for both paging (not to disk yet) and segmentation. It’s the segmentation that makes it REALLY 386-dependent (every task has a 64Mb segment for code
&
data-max 64 tasks in 4Gb. Anybody who needs more than 64Mb/task-tough cookies).
And I even got a few folks offering to be beta testers.
In the end, it wasn’t much of a decision to post it. That was how I was accustomed to exchanging programs. So the only real decision was, at what point am I comfortable to dare show this off to people? Or, phrased more accurately: When is it good enough that I won’t have to be ashamed of it?
What I ultimately wanted was to have a compiler and a real environment so that you could create programs in Linux itself, without having to use Minix. But I felt so proud when the gnu shell worked that I was ready to let the world see. Also, I wanted feedback.
By the time the shell worked, I had a few rudimentary binaries I’d compiled for the operating system. You really couldn’t do anything, but you could see that it was something resembling Unix. In fact, it worked like a very crippled Unix.
So I just decided I would make it available. I wouldn’t tell anybody publicly. Instead, I just informed a handful of people by private email, probably between five and ten people in all, that I had uploaded it to the ftp site. Among them were Bruce Evans of Minix fame and Ari Lemke. I uploaded the sources to Linux itself and a few binaries so that you could start something. I told people what they needed to do in order to try and run this thing. They still had to have Minix installed—the 386 version—and they still had to have the GCC compiler. In fact they had to have my version of GCC, so I made that available, too.
There’s a protocol for numbering releases. It’s psychological. When you think a version is truly ready to be released, you number it version 1.0. But before that, you number the earlier versions to indicate how much work you need to accomplish before getting to 1.0. With that in mind, the operating system I posted to the ftp site was numbered version 0.01. That tells everybody it’s not ready for much.
And yes, I remember the date: September 17, 1991.
I don’t think more than one or two people ever checked it out. They had to go to the trouble of installing the special compiler, getting a clean partition so they could use that to boot, compiling my kernel, and then running just the shell. Running the shell was basically all you could do. You could print out the sources, which amounted to just 10,000 lines—that’s less than 100 pages of paper if you printed with small font. (Now it’s something on the order of 10 million lines.)
One of the main reasons I distributed the operating system was to prove that it wasn’t all just hot air, that I had actually done something. On the Internet, talk is cheap. Regardless of what you do, whether it be operating systems or sex, too many people are just faking it in cyberspace. So it’s nice, after talking to a lot of people about building an operating system, to be able to say, “See, I actually got something done. I wasn’t stringing you along. Here’s what I’ve been doing….”
And Ari Lemke, who insured that it made its way to the ftp site, hated the name Freax. He preferred the other working name I was using—Linux—and named my posting: pub/OS/Linux. I admit that I didn’t put up much of a fight. But it was his doing. So I can honestly say I wasn’t egotistical, or half-honestly say I wasn’t egotistical. But I thought, okay, that’s a good name, and I can always blame somebody else for it, which I’m doing now.
As I mentioned, my operating system really wasn’t very useful. For one thing, it would crash very easily if you filled up memory or if you did anything nasty. Even if you weren’t doing anything nasty, the operating system would crash if you kept it running for any length of time. But it wasn’t meant to be run at that stage. It was meant to be looked at. Yes, and admired.
So it wasn’t intended to be anything but a specialty for the few people who were interested in creating new operating systems. Very technical people—and even within technical people, a special interest group.
Their reaction was invariably positive, but positive in a kind of “It would be nice if it could also do this” kind of sense, or “It looks cool but it really doesn’t work on my computer at all.”
I remember one email whose writer said he really liked my operating system, and he went on for at least one paragraph to tell me how nice it was. Then he explained that it had just eaten his hard disk, and that my disk driver was flaky or something. He had lost all the work he had done, but he was still very positive. It was fun to read that kind of email. It was a bug report about something that screwed him up.
That was just the sort of feedback I was looking for. I fixed some bugs, like the one that caused it to lock up when it ran out of memory. And I made the big step of porting the GCC compiler to the operating system, so I could compile small programs. That meant users wouldn’t need to load my GCC compiler before running the operating system.
IX
Do you pine for the days when men were men and wrote their own device drivers?
—announcement of the posting of Linux version 0.02
Early October saw the release of version 0.02, which included some fixed bugs and a few additional programs. The following month I released version 0.03.
I probably would have stopped by the end of 1991. I had done a lot of things I thought were interesting. Everything didn’t really work perfectly, but in a software kind of world I find that once you solve the fundamental problems of a project, it’s easy to lose interest. And that’s what was happening to me. Trying to debug software is not very engaging. Then two things happened to keep me going. First, I destroyed my Minix partition by mistake. Second, people kept sending me feedback.
Back then I was booting into Linux but used Minix as the main development environment. Most of what I was doing under Linux was reading email and news from the university’s computer via the terminal emulator I had written. The university computer was constantly busy, so I had written a program that auto-dialed into it. But in December, I mistakenly auto-dialed my hard disk instead of my modem. I was trying to auto-dial /dev/tty1, which is the serial line. But by mistake I auto-dialed /dev/hda1, which is the hard disk device. The end result was that I inadvertently overwrote some of the most critical parts of the of the partition where I had Minix. Yes, that meant I couldn’t boot Minix anymore.
That was the point where I had a decision to make: I could reinstall Minix, or I could bite the bullet and acknowledge that Linux was good enough that I didn’t need Minix. I would write the programs to compile Linux, under itself, and whenever I felt I needed Minix I would just add the desired feature to Linux. It’s a big conceptual step when you drop the original hosting environment and truly make a program self-hosting, so big that I released the new version as 0.10 in late November. A few weeks later came version 0.11.
That’s when there actually started to be a number of people using it and doing things with it. Until then, I had gotten maybe one-line bug fixes. But now, people were sending me new features. I remember going out and upgrading my machine to have 8 mgs of RAM instead of 4 mgs, to accommodate the need for additional memory. I also went out and bought a floating-point coprocessor because people had started asking me if Linux would support their floating-point coprocessors. The extra hardware would enable my computer to perform floating-point math.
I remember that, in December, there was this guy in Germany who only had 2 megabytes of RAM, and he was trying to compile the kernel and he couldn’t run GCC because GCC at the time needed more than a megabyte. He asked me if Linux could be compiled with a smaller compiler that wouldn’t need as much memory. So I decided that even though I didn’t need the particular feature, I would make it happen for him. It’s called page-to-disk, and it means that even though someone has only 2 mgs of RAM, he can make it appear to be more by using the disk for memory. This was around Christmas 1991. I remember on December 23rd trying to make the page-to-disk work. By December 24th, it kind of worked but crashed every once in a while. Then on December 25th, it was done. It was basically the first feature I added to serve somebody else’s need.

Other books

Mandrake by Susan Cooper
The Elegance of the Hedgehog by Muriel Barbery, Alison Anderson
Odd Thomas by Dean Koontz
The Sinner by C.J. Archer
Airs & Graces by A.J. Downey, Jeffrey Cook
Untwisted by Cari Quinn, Taryn Elliott
The Vampire Blog by Pete Johnson