Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Reduce kernel size.



details:   https://anonhg.NetBSD.org/src/rev/7a9071334643
branches:  trunk
changeset: 764806:7a9071334643
user:      nonaka <nonaka%NetBSD.org@localhost>
date:      Thu May 05 09:07:59 2011 +0000

description:
Reduce kernel size.
Tested on SL-C1000.

Fix PR/44898.

diffstat:

 distrib/zaurus/ramdisk/Makefile          |   4 +-
 distrib/zaurus/ramdisk/list              |   4 +--
 sys/arch/zaurus/conf/GENERIC             |  11 ++++++-
 sys/arch/zaurus/conf/INSTALL             |  43 +++++++++++++++++++++++++++++--
 sys/arch/zaurus/conf/Makefile.zaurus.inc |  13 ++++++++-
 sys/arch/zaurus/stand/zbsdmod/zbsdmod.c  |   6 ++--
 6 files changed, 66 insertions(+), 15 deletions(-)

diffs (169 lines):

diff -r 63b4f30f2e63 -r 7a9071334643 distrib/zaurus/ramdisk/Makefile
--- a/distrib/zaurus/ramdisk/Makefile   Thu May 05 08:46:12 2011 +0000
+++ b/distrib/zaurus/ramdisk/Makefile   Thu May 05 09:07:59 2011 +0000
@@ -1,10 +1,10 @@
-#      $NetBSD: Makefile,v 1.11 2010/02/11 09:06:51 roy Exp $
+#      $NetBSD: Makefile,v 1.12 2011/05/05 09:07:59 nonaka Exp $
 
 .include <bsd.own.mk>
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
 IMAGE=         ramdisk.fs
-IMAGESIZE=     2560k
+IMAGESIZE=     2144k
 MAKEFS_FLAGS=  -f 14
 
 WARNS=         1
diff -r 63b4f30f2e63 -r 7a9071334643 distrib/zaurus/ramdisk/list
--- a/distrib/zaurus/ramdisk/list       Thu May 05 08:46:12 2011 +0000
+++ b/distrib/zaurus/ramdisk/list       Thu May 05 09:07:59 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: list,v 1.14 2011/01/14 10:26:37 tsutsui Exp $
+#      $NetBSD: list,v 1.15 2011/05/05 09:07:59 nonaka Exp $
 
 # usr.bin/less has to be first, otherwise the ramdisk.mk generation fails
 SRCDIRS usr.bin/less bin sbin usr.bin usr.sbin gnu/usr.bin
@@ -31,9 +31,7 @@
 PROG   sbin/init
 PROG   sbin/mknod
 PROG   sbin/mount
-PROG   sbin/mount_cd9660
 PROG   sbin/mount_ffs
-PROG   sbin/mount_filecore
 PROG   sbin/mount_kernfs
 PROG   sbin/mount_msdos
 PROG   sbin/mount_nfs
diff -r 63b4f30f2e63 -r 7a9071334643 sys/arch/zaurus/conf/GENERIC
--- a/sys/arch/zaurus/conf/GENERIC      Thu May 05 08:46:12 2011 +0000
+++ b/sys/arch/zaurus/conf/GENERIC      Thu May 05 09:07:59 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: GENERIC,v 1.34 2011/03/06 17:08:33 bouyer Exp $
+#      $NetBSD: GENERIC,v 1.35 2011/05/05 09:07:59 nonaka Exp $
 #
 # GENERIC machine description file
 #
@@ -50,7 +50,7 @@
 # File systems
 file-system    FFS             # UFS
 #file-system   EXT2FS          # second extended file system (linux)
-file-system    LFS             # log-structured file system
+#file-system   LFS             # log-structured file system
 file-system    MFS             # memory file system
 file-system    NFS             # Network File System client
 #file-system   NTFS            # Windows/NT file system (experimental)
@@ -103,6 +103,13 @@
 options        COMPAT_OSSAUDIO # OSS (Voxware) audio driver compatibility
 options        COMPAT_BSDPTY   # /dev/[pt]ty?? ptys.
 
+# Wedge support
+options        DKWEDGE_AUTODISCOVER    # Automatically add dk(4) instances
+#options       DKWEDGE_METHOD_GPT      # Supports GPT partitions as wedges
+# The following two options can break /etc/fstab, so handle with care
+#options       DKWEDGE_METHOD_BSDLABEL # Support disklabel entries as wedges
+#options       DKWEDGE_METHOD_MBR      # Support MBR partitions as wedges
+
 # Shared memory options
 
 options        SYSVMSG         # System V-like message queues
