Linux hits 23 - the Time Machine that changed the world!

Filed Under: BlackBerry, Featured

Linux reached the entirely respectable age of 23 this week, more or less.

More or less 23, that is, not more or less respectable.

25 August 1991 was the day that a Finnish student named Linus Torvalds announced that he was working on a hobby operating system, and invited people to say what they'd like to see in it.

Ironically, because his project didn't have a name yet, he posted his announcement to the newsgroup comp.os.minix with the subject line What would you like to see most in minix?

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 to know what features most people would want. Any suggestions are welcome, but I won't promise I'll implement them :-)

MINIX, as it is more properly known, is a UNIX-like operating system (OS) written in the late 1980s by Andrew Tanenbaum of the Vrije Universiteit in Amsterdam.

Tanenbaum, now 70, will give his farewell lecture in October 2014 after 43 years at the Vrije Universiteit, so you can say he knows a thing or two about computer science.

Torvalds certainly realised that.

He took numerous ideas from MINIX (which was, after all, initially created as a teaching tool) and used a MINIX computer for his early development.

What turned into Linux, however, ended up very different from MINIX indeed - possibly as different as you can get from an OS point of view.

What's the difference?

The big difference between Tanenbaum's OS and Linus's is right at the heart of the software.

Many modern operating systems: Microsoft Windows, Apple's OS X, the various flavours of BSD, as well as Linux and its derivatives, have a giant lump at their core known as a monolithic kernel.

The bulk of the operating system, including the code for scheduling processes, understanding and accessing data on disk, keeping track of your mouse, managing network connections and much, much more, is done inside the highly-privileged kernel.

This means, very loosely speaking, that if a malware writer can insinuate his code into the kernel, you're in trouble.

Most, if not actually all, security bets are off, because malware inside a monolithic kernel can do things that are anathema to security.

For example, kernel malware can typically:

  • Read and write arbitrary disk sectors, without any access control limitations.
  • Peek into and alter any running program's memory.
  • Sneakily modify the behaviour of already-active programs.
  • Snoop on everybody's network traffic.
  • Lie to higher-level software to give a false sense of security.

It certainly sounds as though you'd want to keep the kernel as tiny as possible, and implement things like file systems and device drivers in what's called userland, the less privileged environment that is managed by the kernel.

That way, a comparatively small amount of code known as a microkernel (about 10,000 lines in the latest release of MINIX), comparatively easy to audit, can be made responsible for managing and enforcing the security of the rest of the system.

In contrast, even though Linux started life with about 10,000 lines, the kernel now consists of more than 15 million lines of code (although not all of them are always used).

Imagine how long it might take you to find a bug in something that big.

What about performance?

Microkernels, it turns out, are surprisingly unusual, notably for performance reasons.

Passing data and program flow between userland and a microkernel takes longer than it does inside a monolithic kernel - because of all those pesky security checks you need to do.

And so most laptops and many of the mobile devices we use today ended up with monolithic, or macrokernel-based, OSes.

(One notable mainstream exception to the path that Linus took is QNX, a microkernel Unix-like OS that was famously adopted by BlackBerry for its version 10 release.)

Tanenbaum and Torvalds notoriously clashed online over macro-versus-micro early in 1992, with Tanenbaum famously suggesting that:

LINUX is a monolithic style system. This is a giant step back into the 1970s. That is like taking an existing, working C program and rewriting it in BASIC. To me, writing a monolithic system in 1991 is a truly poor idea.

When a story emerged in 2004 suggesting that Linux was tainted because Torvalds stole code from Tanenbaum, the latter came out strongly in support of Torvalds to say that it simply wasn't so.

But Tanenbaum's evidence-in-chief was of an amusingly ironic sort:

...[T]he code was [Linus's]. The proof of this is that he messed the design up... Instead of writing a new file system and a new memory manager, which would have been easy, Linus rewrote the whole thing as a big monolithic kernel, complete with inline assembly code :-( . The first version of Linux was like a time machine. It went back to a system worse than what he already had on his desk.

What of the next 23 years?

Today, Linux still has a public image of being not much more than a "geek thing," at least as a desktop OS, just like it was back in the early 1990s.

But Linux is the brand, if you want to call it that, behind brands as big as Google, which uses Linux not only to run its data centres but also as the heart of its Android product.

So that macrokernel implementation decision, in what was just a hobby project, has ended up with enormous implications.

That's the thing about time machines: they have a way of changing history.

, , , , , , ,

You might like

8 Responses to Linux hits 23 - the Time Machine that changed the world!

  1. Joe · 408 days ago

    Nice article. Your article reminded me that, years ago, QNX put their OS and a browser on a 1.44MB HD floppy disk to demonstrate how micro a microkernel really can be.

  2. Peter L. · 408 days ago

    Neither OS X [1] nor Windows (the NT line [2]) use a monolithic kernel, but rather employ a hybrid kernel [3].

    • Paul Ducklin · 407 days ago

      I guess I'm using the term "monolithic kernel" and "macrokernel" sort of interchangably to mean "not a microkernel", notably where things like file systems, process management and device drivers share an execution space.

      I'm still not entirely sure what the difference between "hybrid" and "monolithic" is after reading your reference [3] above, at least from a security point of view. I'm not even sure that the author of that article was entirely sure, either :-)

  3. Laurence Marks · 408 days ago

    Nicely written, Paul!

  4. JR · 408 days ago

    Linux = UNIX. Say what you will, calling it something else is just pretending you don't know who the real pioneers were in the 60s and 70s.

    • Paul Ducklin · 407 days ago

      I think the problem with calling Linux "UNIX" is quite simply that it isn't, and there was (perhaps still is) a time where that was legally a very big deal in letting anyone think that it might be.

      IIRC, one of the factors in Linux's early acceptance is that the OS release that turned into "the BSDs" got tied up in court over exactly the issue of where UNIX ended and its derivatives started.

      • Kent Peacock · 407 days ago

        I don't think JR is talking about the name, but what it is and does. The story of the lawsuit between BSDI (with UC Berkeley) and AT&T is an interesting one. AT&T ultimately lost. I was an early BSDI licensee, and still run it on a server that's been running 24/7 since 1998.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

About the author

Paul Ducklin is a passionate security proselytiser. (That's like an evangelist, but more so!) He lives and breathes computer security, and would be happy for you to do so, too. Paul won the inaugural AusCERT Director's Award for Individual Excellence in Computer Security in 2009. Follow him on Twitter: @duckblog