LINUX--a free unix-386 kernelLinus Torvalds (torvalds@kruuna.helsinki.fi)
October 10, 1991
Introduction to LINUX
What is LINUX?LINUX is a free unix-like kernel for 386-AT computers, coming withfull source code. It is meant for hackers/computer science students touse, learn and enjoy. It is written mostly in C, but parts ofit are in gnu-format assembler, and the boot-sequence is in intel 086assembly language. The C-code is relatively ANSI, with a fewGNU enhancements (mostly __asm__ and inline).
While there are a number of unices available for 386 computers, most ofthem cost a lot of money, and come with no source. Thus, they are idealfor actually using your computer, but if you want to learn howthey work, you are f- -ked.
There are also a few unices available with source. Minix, the learningtool written by Andrew S. Tanenbaum, has been used in universities as ateaching tool for years. The BSD-386 system comes with source, but has arestrictive copyright and costs a lot of money ($995 is the startingprice, I think). The GNU kernel (Hurd) will be free, but is currentlynot ready, and will be too big to understand and learn.
LINUX most closely resembles Minix, in that it is small and not verysophisticated, and thus easy (well...) to understand. LINUX wasalso written under Minix, so there are quite a bit of similarities, andany Minix hacker will feel relatively at home with LINUX. None of theMinix code was used in the project though, so the Minix copyrightdoesn't cover the new system. It also is completely free, and hasa very loose copyright. Thus there is no need for megabytes of diffslike under Minix.
The LINUX copyrightWhile being freely distributable, I do restrict the use of LINUX in afew ways:
[list][*]You may freely copy and redistribute the source and binaries, as long as:[list][*]complete source is available. Thus binaries may not be distributedby themselves, even if you have made changes to them.[*]you do not profit from the distribution. In fact even ``handlingcosts'' are not acceptable.[*]you keep the appropriate copyrights intact.[/list][*]You may change the source to your liking, but if you distributeparts of the new system (or just binaries), all the new code must beincluded.[*]You may make small excepts from the code without includingcopyrights. This is up to you, but a reference to me or the code wouldbe appreciated.[/list]This should be loose enough not to cause any worry in anybody using orexpanding the system. If you have a friend who really doesn't want thesource, but just a working binary, you may of course give it to himwithout worrying whether I will sue you. Keep it between friends, though.
Hardware/software needed to get LINUX runningLINUX was written on a 386-AT running Minix. As LINUX is a realoperating system, and goes directly to the hardware to do things, youhave to have a very similar system to get it going without problems:
[list][*]386-AT (PS/2's are different enough that things won't work)[*]VGA or EGA screen hardware.[*]Standard AT hard-disk interface, IDE disks work fine (in factthat's what I use).[*]Normal real-mode BIOS. Some machines seem to use virtual-86 modeto run the bootup program, and on such machines LINUX won't boot upand run correctly.[/list]While LINUX will be expanded to be a self-sufficient system, Minix-386is currently needed to get the ball rolling. You need Minix to make theinitial root file system, and to compile the OS binary. After thatLINUX is a self-sufficient system, but Minix is recommended in orderto make file system checking (fsck) and to recompile the systemafter making changes.
Getting LINUXLINUX can currently be gotten by anonymous ftp from `nic.funet.fi' in thedirectory '/pub/OS/Linux'. This directory contains the full source to the operatingsystem, as well as a couple of binaries so that you can actually use thesystem.
NOTE! The binaries are mostly GNU software,and are under a stricter copyright (the GNU copyleft) than the LINUX sources. Thus you may not redistribute them without distributing theirsource, found in /pub/GNU. See any GNU software package for moreinformation on the GNU copyleft.
The various files found in this directory are:
[list][*]linux-0.03.tar.Z--complete source to the operating system,in a 16-bit compressed tar archive.[*]Linux.tex--LATEX source for this file.[*]bash.Z--bash binary to run under LINUX. This binary shouldbe put under tha name /bin/sh in the file system reserved forLINUX (see installation).[*]update.Z--update binary, to be put in /bin/update.[*]gccbin.tar.Z--GNU cc binaries needed to get a workingcompiler. This tarred archive contains the compiler, loader, assemblerand support programs (nm, strip etc). It also contains a small librarysufficient for most programs.[*]include.tar.Z--include-files necessary to get gcc working.[*]unistd.tar.Z--source to the unistd library routines (iesystem call interface). With this you can build a bigger library byusing system-independent library sources.[*]utilbin.tar.Z--binaries to various GNU utilities, includingGNU fileutils, make and tar. Also contains the emacs-clone uemacs.[*]README, RELNOTES-0.01, INSTALLATION--ascii files containingsome (somewhat out-of-date) information about LINUX.[/list]The absolute minimum needed to get a system going is the OS source andthe bash and update binaries. You won't be doing much with just thesethough.
InstallationAfter you have gotten the necessary LINUX files, you need to compilethe system and make a root directory. The necessary binaries need to beput in the root file system.Do this:
[list=1][*]Back up your software. While LINUX never has destroyed any of myfiles, nothing is certain. Better safe than sorry.[*]Choose/make a standard Minix HD-partition to be the new LINUX rootfile system.[*]Make the necessary device nodes on the new root. LINUX uses thesame type of nodes as Minix, so use the Minix mknod command tomake the following devices:[list][*]/dev/tty[*]/dev/tty[0-2][*]/dev/hd[0-9][/list]Node numbers are the same as in Minix.[*]Move the necessary files to the new root partition. The filesshould be in the following directories:[list][*]/bin:[list][*]sh, ie bash.Z.[*]update[/list][*]/usr/bin:[list][*]Contents of utilbin.tar.Z[/list][*]/usr/include:[list][*]Contents of include.tar.Z[/list][*]/usr/local/lib:[list][*]Contents of gccbin.tar.Z, excepting gcc[/list][*]/usr/local/bin:[list][*]gcc[*]links to files in /usr/local/lib of your choice. I linkld, as, nm, strip and size to theircounterparts in /usr/local/lib/gcc-XXX.[/list][*]Edit the linux/include/linux/config.h file for your system. This file contains the system-specific information: memory space, disktypes, root partition number (again the numbering is the same as inMinix), keyboard type (currently just US and Finnish) etc.[*]Compile the LINUX sources. A simple make should do thetrick, after you have edited the makefiles to suit your system(ie, removed the -mstring-insns flag and changed the paths to suityou.) Users of gcc versions earlier than 1.40 will probably haveto add gnulib to the `LIBS ='-line in the makefile.[*]Copy the resultant Image-file to a floppy (ie, cp Image/dev/PS0 or similar.)[*]Reboot with the new floppy. The startup screen should tell youthat the system is booting (Loading system ...), then some vitalroot file system information (xxx/XXX inodes/blocks free),followed by a Ok. and the bash prompt (initially bash# ifyou have no .bashrc file).[/list]Hopefully you now have a functioning unix, and you are logged in asroot. LINUX currently has no 'init' process, and as soonas you log out, the system will sync and just wait. Use thethree-finger-salute to reboot your machine.
[/list]
Things missing/incomplete in LINUXWhile LINUX is meant to be a fully selfsufficient kernel, this iscurrently not the case. As already mentioned, you need Minix to setthings up, and to check the file system once it's running. There are anumber of other deficiencies:
[list][*]Incomplete hardware-support. Some of the standard features of anAT are not currently supported. Most notably are floppy disk drives,making using LINUX for real work (backing up etc) currently notpossible. Also some of the features of the serial lines aren't yetimplemented (hard-wired to 2400bps, no hang-up notification etc).[*]Incomplete standard C library. The libc.a found in the gccdistribution package is not complete, and I'm very much interested infreely distributable library functions.[*]Some of the system calls are not fully implemented. This concernsmostly ``seldom-used'' features like debugging (yeah, who needs itanyway, don't all your programs work the first time :-) and someother features.[*]As mentioned, no login and init processes. CurrentlyLINUX boots up in single-user mode, with the root as console-user.This is enough for some porting work, but not really practical.[*]387-support is not yet implemented, although some skeletonroutines are present. The gcc-binary found on `nic.funet.fi' will correctly usesoft-float (ie emulation function calls) for the four basic mathoperations. 387-support will materialize as soon as a 387 finds its wayinto my computer. Hopefully in a month or two.[*]None of the important system-administration commands has yet beenwritten for LINUX. These include things like mkfs, format,fsck, mknod etc. Some of these need kernel features not yetimplemented (format, mknod), some just need to be written.As with the library, I'd welcome any freely distributable files.[/list]As you can see, LINUX is as yet not a complete system. Your help isappreciated to make it better. I'm not interested in Minix-commandsrewritten for LINUX, unless you have written them yourself fromscratch. You are of course free (and encouraged) to use everything youhave in your Minix-distribution for your own LINUX-system, but due tothe Minix copyrights, they cannot be distributed to a wider audience.
Some of the probelms mentioned here will be fixed by me (ie seriallines/387/floppy support) as soon as possible, but I'm hoping to gethelp with the libraries etc. Bug-reports/patches and wish-lists will beappreciated, and if you actually have the patch to the problem, I'll tryto implement it right away. Small changes will be sent out as patches tothe mailing list and be set up on `nic.funet.fi', but after heavy rewrites orbigger patches, the whole system will be updated at `nic.funet.fi'.
Porting software for LINUXLINUX was designed to make porting relatively easy. Thus the fulltermios-implementation, and the somewhat POSIX library. The(admittedly relativly few) programs I've ported posed no problems.
Even though LINUX resembles Minix a great deal, Minix programs are notgenerally easier to port than programs designed for some other unix.Thus I wouldn't recommend starting from a Minix-version of a particularprogram, but instead trying to port the ``virgin'' program from scratch.Being closer to SYSV than BSD means that most programs port easily whengiven a -DUSG or -DSYSV flag.
One of the more difficult problem in porting can be missing libraryfunctions. These must be written by you, or copied from some othersource (Minix being one possibility for those that have it).Alternatively, some programs (notably GNU) have various flags making itpossible to define which functions aren't available (the GNU fileutilswill compile quite nicely, once a sufficient number of-DXXX_MISSING flags are added to the Makefile.)
Programs already portedThese programs have already been ported to LINUX:
[list][*]GNU cc (gcc, cc1, cpp)[*]GNU assembler (as386)[*]GNU binutils (ld, ar, nm, size, strip, ranlib)[*]GNU compress (16-bit)[*]GNU tar[*]GNU make[*]GNU bash (Bourne Again SHell)[*]GNU sed[*]GNU bison (yacc-lookalike)[*]GNU awk[*]GNU fileutils (ls, cp, rm, mkdir, rmdir, tail etc)[*]less[*]uemacs[/list]All of the above sources can be found on `nic.funet.fi' (mostly in`/pub/gnu'), and most of the LINUX-binaries can be found in thedirectory '/pub/OS/Linux'. All of these programs compiled without changes, eventhough gcc (cc1) has some enhancements of my own. Mail me fordiffs/sources, but try first to compile them yourself.
Additionally I have reports that GNU diff compiles cleanly and works.
Technical helpLINUX currently has a mailing-list, which you can subscribe to bymailing to the address: Linux-activists-request@niksula.hut.fiand asking to be included into the list. You can then ask questions bymailing them to Linux-activists@niksula.hut.fi, which willduplicate your question/answer/whatever and send them to all persons onthe list.
Note the difference between Linux-activists andLinux-activists-request -- the first sends mail to all persons onthe list, the second is used only to subscribe and unsubscribe from thelist.
Naturally, you can also mail me directly at torvalds@kruuna.helsinki.fi. I'll try to answer all questions within aday or two.
Although `nic.funet.fi' will probably be kept reasonably up-to-date, there are afew problems with it (ie, I cannot personally get to the files, but haveto go through a couple of persons). Thus people on the mailing-list willget patches/binaries faster if they ask for them.
ThanksI'd like to thank the academy ...
Seriously, this system never would have seen the light of day or wouldhave been much worse without the help of some others. Bruce Evanshelped me find the places needed to be changed in order for gcc tocorrectly handle floating point, and came with a lot of usefulideas/suggestions (and his Minix-386 was used to build the system). Also, Earl Chew's estdio package was used for the standardIO-library. More freely distributable packages like this!
Alain W Black and Richard Tobin made the gcc for Minix, without which Icouldn't have compiled the thing. GNU made most of the programs I useunder LINUX. Alfred Leung sent the US keyboard patches.
PS. ``Thanks'' to wirzeniu@kruuna.helsinki.fi for his``constructive'' criticism and ``witty'' comments. He was also my first[img=14,14]file:///S:/Webdup/MyWebsites/Linux.old/download/latest/oldlinux.org/Linus/img1.png[/img]-tester, and should be given a medal for courage.
About this document ... LINUX--a free unix-386 kernelThis document was generated using theLaTeX2HTML translator Version 2002 (1.62)
Copyright © 1993, 1994, 1995, 1996,Nikos Drakos, Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999,Ross Moore, Mathematics Department, Macquarie University, Sydney.
The command line arguments were:
latex2html -local_icons -address gohigh@sh163.net -split 1 Linux.tex
The translation was initiated by root on 2004-05-08
dhq 于 2009-07-17 08:59:35发表:
回顾历史,展望未来。