One of the things I've done in my current (almost finished) gig is creating a linux distro for a small device. Require: the entire distro needs to be installed from a floppy disk.
So I had about 42kb of free space on my 1680kb floppy disk when I got this feature request yesterday. Whether I could fit in a 'real' ps, instead of busybox's ps. Right. A real ps, with just 42 kb to spare.
In order to save space, all binaries (except for the kernel) on the distro have been compiled using uClibc, which is very nice gcc front end to produce really small, statically linked, binaries. As part of the make process of the distribution, any tool that isn't found on our (quite bare) RedHat servers is compiled as well. Including uClibc.
So, I set off to compile ps with uClibc. No go. It needs a compiler configured for wide chars. I configure uClibc so it can deal with wide chars. ps compiles, and seems to work! Now, will it all fit on the floppy disk? I no longer need ps in busybox, so I kick out the module and attempt to create a floppy disk. It's too big! Not a lot - I can fit the compressed initrd on the floppy disk, but not two additional, small files.
I notice that the other binaries are slightly larger than they used to be. Must be because they now have wide char support compiled in. Aha! What if I create two compilers - one with wide char support to compile 'ps', and the other without wide char support for the rest? A bit of Makefile hacking, and I end with a floppy disk with 1 or 2 kb to spare (the amount of kb to spare fluctuates from build to build - there's a compressed file system on the floppy and filesystems contain timestamps. And if they are just right, they compress better...).
That's going to be last feature added.
Re:just getting started
Abigail on 2006-01-06T17:22:22
The hardware already exists - it has been rolled out since 1996. Although some pieces of equipment have more, I have to consider many have no more than 16Mb of RAM, and 25Mb of disk space - of which the application that runs on it needs 16 Mb. And there has to be space to save core files.Luckely, I wil be gone when the most of them will get my distro. Their floppy disks haven't been used since they were first installed.