 |
Custom Kernel Sizes in OpenBSD 3.3 i386
by francisco roque
-
Table of Contents
- Table of Contents
- Introduction
- Steps
- Results
- Problems & Inaccuracies
- Conclusion
- References
- Author, Copyright, License
-
Introduction
While compiling a custom kernel for a low-mem machine, i became curious as to how much kernel space certain options/pseudo-devices took up in GENERIC. A couple scripts and a lot of compile time later and i have some nice data.
-
Steps
The following steps were performed to generate the kernels:
- For each kernel, OpenBSD 3.3-release source was used.
- For each kernel compiled, one option or pseudo-device was commented out from a GENERIC config file, and then a kernel was compiled from this config file. There are some exceptions to this listed below.
- NFSSERVER needs NFSCLIENT, so for these options two kernels were compiled: one without NFSSERVER and one without both NFSSERVER and NFSCLIENT.
- As only one of I386_CPU, I486_CPU, I586_CPU and I686_CPU is needed, 4 kernels were compiled for these options where one option was left alone and the other 3 were commented out.
- Certain options/pseudo-devices need to be commented out together. These are: for IPv6 options INET6 PULLDOWN_TEST and pseudo-device gif, for ppp pseudo-device ppp and options PPP_BSDCOMP PPP_DEFLATE, for ipsec option IPSEC and pseudo-device enc (i don't know if these are functionally correct, i just guessed and compiled).
-
Results

larger version

larger version

larger version
Table of all the size differences:
| GENERIC kernel | 4579691 | 0 |
| |
| I - Option Disabled | Kernel Size (bytes) | Difference from GENERIC (bytes) |
| option KMEMSTATS | 4579691 | 0 |
| option COMPAT_25 | 4579691 | 0 |
| option COMPAT_43 | 4579691 | 0 |
| option APERTURE | 4579664 | 27 |
| option USER_PCICONF | 4579626 | 65 |
| option PPP_DEFLATE | 4575539 | 4152 |
| option COMPAT_BSDOS | 4575478 | 4213 |
| option LKM | 4575366 | 4325 |
| option PTRACE | 4575270 | 4421 |
| option KTRACE | 4575268 | 4423 |
| option QUOTA | 4575171 | 4520 |
| option UVM_SWAP_ENCRYPT | 4575021 | 4670 |
| option PPP_BSDCOMP | 4571469 | 8222 |
| option PORTAL | 4570910 | 8781 |
| option MFS | 4570898 | 8793 |
| option EISAVERBOSE | 4567403 | 12288 |
| option KERNFS | 4566393 | 13298 |
| option BOOT_CONFIG | 4566235 | 13456 |
| option COMPAT_FREEBSD | 4565491 | 14200 |
| option PROCFS | 4562084 | 17607 |
| option CD9660 | 4557199 | 22492 |
| option COMPAT_IBCS2 | 4552229 | 27462 |
| option USBVERBOSE | 4550992 | 28699 |
| option EXT2FS | 4540840 | 38851 |
| option MSDOSFS | 4540267 | 39424 |
| option FFS_SOFTUPDATES | 4539775 | 39916 |
| option COMPAT_SVR4 | 4535237 | 44454 |
| option PCIVERBOSE | 4534635 | 45056 |
| option COMPAT_LINUX | 4526857 | 52834 |
| option DDB | 4522073 | 57618 |
| option DIAGNOSTIC | 4505626 | 74065 |
| option NFSSERVER | 4488318 | 91373 |
| option NFSSERVER and NFSCLIENT | 4360598 | 219093 |
| |
| II - Pseudo-device Disabled | Kernel Size (bytes) | Difference from GENERIC (bytes) |
| pseudo-device sppp 1 | 4579691 | 0 |
| pseudo-device pctr 1 | 4579504 | 187 |
| pseudo-device bio 1 | 4579454 | 237 |
| pseudo-device sl 2 | 4575386 | 4305 |
| pseudo-device tun 2 | 4575331 | 4360 |
| pseudo-device gre 1 | 4575260 | 4431 |
| pseudo-device vlan 2 | 4575244 | 4447 |
| pseudo-device vnd 4 | 4575091 | 4600 |
| pseudo-device mtrr 1 | 4574877 | 4814 |
| pseudo-device tb 1 | 4571337 | 8354 |
| pseudo-device ccd 4 | 4570974 | 8717 |
| pseudo-device sequencer 1 | 4570510 | 9181 |
| pseudo-device systrace 1 | 4570151 | 9540 |
| pseudo-device bridge 2 | 4552466 | 27225 |
| |
III - Option Enabled (other I*86_CPU disabled) | Kernel Size (bytes) | Difference from GENERIC (bytes) |
| option I386_CPU | 4579411 | 280 |
| option I486_CPU | 4939916 | -360225 |
| option I586_CPU | 4940058 | -360367 |
| option I686_CPU | 4940063 | -360372 |
| |
| IV - Option/pseudo-device Disabled | Kernel Size (bytes) | Difference from GENERIC (bytes) |
| option IPSEC, pseudo-device enc | 4501781 | 77910 |
option INET6,PULLDOWN_TEST, pseudo-device gif | 4420980 | 158711 |
option PPP_BSDCOMP,PPP_DEFLATE, pseudo-device ppp | 4546232 | 33459 |
disabling everything in I, II and the above | 3516420 | 1063271 |
| |
| V - Option/pseudo-device Enabled | Kernel Size (bytes) | Difference from GENERIC (bytes) |
| pseudo-device raid 4 | 4985182 | -405491 |
| option DUMMY_NOPS | 4579691 | 0 |
| option SMALL_KERNEL | 4452446 | 127245 |
-
Problems & Inaccuracies
- There is no guarantee that any of the resultant kernels are bootable; i only know that the config files used resulted a kernel that could be compiled.
- Non-GENERIC kernels are unsupported.
- Compiling items out takes away functionality.
- This won't map perfectly into the real world as options might react together in different manners to form larger/smaller differences.
-
Conclusion
I like pretty graphs!
-
References
Manpages:
options(4) - list of various kernel options and their function.
Pseudo-devices have their own manpage in section 4.
Other howto's and docs:
Building the System from Source
-
Author, Copyright, License
The author of this document is francisco roque, who can be found at
http://www.blackant.net/
This document is copyright francisco roque 2002.
This document is released under BSD style license and may be used in whole or
part for anything so long as this section remains intact.
The author takes no responsibility for damages incurred by following the
steps in this document, including but not limited to the loss of data or
damage to hardware. Good Luck.
|