views:

376

answers:

4

Hi there

I've heard many times that Linus Torvalds is a genius when it comes to writing good code. I also wish to write good code and I'd like to see how the first version of Linux was written.

Does anyone know where I can find the first version of Linux? I'm looking for the first version (not 1.0) because I think it will be smaller and easier to understand.

Many thanks.

+3  A: 

You can find archives of all versions of the Linux kernel on www.kernel.org. Version 1.0 can be found here, and earlier versions can be found here. They can also be accessed by git.

If you want to see a much simpler kernel, I suggest taking a look at Unix v6.

Adam Rosenfield
Didn't know about the Unix v6, thanks for the link and the info.
legends2k
+6  A: 

As at this time is only a comment, and not an answer, I believe you should get and read the Minix kernel, that has been in development for decades, but has always been kept small enough for it to be explained in full in a single book. It has historically been used as a teaching tool for OS principles, but now it's slowly expanding its focus to be an usable general purpose OS.

MINIX 3 is a new open-source operating system designed to be highly reliable, flexible, and secure. It is loosely based somewhat on previous versions of MINIX, but is fundamentally different in many key ways. MINIX 1 and 2 were intended as teaching tools; MINIX 3 adds the new goal of being usable as a serious system on resource-limited and embedded computers and for applications requiring high reliability

This new OS is extremely small, with the part that runs in kernel mode under 4000 lines of executable code. The parts that run in user mode are divided into small modules, well insulated from one another. For example, each device driver runs as a separate user-mode process so a bug in a driver (by far the biggest source of bugs in any operating system), cannot bring down the entire OS. In fact, most of the time when a driver crashes it is automatically replaced without requiring any user intervention, without requiring rebooting, and without affecting running programs. These features, the tiny amount of kernel code, and other aspects greatly enhance system reliability.

voyager
A: 

Others have hinted at this, but I'll state it since you might be unaware: Linus wrote the original Linux kernel, not all of what is normally Linux or GNU/Linux (the command line programs, all the userland applications, etc). Many other heavy hitters did a lot of the kernel modules, too.

dj_segfault
Linux *is* just the kernel you dolt. And the guy's name is *Linus*.
alex tingle
Alex Tingle is correct, but I'd like to clarify one important point: The "command line programs, etc" are what we call the GNU operating system. Linux, in turn, is one of its kernels, and the combination of the two are properly refered to as GNU/Linux.There are some people who dispute this for political reasons. To me, saying GNU/Linux is simply a matter of common courtesy towards the hackers that built GNU. Also, it's a way to direct people's attention towards the important work of the Free Software Foundation.See http://www.gnu.org/gnu/gnu-linux-faq.html#why for more.
Stefan Kangas
With just Linux (i.e. a kernel), you won't do much things, you really need GNU tools (the first one being gcc). So it's more than courtesy, using the shortcut "Linux" is technically wrong.
Pascal Thivent
KDE is not related to GNU, so one what should say? KDE/GNU/Linux?
ntd
"If you feel that X11 deserves credit in the system's name, and you want to call the system GNU/X11/Linux, please do. ... at some point you will have to set a threshold and omit the names of the many other secondary contributions. ... one name that cannot result from concerns of fairness and giving credit, not for any possible threshold level, is “Linux”. It can't be fair to give all the credit to one secondary contribution (Linux) while omitting the principal contribution (GNU)."http://www.gnu.org/gnu/gnu-linux-faq.html#many
Stefan Kangas