Linux-Lite

Updated 28/03/96

Paul Gortmaker
Paul.Gortmaker@anu.edu.au


Linux Lite (aka v1.09)

Various mods to the lightweight v1.09 kernel to make it even lighter.


NEWSFLASH!

The current version of Linux-Lite will run in a mere 896kB with floppy, math-emu, hard-disk, and ext2fs support!! This means you can bootstrap a machine with only 640kB `normal' and 256kB `extended' memory. A two-disk bootstrap set can be found below. Here is proof!

Console: mono *MDA 80x25, 4 virtual consoles
Calibrating delay loop.. ok - 2.09 BogoMips
Memory: 500k/1280k available (292k kernel code, 384k reserved, 104k data)
Floppy drive(s): fd0 is 1.2M
Linux version 1.0.9 (root@foo) #2 Tue Feb 6 15:22:58 EST 1996
Partition check:
  hda: hda1 hda2
VFS: Mounted root (ext2 filesystem).


Introduction

Linux v1.0.9 was the first stable v1.x kernel officially released. In comparison to the current 1.2.13 stable release, it has a significantly smaller memory requirement, and in comparison to the 1.3.x development series, it is a lot smaller. Add onto that my patches to enable all sorts of things as options (floppy, serial, modules, etc.) and you can have a kernel that will boot and run on a machine with only 896kB of RAM!!!

Boot and Root Disks

Most distributions don't cater to such low memory systems, leaving you with the problem of how to get Linux on the machine in the first place. Now if you could only get a minimal system on there so you could then load stuff on...

Here is the answer. A two disk set that will boot up and install a minimal linux system onto your hard disk, so that you can then easily load on additional software via floppies. And it works in systems with only 896kB of available RAM.

Boot disk for 1.2MB floppies
Root disk for 1.2MB floppies

Boot disk for 1.44MB floppies
Root disk for 1.44MB floppies

Note1: This two disk set was not really designed for people who are new to linux. Rather it was aimed at those who have used linux before, but wanted to try putting it on a machine with very little memory (ie 2MB or less RAM). If you are new to Linux, I suggest looking at the Linux Documentation Project or www.linux.org for more information, and a guide to what different installations are available. Something like the linux install that is put together by the people at RedHat would be more appropriate for people starting out with typical systems.

