Subject: Re: execing gzipped files (was Re: Netpliance Iopener booted with NetBSD...)
To: None <thorpej@zembu.com>
From: Simon Burge <simonb@netbsd.org>
List: current-users
Date: 03/24/2000 14:14:31
Jason R Thorpe wrote:

> On Thu, Mar 23, 2000 at 03:34:52PM -0500, der Mouse wrote:
> 
>  > > it probably kills demand paging though.  :)
>  > 
>  > I daresay. :)  And machines so cramped for disk space that they have to
>  > resort to this trick are likely to be the ones shortest on swap. :(
> 
> Depends.  e.g. the boot blocks are able to "seek" to arbitrary byte offsets
> in compressed files, right?  Demand paging could probably still be done.

Although I dare say not too efficently.  Typically boot blocks only need
a seek or two when loading the kernel (there's not that many sections,
even in a ELF file).  From libsa/cread.c:

	case SEEK_SET:
		/* if seek backwards, simply start from the beginning */
		if (offset < s->stream.total_out) {
			...
			res = olseek(fd, 0, SEEK_SET);

'Twould be interesting to profile the time spent in inflate() on such a
kernel :)

This still could have practical applications though...

Simon.