From owner-freebsd-current Thu Feb 5 01:38:27 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id BAA19977 for current-outgoing; Thu, 5 Feb 1998 01:38:27 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from korin.warman.org.pl (korin.nask.waw.pl [148.81.160.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id BAA19966; Thu, 5 Feb 1998 01:38:16 -0800 (PST) (envelope-from abial@korin.warman.org.pl) Received: from localhost (abial@localhost) by korin.warman.org.pl (8.8.8/8.8.5) with SMTP id KAA27228; Thu, 5 Feb 1998 10:40:22 +0100 (CET) Date: Thu, 5 Feb 1998 10:40:21 +0100 (CET) From: Andrzej Bialecki To: Terry Lambert cc: freebsd-current@FreeBSD.ORG, jkh@FreeBSD.ORG Subject: Re: Custom init(8) (and some ideas) In-Reply-To: <199802050841.BAA13172@usr08.primenet.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG X-To-Unsubscribe: mail to majordomo@FreeBSD.org "unsubscribe current" Hi! Thanks for your replies - now I'm more aware of do's and dont's. Besides, now I know where the sources for init(8) are... :-)) I must rethink the problem. Perhaps I'll start reaping out chunks of normal init... A bit of background, if you're interested: I'm working on the next version of PicoBSD, and after some shuffling with the layout and adding new features I found that I can no longer fit into 8MB RAM... I.e. it fits, but I can't start enough processes to make a dialup connection. There was one really nasty surprise which I experienced: the way the gzipped binaries are executed. It wastes a LOT of RAM. And since all of the programs on my floppy are just one crunched binary (which is gzipped for saving space on the floppy), when it gets executed it initially takes almost thrice as much memory than its file size. And of course it can't be paged out (where to?), which results in crash. I had some ideas how to fix it, but the implementation of this is far beyond my knowledge: to modify imgact_gzip NOT to load the gzipped binary, but just to mmap it, and then unpack it. When I asked John Dyson he said that it would require a lot of work to change it... Pity. Also, IMHO it would be a good option to the kernel and/or ld.so to tell them not to load .text at all (it could apply to .text section of binaries as well as shared libs), just to mmap it, if the backing filesystem is of MFS type. So, I'm still looking for various ways of memory saving, and the way that init uses to (finally) start a user shell is unnecesarily complicated in my case. Because what I want in basic setup is just to start some interactive shells on different ttys. That said, I think I must go and read /usr/src/sbin/init/init.c... :-)) Andrzej Bialecki PS. Terry, thanks for your explanation - IMO, this is parallel to what 'man init' says, but gives, I'd say, "stereoscopic view" of the things... And no, I linked my init statically, but I forgot that it must never exit :-) ---------------------+--------------------------------------------------------- abial@warman.org.pl | if(halt_per_mth > 0) { fetch("http://www.freebsd.org") } Research & Academic | "Be open-minded, but don't let your brains to fall out." Network in Poland | All of the above (and more) is just my personal opinion. ---------------------+---------------------------------------------------------