Note2: The boot images are approximately 800kB, and the root images are apporximately 360kB. The 1.2MB ones have all the same files as the 1.44MB ones. To use the above images, save them to a file, gunzip them, and then write them to the raw floppy device. Boot the boot disk and follow the instructions from there. Note that the images are really `gzip' files - I just gave them a `.zip' extension because NetScape thinks `.gz' files are to be displayed as text. :-( Gzip won't care what the extension is. You should also want to check the list of known problems that have been reported for this two disk set.

Once you have installed the above 2 disk system, I recommend that you grab the packages that you want from something like the Bogus distribution on SunSite. (NB: Apparently it has been erased from the SunSITE in the US, but it is still on other mirrors, including the above one in Australia.) It is all a.out and will be compatible with your new 1.0.9 kernel. Don't let the name fool you -- it is anything but a `bogus' distribution.

The two kernels installed from the above 2 disk set have math emulation enabled. If you have a co-processor, you may want to install a Linux-Lite kernel without math-emu support, to save a bit more space. Also make sure you install the matching `/etc/psdatabase' if you change kernels, so that programs like `free' and `ps' work right. It is included in the following tar files with the respective kernel.

Linux-Lite, HDD, ext2, floppy, no math-emu
Linux-Lite, HDD, ext2, no math-emu

Once again these are really ``tar.gz'' files. I just called them ``tar.zip'' files to keep NetScape from trying to display them as text on the screen.

A few people e-mail me asking if I will build a kernel with this driver or that option. Sorry, but I am not a kernel factory. However, I have put one additional pre-built kernel here that you may want to try out. (It may not work on anything less than 2MB machines). This kernel has ext2, HDD, floppy, proc, NFS, TCP/IP, math-emu, serial and wd80x3 support built in. This kernel is an uncompressed boot image, so you physically have to gunzip it before trying to boot it.


The Source

On average, a 1.0.9 kernel is at least 100k smaller than a 1.2.13 kernel, and about 250k smaller than a current 1.3.x kernel, for similar config opitons. Here is a patch against the 1.0.9 tree that makes it even lighter. (This gzipped patch last updated 11/02/96, sum 109.diff.zip = 08210 ) It does the following:

RAM disk as config option
Serial Driver as config option *NEW*
Floppy as config option
Recover Floppy DMA track buffer *NEW*
Modules as config option
NEx000 trim as described on the Memory Saver Page
wd80x3 trim as described on the Memory Saver Page
Serial trim as described on the Memory Saver Page
`printk()' trim as described on the Memory Saver Page
init() trim as described on the Memory Saver Page
Reduce # of consoles from 8 to 4
undefine `DEBUG_PROC_TREE'
Support uncompressed images *NEW*
Support adding swap immediately after mounting root fs *NEW*

Note that some of the tips described on the Memory Savers page for the 1.2 and 1.3 series kernels (such as the Thinkpad hack or the reduced hd driver) don't apply to the 1.0.9 kernels, as they weren't in there yet to begin with, so there is nothing to `fix' so to speak.

Uncompressed images reduce the amount of memory required to boot. They were abandoned at 0.99pl12 because people were making kernels bigger than 512kB. They work good for small kernels as then you don't end up getting stuck at the point where you find you don't have any free memory to uncompress the compressed kernel into. Instead you just load it and start running it. You need this to boot in less than 1MB RAM. You then can optionally type `make Image' instead of `make zImage'. Old timers will recall this format from pre 0.99pl12 days.

With less than 1MB of RAM you will get stuck before the large SysV init gets a chance to do a swapon according to your `/etc/rc' files. I added the ``swap='' boot option so that the kernel enables swapping directly after mounting the root fs, and then init can eat all the memory it wants (at the expense of time of course). I also used the `simpleinit' package on the above boot/root disks, as it is about 1/4 the size of SysV init.

The `DEBUG_PROC_TREE' is an old leftover from many moons ago. It is already gone from the 1.2.x series. Here is what Ted Ts'o said about it back in October '94:
``I can point at a very simple way to speed up the process creation test scores --- in kernel/exit.c, remove the #define for DEBUG_PROC_TREE. The audit_ptree() routine was something I put in to make sure everything was sane, back when I implemented job control back in the days of 0.12 or so. I never intended for it to be used in production, only during testing. However, Linus never turned off the define, so we've been doing a lot of unnecessary testing each time a process is created or destroyed.''
(Thanks to Louis J. LaBash Jr for digging this one out of the archives.)

Some pointers with respect to 1.0.9 kernels:

(1) The source has to be in `/usr/src/linux' -- but you can fudge it with a symlink. Also see point (5) below.

(2) You can also dump the `proc' filesystem if you get an old copy of `kmem-ps-0.99.14.tar.gz' which is still available on tsx-11.mit.edu in the `sources/sbin' directory. You will need the v1.0.9 include files in `/usr/src/linux/include' to be able to build it. If you are using the uncompressed images, you have to point the `ps -U' at the `tools/system' file (as opposed to `tools/zSystem') to get an updated `/etc/psdatabase'.

(3) The ioctl() calls for the console mouse `selection' (now called `gpm' I think...) program have changed. But you can still find a copy of `selection-1.5.tar.z' on tsx-11.mit.edu in the `sources/sbin' directory.

(4) The format of `/proc/net/arp' used to be plain binary, instead of the ascii text format it is today. This means that newer arp programs won't display anything with `arp -a'. However the underlying socket() and ioctl() calls are the same, so commands like ``arp -s fubar.com 01:23:45:67:89:ab'' will still work. Of course you can still do ``cat /proc/net/arp | hexdump'' to have a peek at the binary arp tables with these kernels.

(5) Newer gcc and binutils packages (i.e. ld and friends) may fail to build the kernel together, complaining about invalid file formats and whatnot. You can get workable a.out versions of gcc-2.5.8, gas, and binutils from the ``Bogus'' distribution in this directory. If you would rather not install these alongside of your ``normal'' gcc and ld, then I suggest making a dir in /tmp, and installing these, plus download and install the a.out make, libc, and bash there. (You may have also add a few other things to that list, like mkdir, ln, rm, etc. etc.) Then chroot() to that environment and build from there. This way you don't have to mess with using ``gcc -V 2.5.8'' and other uglies, as it is all self contained.

(5a) As an alternative to the above, you may wish to try to use your present gcc and such. Charlie Brady has been working on patching v1.09 up so that it can be built with a recent gcc and related tools. If you try his patch he would appreciate it if you gave him some feedback. Charlie says that it comes with ``no promises and I know that some drivers won't link.'' so be warned.

(6) Use the assembly version of /sbin/update as described on the Memory Savers page. You don't have to, but you might as well.



This is a mirror of http://rsphy1.anu.edu.au/~gpg109/linux-lite.html