o  
d

Custom Kernel Sizes in OpenBSD 3.3 i386
by francisco roque

  1. Table of Contents

    1. Table of Contents
    2. Introduction
    3. Steps
    4. Results
    5. Problems & Inaccuracies
    6. Conclusion
    7. References
    8. Author, Copyright, License

     

  2. 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.

     

  3. 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).
     

  4. Results

    options graph
    larger version

    pseudo-device graph
    larger version

    cpu options graph
    larger version

    Table of all the size differences:
    GENERIC kernel45796910
     
    I - Option DisabledKernel Size
    (bytes)
    Difference from
    GENERIC (bytes)
    option KMEMSTATS45796910
    option COMPAT_2545796910
    option COMPAT_4345796910
    option APERTURE457966427
    option USER_PCICONF457962665
    option PPP_DEFLATE45755394152
    option COMPAT_BSDOS45754784213
    option LKM45753664325
    option PTRACE45752704421
    option KTRACE45752684423
    option QUOTA45751714520
    option UVM_SWAP_ENCRYPT45750214670
    option PPP_BSDCOMP45714698222
    option PORTAL45709108781
    option MFS45708988793
    option EISAVERBOSE456740312288
    option KERNFS456639313298
    option BOOT_CONFIG456623513456
    option COMPAT_FREEBSD456549114200
    option PROCFS456208417607
    option CD9660455719922492
    option COMPAT_IBCS2455222927462
    option USBVERBOSE455099228699
    option EXT2FS454084038851
    option MSDOSFS454026739424
    option FFS_SOFTUPDATES453977539916
    option COMPAT_SVR4453523744454
    option PCIVERBOSE453463545056
    option COMPAT_LINUX452685752834
    option DDB452207357618
    option DIAGNOSTIC450562674065
    option NFSSERVER448831891373
    option NFSSERVER and NFSCLIENT4360598219093
     
    II - Pseudo-device DisabledKernel Size
    (bytes)
    Difference from
    GENERIC (bytes)
    pseudo-device sppp 145796910
    pseudo-device pctr 14579504187
    pseudo-device bio 14579454237
    pseudo-device sl 245753864305
    pseudo-device tun 245753314360
    pseudo-device gre 145752604431
    pseudo-device vlan 245752444447
    pseudo-device vnd 445750914600
    pseudo-device mtrr 145748774814
    pseudo-device tb 145713378354
    pseudo-device ccd 445709748717
    pseudo-device sequencer 145705109181
    pseudo-device systrace 145701519540
    pseudo-device bridge 2455246627225
     
    III - Option Enabled
    (other I*86_CPU disabled)
    Kernel Size
    (bytes)
    Difference from
    GENERIC (bytes)
    option I386_CPU4579411280
    option I486_CPU4939916-360225
    option I586_CPU4940058-360367
    option I686_CPU4940063-360372
     
    IV - Option/pseudo-device DisabledKernel Size
    (bytes)
    Difference from
    GENERIC (bytes)
    option IPSEC, pseudo-device enc450178177910
    option INET6,PULLDOWN_TEST,
    pseudo-device gif
    4420980158711
    option PPP_BSDCOMP,PPP_DEFLATE,
    pseudo-device ppp
    454623233459
    disabling everything in I, II and
    the above
    35164201063271
     
    V - Option/pseudo-device EnabledKernel Size
    (bytes)
    Difference from
    GENERIC (bytes)
    pseudo-device raid 44985182-405491
    option DUMMY_NOPS45796910
    option SMALL_KERNEL4452446127245

     

  5. 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.

     

  6. Conclusion

    I like pretty graphs!

     

  7. 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

     

  8. 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.  

     

 
[ WiFi ] [ Quotes ] [ Store ] [ Propaganda ] [ Other Index ]
[ Art ] [ Code ] [ Personal ] [ Other ] [ Main Index ]
 
r   f