diff -r 63b4f30f2e63 -r 7a9071334643 sys/arch/zaurus/conf/INSTALL
--- a/sys/arch/zaurus/conf/INSTALL      Thu May 05 08:46:12 2011 +0000
+++ b/sys/arch/zaurus/conf/INSTALL      Thu May 05 09:07:59 2011 +0000
@@ -1,15 +1,50 @@
-# $NetBSD: INSTALL,v 1.6 2009/12/21 11:20:07 nonaka Exp $
+# $NetBSD: INSTALL,v 1.7 2011/05/05 09:07:59 nonaka Exp $
 #
 # INSTALL config file (GENERIC with memory disk root)
 #
 
 include        "arch/zaurus/conf/GENERIC"
 
-#no options    KLOADER
-
 # Enable the hooks used for initializing the root memory-disk.
 options        MEMORY_DISK_HOOKS
 options        MEMORY_DISK_IS_ROOT     # force root on memory disk
 options        MEMORY_DISK_SERVER=0    # no userspace memory disk support
-options        MEMORY_DISK_ROOT_SIZE=5120      # size of memory disk, in blocks
+options        MEMORY_DISK_ROOT_SIZE=4288      # size of memory disk, in blocks
 options        MEMORY_DISK_RBFLAGS=RB_SINGLE   # boot in single-user mode
+
+# for reduce kernel size.
+# kernei size must be less than 5MB.
+# - see src/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c:bsdimage[]
+
+makeoptions            COPTS="-Os"
+
+no options             INSECURE
+
+no file-system         NULLFS
+no file-system         PROCFS
+no file-system         PTYFS
+no file-system         TMPFS
+
+no options             COMPAT_OSSAUDIO
+
+no options             SYSVMSG
+no options             SYSVSEM
+no options             SYSVSHM
+no options             P1003_1B_SEMAPHORE
+
+options                PIPE_SOCKETPAIR
+
+no options             WSDISPLAY_COMPAT_PCVT
+no options             WSDISPLAY_COMPAT_USL
+no options             WSDISPLAY_COMPAT_RAWKBD
+
+no options             DIAGNOSTIC
+no options             DDB
+no options             DDB_HISTORY_SIZE
+no options             SYMTAB_SPACE
+
+no pseudo-device       vnd
+no options             VND_COMPRESSION
+no pseudo-device       accf_data
+no pseudo-device       accf_http
+no pseudo-device       ksyms
diff -r 63b4f30f2e63 -r 7a9071334643 sys/arch/zaurus/conf/Makefile.zaurus.inc
--- a/sys/arch/zaurus/conf/Makefile.zaurus.inc  Thu May 05 08:46:12 2011 +0000
+++ b/sys/arch/zaurus/conf/Makefile.zaurus.inc  Thu May 05 09:07:59 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.zaurus.inc,v 1.2 2006/12/17 16:07:11 peter Exp $
+#      $NetBSD: Makefile.zaurus.inc,v 1.3 2011/05/05 09:07:59 nonaka Exp $
 
 MACHINE_ARCH=          arm
 CPPFLAGS+=             -D${MACHINE}
@@ -9,3 +9,14 @@
 LINKFLAGS=             -T ${THISARM}/conf/ldscript
 
 EXTRA_CLEAN+= netbsd.map assym.d
+
+SYSTEM_LD_TAIL_EXTRA+=; \
+       echo "Checking kernel size..."; \
+       size=`wc -c "$@" | ${TOOL_AWK} '{ print $$1 }'`; \
+       maxsize=5242880; \
+       if [ $$size -gt $$maxsize ]; \
+       then \
+               echo "Fatal: kernel size must be less than 5MB."; \
+               echo "Fatal: kernel size: $$size, max kernel size: $$maxsize"; \
+               false; \
+       fi
diff -r 63b4f30f2e63 -r 7a9071334643 sys/arch/zaurus/stand/zbsdmod/zbsdmod.c
--- a/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c   Thu May 05 08:46:12 2011 +0000
+++ b/sys/arch/zaurus/stand/zbsdmod/zbsdmod.c   Thu May 05 09:07:59 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zbsdmod.c,v 1.5 2010/12/26 09:03:56 nonaka Exp $       */
+/*     $NetBSD: zbsdmod.c,v 1.6 2011/05/05 09:07:59 nonaka Exp $       */
 /*     $OpenBSD: zbsdmod.c,v 1.7 2005/05/02 02:45:29 uwe Exp $ */
 
 /*
@@ -74,8 +74,8 @@
 static Elf_Off off;
 static int havesyms;
 
-/* The maximum size of a kernel image is restricted to 10MB. */
-static u_int bsdimage[10485760/sizeof(u_int)]; /* XXX use kmalloc() */
+/* The maximum size of a kernel image is restricted to 5MB. */
+static u_int bsdimage[5242880/sizeof(u_int)];  /* XXX use kmalloc() */
 static char bootargs[BOOTARGS_BUFSIZ];
 
 /*



Home | Main Index | Thread Index | Old Index