[1615] in linux-announce channel archive

home help back first fref pref prev next nref lref last post

Smallest kernel: Runs in only 1MB RAM !!

daemon@ATHENA.MIT.EDU (Lars Wirzenius)
Fri Jan 26 21:43:12 1996

Date: 	Thu, 25 Jan 1996 22:54:04 +0200
From: Lars Wirzenius <wirzeniu@cc.helsinki.fi>
To: linux-announce@vger.rutgers.edu

From: gpg109@anu.edu.au (Paul Gortmaker)
Subject: Smallest kernel: Runs in only 1MB RAM !!
Organization: Australian National University
Summary: You can actually run a specially built kernel on a 1MB RAM machine.
Keywords: tiny kernel memory savers
Approved: linux-announce@news.ornl.gov (Lars Wirzenius)
Newsgroups: comp.os.linux.announce
Followup-to: comp.os.linux.development.system

-----BEGIN PGP SIGNED MESSAGE-----


Actually, this is probably two things not seen before, that being
the smallest v1.x linux kernel, and linux running on a 1MB RAM machine.

Yes, a new first (???) Linux running on a 1MB RAM machine. By 1MB RAM, you
must actually have 1MB available, i.e. the 640kB -> 1MB area must be
remapped to 1024kB -> 1408kB. Most non dain-bramaged chipsets will
remap that 384kB to above 1MB once all ROM shadowing is turned off. Here
is the proof that it can be done, and proof of a *small* kernel:

- -------------------------------------------------------
Console: colour EGA+ 80x25, 4 virtual consoles
Calibrating delay loop.. ok - 19.97 BogoMips
Memory: 700k/1408k available (224k kernel code, 384k reserved, 100k data)
This processor honours the WP bit even when in supervisor mode. Good.
Checking 386/387 coupling... Ok, fpu using exception 16 error reporting.
Linux version 1.0.9 (paul@foobar) #1 Sat Jan 20 18:15:13 EST 1996
Partition check:
  hda: hda1 hda2 hda3
VFS: Mounted root (ext2 filesystem).
- -------------------------------------------------------

- -*- Okay, so how did you do it? My kernel is 3x that size. -*-

This is not an original v1.0.9 kernel, but rather one I have set up to
exclude things like modules, ramdisk, floppy, serial driver, etc.
The above configuration had support for generic hard disks, and for
the ext2fs only. Note that 224kB code + 100kB data is probably the
smallest v1.x kernel ever seen. (without resorting to ugly hacks like
replacing all the printk() with a null function.) All my changes are
"reasonable and clean" for lack of a better phrase. Using minix fs
instead of ext2 might even be smaller yet...

- -*- I'm interested. How did it start, and where can I get your changes? -*-

This all started when I was trying to cut down the size of the kernel
for some of our 4MB linux boxes at work. After discovering a reasonable
number of ways to reduce the kernel size, I figured that others might
be interested as well, so I put my collection up as a WWW page. The URL is

	http://rsphy1.anu.edu.au/~gpg109/mem.html  

I didn't really promote it or anything, but in the last few months,
over 600 people have had a look at it. The internet has no secrets...
Be gentle to rsphy1 -- it is a crummy old Ultrix box.

- -*- Neat. But I need to run v1.2.13 to support <insert_device_here> -*-

Not to worry. Most of these patches/tips started out as v1.2.13
versions, which are available at the site above. It was only when I
decided to try and make the world's smallest (???) v1.x Linux kernel that
I then made v1.0.9 versions. There are also 1.3.x versions available
for some/most of the patches.

- -*- Linux in 1MB is useless, right? It must swap continuously. -*-

You might think that it would be useless since it must swap endlessly,
but in fact you can actually even play a game of "sasteroids" without
it swapping and disrupting your game on a 1MB box. Trying to
run larger apps like ghostscript or nroff would be slow of course.

- -*- So what, who cares, why bother? -*-

The hack value and the challenge are reason enough. Besides, there
are still lots of people interested in smaller kernels for older and
slower machines with low amounts of memory. The Linux-8086 port may
also be able to make use of these types of changes. Some of these options
that I have implemented (such as CONFIG_BLK_DEV_RAM and CONFIG_MODULES)
have already made their way into the current 1.3.x kernel, giving the
user more freedom of choice when building their own personalized kernel.

- -*- Isn't v1.0.9 obsolete? -*-

No, not really. It is still years newer than DOS v5.0 for example.
It also supports 99% of the features that the average user needs.
It is also a stable release, like the current v1.2.13 release.
People have got the idea that with Linux, the latest is greatest, but
if you are running on a low memory machine, then that just isn't true.
You can drop a v1.0.9 kernel into nearly any "a.out" distribution with
minimal fuss. Only a few things like "selection" (aka "gpm") for
which the ioctl() calls have changed need to be "downgraded".
I have documented (I do too much of that already) most of these
incompatibilities on the following URL, along with tips on
compiling a v1.0.9 kernel.

	-----------------------------------------------
	Linux Memory Savers

	http://rsphy1.anu.edu.au/~gpg109/mem.html
	-----------------------------------------------

Hope somebody finds this stuff useful, or at least moderately amusing.
Paul.
- --
Proud supporter of the
campaign to bring back:		printk("lp%d on fire\n", minor);
Join us! Add 2 your sig.


-----BEGIN PGP SIGNATURE-----
Version: 2.6.2i

iQCVAwUBMQfkaoQRll5MupLRAQE5XwQAh9rNXcjl7OomYE0o1zdbob5SbaPmm4Q0
kolgeqr0C4DpFc2DDmVwQnZRva+7MK58MSVtWK6Khtk1K8jTG4mGHsUztnjvvLSa
QPKbgpncif13LwPaingQm1Q4KOnF+UF2diQnzX/rl+IUqu8qDGh1nXlt0uHB78e4
iu+Y/jyDIlM=
=dqcP
-----END PGP SIGNATURE-----

-- 
This article has been digitally signed by the moderator, using PGP.
Finger wirzeniu@kruuna.helsinki.fi for PGP key needed for validating signature.
Send submissions for comp.os.linux.announce to: linux-announce@news.ornl.gov
PLEASE remember a short description of the software and the LOCATION.



home help back first fref pref prev next nref lref last post