Reduce kernel size.

Tested on SL-C1000.

Fix PR/44898.
This commit is contained in:
nonaka 2011-05-05 09:07:59 +00:00
parent 9d698592f1
commit 28846998b3
6 changed files with 66 additions and 15 deletions

View File

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

View File

@ -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/ifconfig
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

View File

@ -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 @@ options RTC_OFFSET=0 # hardware clock is this many mins. west of GMT
# 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_43 # and 4.3BSD
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

View File

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

View File

@ -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 @@ SYSTEM_FIRST_SFILE= ${THISARM}/zaurus/zaurus_start.S
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

View File

@ -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_Shdr *shp;
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];
/*