From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 22 17:14:56 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 468273C5 for ; Tue, 22 Jan 2013 17:14:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id BB39F6A0 for ; Tue, 22 Jan 2013 17:14:55 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 242EEB95B; Tue, 22 Jan 2013 12:14:55 -0500 (EST) From: John Baldwin To: freebsd-hackers@freebsd.org Subject: Re: solved: pmbr: Boot loader too large Date: Tue, 22 Jan 2013 12:06:58 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201301221206.58460.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 22 Jan 2013 12:14:55 -0500 (EST) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2013 17:14:56 -0000 On Tuesday, January 22, 2013 6:42:22 am Daniel Braniss wrote: > > hi, > > this is the output from gpart show: > > => 34 976773101 ada0 GPT (465G) > > 34 2048 1 freebsd-boot (1.0M) > > 2082 4194304 2 freebsd-ufs [bootme] (2.0G) > > 4196386 12582912 3 freebsd-swap (6.0G) > > 16779298 959993837 4 freebsd-zfs (457G) > > > > => 34 976773101 ada1 GPT (465G) > > 34 2048 1 freebsd-boot (1.0M) > > 2082 4194304 2 freebsd-ufs (2.0G) > > 4196386 12582912 3 freebsd-swap (6.0G) > > 16779298 959993837 4 freebsd-zfs (457G) > > > > I also did: > > gpart bootcode -b /boot/pmbr ada0 > > > > I'm trying to boot and get > > Boot loader too large > > > > not matter if I boot from disk or pxe. > > The pmbr is 512 bytes, so what causes it to overshoot? > > I don't know x86 assembler (nor want to :-), but the comment says: > > 545k should be enough > > so what's going on? > > never underestimate the human stupidity (mine in this case) nor of the boot. > pmbr will load the whole partition, which was 1M, instead of the size of > gptboot :-( > > reducing the size of the slice/partition fixed the issue. pmbr doesn't have room to be but so smart. It can't parse a filesystem, so it just loads a raw partition assuming that the partition is the boot loader. The 545k bit has to do with where it is loaded. The boot loader has to live in the lower 640k, but it starts at 0x7c00 (the address that the BIOS always loads boot loaders). The 545k limit comes from 640k - 0x7c00. This is a fundamental limit of the x86 BIOS architecture. Compared to the 15.5k that UFS leaves for boot2 it is worlds of space. -- John Baldwin