On Sun, Jan 09, 2000 at 12:27:38PM -0600, Erik Andersen wrote:
> On Sun Jan 09, 2000 at 05:34:53PM +0000, Alan Cox wrote:
> > > you can just append a very small initrd to the kernel which does
> > > dhcp (or bootp) and then loads the real rootfs ramdisk via tftp into
> > > ram1 - entirely in userspace. Yes, someone needs to do this very small
> > > neat first-stage initrd, but it seems at least possible to me.
> >
> > A standalone well hand tuned tftp client occupies about 8K
>
> Don't forget that when run as an initrd, it would have to be staticly
> linked against libc and friends (making it at weigh in at about 300k),
> or it has to be assembler -- very small but throwing out cross-platform
> portability, and making it subject to kernel interface changes.
There is something seriously wrong with libc that causes this bloat. The
following program compiles to 202640 bytes on my system:
int main() { }
Compiled with:
gcc -static -s -O testy.c -o testy
Even if you don't want them, you end up linking in malloc, stdio, and other
large chunks of useless stuff because the init/shutdown code (crt*.o) needs
to initialize these subsystems. Some clever changes to libc would
dramatically improve this situation, but it would take some work. Someday,
perhaps I'll have a chance...
For a solution that might be slightly less work, you could look at Cygnus
newlib (sourceware.cygnus.com) but it will need some tweaking to work with a
Linux target, I think.
Have fun,
Avery
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:14 EST