9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] how small can you get
@ 2002-02-09 20:52 Russ Cox
  0 siblings, 0 replies; 14+ messages in thread
From: Russ Cox @ 2002-02-09 20:52 UTC (permalink / raw)
  To: 9fans

If you use the kernel config file below along
with bzip2 compression, I think you can fit everything
inside 160kb.

g% strip < 9tiny | bzip2 -9 | wc -c
 136003
g% strip < /sys/src/cmd/bzip2/8.bunzip2lite | wc -c
  18928
g% 

That leaves 5000 bytes to do load-related stuff
like jumping to the right address.  If you meant
160*1024 bytes, you've got almost 9000 bytes left.
That and bunzip2lite can be made smaller yet.
It is way too long and ugly to post,
but if you're interested mail me.  Basically
I took the bunzip2 code and replaced a bunch
of macros with functions to get the code size
down.  There's still plenty of room for improvement.

Russ



dev
	root
	cons
	arch
	env
	pipe
	proc
	mnt
	srv
	dup
	rtc
	ether	netif
	sd
	ns16552

link
	ether82557	pci

misc
	archmp		mp apic
	sdata		pci sdscsi

port
	int cpuserver = 0;

boot
	local


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: [9fans] how small can you get
@ 2002-02-08 17:14 jmk
  0 siblings, 0 replies; 14+ messages in thread
From: jmk @ 2002-02-08 17:14 UTC (permalink / raw)
  To: 9fans

On Fri Feb  8 11:43:15 EST 2002, rminnich@lanl.gov wrote:
> That tiny kernel from anothy is pretty encouraging.
> 
> OK, unless it makes people REALLY unhappy, we're going to look into a way
> to get plan9 to boot plan9. We're finding that OSes make pretty good
> bootstraps, since they generally are current on hardware bugs and glitches
> that bootstrap loaders lag on. Making an OS boot an OS is not that hard
> anyway.
> 
> Thanks
> 
> ron

Also, that's exactly what we did 10 years ago when we used to build hardware.
The Hobbit board ROM monitor was just a Plan 9 kernel with a slightly different
memory mapping and /boot replaced with interactive code.


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: [9fans] how small can you get
@ 2002-02-08 16:19 anothy
  2002-02-08 16:42 ` Ronald G Minnich
  0 siblings, 1 reply; 14+ messages in thread
From: anothy @ 2002-02-08 16:19 UTC (permalink / raw)
  To: 9fans

256KB is tight, but i bet it's doable, if your bootloader understands
gzip, as 9load does. i just did this:
	:; size 9tiny
	360495t + 153284d + 36356b = 550135	9tiny
	:; strip < 9tiny > 9teeny
	:; ls -l 9tiny 9teeny 9teeny.gz
	--rw-rw-r-- M 4 anothy sys 513811 Feb  8 06:15 9teeny
	--rwxrwxr-x M 4 anothy sys 683136 Feb  8 06:14 9tiny
	--rw-rw-r-- M 4 anothy sys 229755 Feb  8 06:15 9teeny.gz
i just did the tiny config file in a minute; i bet more could be taken
out if some care were applied. i've appended below what i had, for
refference. pretty close to what i think you're asking for.
ア

---/sys/src/cmd/pc/tiny---
dev
	root
	cons
	arch
	env
	pipe
	proc
	mnt
	srv
	dup
	rtc
	ssl

	ether	netif
	ip	arp chandial ip ipaux iproute netlog nullmedium pktmedium ptclbsum386 inferno

	sd
	ns16552


link
	ether82557	pci
	ethermedium

misc
	archmp		mp apic

	ipconfig.root

	sdata		pci sdscsi

ip
	tcp
	udp
	ipifc
	icmp

port
	int cpuserver = 0;

boot boot #S/sdC0/
	local
	tcp



^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: [9fans] how small can you get
@ 2002-02-08  2:53 jmk
  2002-02-08  5:25 ` Lucio De Re
  2002-02-08 15:20 ` Ronald G Minnich
  0 siblings, 2 replies; 14+ messages in thread
From: jmk @ 2002-02-08  2:53 UTC (permalink / raw)
  To: 9fans

On Thu Feb  7 19:23:15 EST 2002, rminnich@lanl.gov wrote:
> just wondering, what's the smallest plan9 kernel seen to date.
> 
> No graphics, just an enet device and an IDE and no network.
> 
> ron

You don't specify when or for which architecture. This is the oldest
x86 kernel I could find in a public place:

o% size /n/bootesdump/1991/1102/386/9safari
162289t + 132096d + 227168b = 521553	/n/bootesdump/1991/1102/386/9safari
o% 

and here are the other kernels from that time:

o% size /n/bootesdump/1991/1102/*/9
125738t + 53604d + 210996b = 390338	/n/bootesdump/1991/1102/68020/9
266448t + 44456d + 516736b = 827640	/n/bootesdump/1991/1102/mips/9
197000t + 45600d + 34536b = 277136	/n/bootesdump/1991/1102/sparc/9
o% 


On Thu Feb  7 20:54:13 EST 2002, schwartz@bio.cse.psu.edu wrote:
> | I just built a stripped down pc kernel --
> | IDE, CGA, no ether, no network, and got 
> | about 361kb.
> 
> I'm surprised it is that big.  Back in the days of 4.2BSD, normal
> kernels were smaller than that.  But maybe the vax had better code
> density than x86.

I don't have easy access to a 4.2BSD kernel, so this will have to do:

o% pwd
/rls/unix/4.3bsd/GENERIC
o% ls -l vmunix
--rwxr-xr-x M 49476 0 10 407552 Jun  6  1986 vmunix
o% xd -s -4d vmunix|sed 2q
0000000  0000000264 0000279844 0000080872 0000100324
0000010  0000025716 2147488504 0000000000 0000000000
o% hoc
279844+80872+100324
461040


^ permalink raw reply	[flat|nested] 14+ messages in thread
[parent not found: <rsc@plan9.bell-labs.com>]
* [9fans] how small can you get
@ 2002-02-08  0:19 Ronald G Minnich
  2002-02-08 10:08 ` Boyd Roberts
  0 siblings, 1 reply; 14+ messages in thread
From: Ronald G Minnich @ 2002-02-08  0:19 UTC (permalink / raw)
  To: 9fans

just wondering, what's the smallest plan9 kernel seen to date.

No graphics, just an enet device and an IDE and no network.

ron



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2002-02-09 20:52 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-09 20:52 [9fans] how small can you get Russ Cox
  -- strict thread matches above, loose matches on Subject: below --
2002-02-08 17:14 jmk
2002-02-08 16:19 anothy
2002-02-08 16:42 ` Ronald G Minnich
2002-02-08 17:04   ` Sean Quinlan
2002-02-08 17:16     ` Ronald G Minnich
2002-02-08  2:53 jmk
2002-02-08  5:25 ` Lucio De Re
2002-02-08 15:20 ` Ronald G Minnich
     [not found] <rsc@plan9.bell-labs.com>
2002-02-08  1:48 ` Russ Cox
2002-02-08  1:52   ` Scott Schwartz
2002-02-08 15:17   ` Ronald G Minnich
2002-02-08  0:19 Ronald G Minnich
2002-02-08 10:08 ` Boyd Roberts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).