From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 20 21:07:09 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 096E116A417 for ; Sun, 20 Jan 2008 21:07:09 +0000 (UTC) (envelope-from ady@ady.ro) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.179]) by mx1.freebsd.org (Postfix) with ESMTP id EA81713C442 for ; Sun, 20 Jan 2008 21:07:08 +0000 (UTC) (envelope-from ady@ady.ro) Received: by wa-out-1112.google.com with SMTP id k17so3274436waf.3 for ; Sun, 20 Jan 2008 13:07:08 -0800 (PST) Received: by 10.142.77.11 with SMTP id z11mr2908875wfa.98.1200861585564; Sun, 20 Jan 2008 12:39:45 -0800 (PST) Received: by 10.143.167.6 with HTTP; Sun, 20 Jan 2008 12:39:45 -0800 (PST) Message-ID: <78cb3d3f0801201239x18c339a6sbc6a04d2b5670b81@mail.gmail.com> Date: Sun, 20 Jan 2008 22:39:45 +0200 From: "Adrian Penisoara" Sender: ady@ady.ro To: freebsd-hackers@freebsd.org MIME-Version: 1.0 X-Google-Sender-Auth: ee9e7fb9e1f04e4d Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Squeezing out some 70 bytes out of the boot2 loader X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jan 2008 21:07:09 -0000 Hello I am trying to hack in some symlink support into the [sys/boot/i386/]boot2 bootloader (for my project [1]) and I seem to fall short of about 69 bytes: as -o boot2.o boot2.s ld -static -N --gc-sections -nostdlib -Ttext 0x2000 -o boot2.out/build/obj/build/src/sys/boot/i386/boot2/../btx/lib/crt0.o boot2.o sio.o objcopy -S -O binary boot2.out boot2.bin btxld -v -E 0x2000 -f bin -b /build/obj/build/src/sys/boot/i386/boot2/../btx/btx/btx -l boot2.ldr -o boot2.ld -P 1 boot2.bin kernel: ver=1.01 size=7b0 load=9000 entry=9010 map=16M pgctl=1:1 client: fmt=bin size=1581 text=0 data=0 bss=0 entry=0 output: fmt=bin size=1e45 text=114 data=1d31 org=0 entry=0 -69 bytes available *** Error code 1 What can I do to get room for about 70-100 bytes for these changes to make it into the bootloader ? [1] I'm trying to get support for /boot being mounted as a separate FS and as such I would need to have a "self-pointing" symlink (e.g. "boot -> ." ) to easily mask the fact that the boot stuff is now right in the root of that FS. Fortunately the FORTH loader does support symlinks and I do not get problems with it. I know that I can use /boot.kernel as a workaround, but that is not too elegant. Thanks for your time, Adrian Penisoara ady (at) freebsd (dot) ady (dot) ro ROFUG, EnterpriseBSD project