From owner-freebsd-current@FreeBSD.ORG Mon Feb 4 12:37:47 2008 Return-Path: Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B769F16A418 for ; Mon, 4 Feb 2008 12:37:47 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (unknown [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id 28AA713C447 for ; Mon, 4 Feb 2008 12:37:46 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.1/8.14.1) with ESMTP id m14Cbj1o070448; Mon, 4 Feb 2008 13:37:45 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.1/8.14.1/Submit) id m14CbiaU070447; Mon, 4 Feb 2008 13:37:44 +0100 (CET) (envelope-from olli) Date: Mon, 4 Feb 2008 13:37:44 +0100 (CET) Message-Id: <200802041237.m14CbiaU070447@lurza.secnetix.de> From: Oliver Fromme To: freebsd-current@FreeBSD.ORG, qpadla@gmail.com In-Reply-To: <200802022023.59037.qpadla@gmail.com> X-Newsgroups: list.freebsd-current User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.2-STABLE-20070808 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Mon, 04 Feb 2008 13:37:45 +0100 (CET) Cc: Subject: Re: Broken loader on 7.0-RC1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-current@FreeBSD.ORG, qpadla@gmail.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2008 12:37:47 -0000 Nikolay Pavlov wrote: > While building 7.0-RC1 i've discovered that the loader file is broken in my > box and i am unable to boot using it. I've already hit this problem 2 > months ago. After playing a bit i've found the way on how to reproduce it > easily: > > ~# cd /usr/src/sys/boot/i386 > /usr/src/sys/boot/i386# make btx libi386 loader I'm afraid I can't reproduce it. I've tried the exact same command, and it built a working loader for me. Are you building on i386 or amd64? They use the same i386 loader, but there are slight differences in the build process. Note that your command does not build ficl nor libstand, both of which are required for the loader. Did you build them before? (However, you should get an error message if one of them is missing.) A simple way to check is to use this command: strings loader | grep /src/ Compare the output for the working and the non-working loader. > [...] > client: fmt=elf size=283b0 text=22038 data=4248 bss=60b8 entry=0 Mine looks like this: client: fmt=elf size=3b3b0 text=342d8 data=5248 bss=60d8 entry=0 Clearly your loader.bin ELF binary (called "client" in BTX terms) is much smaller. Something must be missing. You can also check and compare the link commands (that's the last "cc" command in the make process, only a few lines above the snippet that you posted). Mine looks like this: cc -O2 -fno-strict-aliasing -pipe -DLOADER_NFS_SUPPORT -DBOOT_FORTH -I/usr/src/sys/boot/i386/loader/../../ficl -I/usr/src/sys/boot/i386/loader/../../ficl/i386 -DLOADER_GZIP_SUPPORT -I/usr/src/sys/boot/i386/loader/../../common -I. -Wall -I/usr/src/sys/boot/i386/loader/.. -I/usr/src/sys/boot/i386/loader/../btx/lib -ffreestanding -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -static -Ttext 0x0 -nostdlib -o loader.sym /usr/obj/usr/src/sys/boot/i386/loader/../btx/lib/crt0.o main.o conf.o vers.o boot.o commands.o console.o devopen.o interp.o interp_backslash.o interp_parse.o ls.o misc.o module.o panic.o load_elf32.o load_elf32_obj.o reloc_elf32.o load_elf64.o load_elf64_obj.o reloc_elf64.o bcache.o isapnp.o pnp.o interp_forth.o /usr/obj/usr/src/sys/boot/i386/loader/../../ficl/libficl.a /usr/obj/usr/src/sys/boot/i386/loader/../libi386/libi386.a -lstand If you're on amd64, there should be additional options "-m32 -march=i386 -m elf_i386_fbsd", but other than that it should look exactly the same. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "Clear perl code is better than unclear awk code; but NOTHING comes close to unclear perl code" (taken from comp.lang.awk FAQ)