From owner-freebsd-hackers@FreeBSD.ORG Thu May 10 11:45:46 2012 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 874E3106566B for ; Thu, 10 May 2012 11:45:46 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 382988FC08 for ; Thu, 10 May 2012 11:45:46 +0000 (UTC) Received: from [192.168.1.157] ([199.119.128.74]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q4ABjZNb075083 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 10 May 2012 04:45:43 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=iso-8859-1 From: Marcel Moolenaar In-Reply-To: <4FA95960.7090908@shadowsun.net> Date: Thu, 10 May 2012 07:45:35 -0400 Content-Transfer-Encoding: 7bit Message-Id: References: <4FA95960.7090908@shadowsun.net> To: Eric McCorkle X-Mailer: Apple Mail (2.1278) Cc: freebsd-hackers@freebsd.org Subject: Re: GSoC Project: EFI on amd64/i386 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: Thu, 10 May 2012 11:45:46 -0000 On May 8, 2012, at 1:35 PM, Eric McCorkle wrote: > Here are some specific points to be decided: > > * An EFI boot service could potentially function similarly to > [zfs]loader. Alternatively, it could function like gpt[zfs]boot, > though this might require modifying loader(8) since EFI boot services > run in protected/long mode, and have different system information > table formats. Your terminology is a bit confusing. EFI provides boot services and runtime services. These services allow EFI applications (e.g. loaders) to do stuff, like output to a console or read/write file systems, etc. The runtime services are not available to a kernel. Only the boot services can be used by a kernel. Now, as for the FreeBSD boot loader: it's currently an EFI program/image that can be run from within EFI and that uses the boot- and runtime services to load the FreeBSD kernel from a file system it knows about in some GPT partition. The loader is stored in the EFI system partition so that it can be found and run. > * How much of what EFI provides do we want to use? There are > advantages and disadvantages both ways. I don't understand the question. Can you elaborate? > * How much of the kernel needs to be changed to boot/run from an EFI boot? The hand-off will be different. In particular, a proper loader will not load the kernel at some hardcoded address. Instead it will use EFI's memory allocation routines to get available memory chunks and load a kernel there. Since the kernel may not occupy a single contiguous range in physical memory this way, you want the loader to set up page tables as well. Put differently: the current state of affairs is that the EFI loader we have loads a kernel, but can't boot it. > * It seems possible to support booting from legacy BIOS as well as EFI > (install a protective MBR, and gpt[zfs]boot on a FreeBSD boot > partition, install the EFI boot loader in a way that the EFI firmware > will find it and load it, and the system itself on another partition). > Is it worth trying to do this? You need to support both anyways. But not at the same time. The machine either boots BIOS or EFI and depending on that will it use the EFI loader or use the MBR to load boot code. There's nothing to try. Key is to have a single kernel loadable and bootable by either the EFI loader or using the "legacy" loader. -- Marcel Moolenaar marcel@xcllnt.net