Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Abigail (26)

Abigail
  (email not shown publicly)

Journal of Abigail (26)

Friday January 06, 2006
10:27 AM

1kb to spare.

[ #28265 ]
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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I'm just getting started with this as well but being lazy and impatient took a shortcut and grabbed one of the Gumstix [gumstix.com] devices. (It probably has more space than your device as it's got busybox + a number of bluetooth utils, boa web server and a few other goodies.) Even a complete newbie like me got it up and running, which was nice, and their buildroot setup seems pretty straightforward, but I haven't tried it out yet.
    • 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.