]> code.delx.au - refind/commitdiff
Clean up of driver support; now requires newer GNU-EFI package.
authorsrs5694 <srs5694@users.sourceforge.net>
Thu, 19 Apr 2012 16:24:37 +0000 (12:24 -0400)
committersrs5694 <srs5694@users.sourceforge.net>
Thu, 19 Apr 2012 16:24:37 +0000 (12:24 -0400)
15 files changed:
Make.common
NEWS.txt
docs/Styles/styles.css
docs/refind/bootmode.html
docs/refind/configfile.html
docs/refind/features.html
docs/refind/getting.html
docs/refind/index.html
docs/refind/installing.html
docs/refind/using.html
refind/Makefile
refind/bootsvcs.h [deleted file]
refind/driver_support.c [moved from refind/bootsvcs.c with 93% similarity]
refind/driver_support.h [new file with mode: 0644]
refind/main.c

index f8eff663c4720d5d24fdc3e20d8eaef7389ddfff..3f6f85faf395dd48624495380acfcbcd0b4c79ff 100644 (file)
@@ -3,10 +3,10 @@
 # Common make rules for building with gnu-efi
 #
 
-EFIINC          = /usr/include/efi
-GNUEFILIB       = /usr/lib
-EFILIB          = /usr/lib
-EFICRT0         = /usr/lib
+EFIINC          = /usr/local/include/efi
+GNUEFILIB       = /usr/local/lib
+EFILIB          = /usr/local/lib
+EFICRT0         = /usr/local/lib
 
 HOSTARCH        = $(shell uname -m | sed s,i[3456789]86,ia32,)
 ARCH            := $(HOSTARCH)
index 6ae3946894da19fc00473c693f84bff9ac8731b6..7c4dfab8a00fb38cdb5e09c678e839b767fbfd45 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,6 +1,17 @@
 0.2.7 (?/??/2012):
 ------------------
 
+- After much trial and tribulation, I've overcome a GNU-EFI limitation and
+  enabled rEFInd to load EFI drivers. This feature was present in the
+  original build of rEFIt but was removed in the versions that could
+  compile under Linux, but now it's back -- and still being compiled under
+  Linux! To use it, you should place your drivers in a convenient directory
+  on the ESP (or whatever partition you use to launch rEFInd) and add a
+  "scan_driver_dirs" entry to refind.conf to tell rEFInd where to look. (As
+  always, you should specify the driver directory relative to the root of
+  the filesystem.) Note that you can't launch drivers from another
+  filesystem; they must be on the same volume that holds rEFInd.
+
 - Fixed bug that caused rEFInd to show up in its own menu sometimes.
 
 - Added new refind.conf token: also_scan_dirs. When scanning volumes for
index 6a2383268d26046ce0322afbff2810f1d17fef0b..5721247a8cd857cf0e5fc60bde9dfcc46ef249bc 100644 (file)
@@ -29,7 +29,7 @@ h1,h2,h3,h4 {
 }
 
 .listing {
-    font-family:Courier,monospace;
+    font-family:monospace;
     margin: 0px;
     padding: 6px;
     border: 1px solid;
index 4d3e5abbff2d85fe1129445bd7777478c4a10bd3..f002cb885546682ebc5dc8420b62939265ee9f22 100644 (file)
-<?xml version="1.0" encoding="utf-8" standalone="no"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
-  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-  <title>The rEFInd Boot Manager: What's Your Boot Mode?</title>
-  <link href="../Styles/styles.css" rel="stylesheet" type="text/css" />
-</head>
-
-<body>
-  <h1>The rEFInd Boot Manager:<br />What's Your Boot Mode?</h1>
-
-  <p class="subhead">by Roderick W. Smith, <a
-href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
-
-<p>Originally written: 3/14/2012; last Web page update: 4/14/2012, referencing rEFInd 0.2.6</p>
-
-
-<p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
-
-<table border="1">
-<tr>
-<td>Donate $1.00</td>
-<td>Donate $2.50</td>
-<td>Donate $5.00</td>
-<td>Donate $10.00</td>
-<td>Donate another value</td>
-</tr>
-<tr>
-<td><form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
-<input type="hidden" name="cmd" value="_xclick">
-<input type="hidden" name="business" value="rodsmith@rodsbooks.com">
-<input type="hidden" name="item_name" value="rEFInd Boot Manager">
-<input type="hidden" name="currency_code" value="USD">
-<input type="hidden" name="amount" value="1.00">
-<input type="image" src="http://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
-</form>
-
-</td>
-<td><form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
-<input type="hidden" name="cmd" value="_xclick">
-<input type="hidden" name="business" value="rodsmith@rodsbooks.com">
-<input type="hidden" name="item_name" value="rEFInd Boot Manager">
-<input type="hidden" name="currency_code" value="USD">
-<input type="hidden" name="amount" value="2.50">
-<input type="image" src="http://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
-</form>
-
-</td>
-<td><form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
-<input type="hidden" name="cmd" value="_xclick">
-<input type="hidden" name="business" value="rodsmith@rodsbooks.com">
-<input type="hidden" name="item_name" value="rEFInd Boot Manager">
-<input type="hidden" name="currency_code" value="USD">
-<input type="hidden" name="amount" value="5.00">
-<input type="image" src="http://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
-</form>
-
-</td>
-<td><form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
-<input type="hidden" name="cmd" value="_xclick">
-<input type="hidden" name="business" value="rodsmith@rodsbooks.com">
-<input type="hidden" name="item_name" value="rEFInd Boot Manager">
-<input type="hidden" name="currency_code" value="USD">
-<input type="hidden" name="amount" value="10.00">
-<input type="image" src="http://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
-</form>
-
-</td>
-<td>
-<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
-<input type="hidden" name="cmd" value="_donations">
-<input type="hidden" name="business" value="rodsmith@rodsbooks.com">
-<input type="hidden" name="lc" value="US">
-<input type="hidden" name="no_note" value="0">
-<input type="hidden" name="currency_code" value="USD">
-<input type="hidden" name="item_name" value="rEFInd Boot Manager">
-<input type="hidden" name="bn" value="PP-DonationsBF:btn_donate_LG.gif:NonHostedGuest">
-<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
-<img alt="Donate with PayPal" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
-</form>
-</td></tr>
-</table> 
-
-<hr />
-
-<p>This page is part of the documentation for the rEFInd boot manager. If a Web search has brought you here, you may want to start at the <a href="index.html">main page.</a></p>
-
-<hr />
-
-<p>Before you invest time in downloading and trying to install rEFInd, you may want to verify that you can actually use the program at all. rEFInd is useful only on EFI-based computers, not older BIOS-based computers. In fact, most EFI-based <i>x</i>86-64 computers provide a Compatibility Support Module (CSM), which is essentially a BIOS emulation mode. Some EFI implementations are in fact built atop a conventional BIOS, and retain BIOS's boot abilities via this underlying code. Thus, it's possible that you're currently booting a modern EFI-capable computer in BIOS mode.</p>
-
-<p>Unfortunately, determining which mode you're using can be tricky; the clues are subtle or hidden in ways that require specialized knowledge to extract. This page will help you figure it out. I first present general information on identifying your hardware's capabilities. I then describe ways to identify your current boot mode in both Linux and Windows.</p>
-
-<h2>Identifying Your Hardware's Capabilities</h2>
-
-<p>Let's get the easy case out of the way: If you have a Macintosh with an Intel CPU, it's got EFI capabilities, and you'll be able to use rEFInd. Earlier Macs with PowerPC CPUs use OpenFirmware, and rEFInd can't be used with them.</p>
-
-<p>For everything else, it can be harder to tell. Your best bet is to locate a PDF version of your computer's or motherboard's manual and search it for the string <i>EFI</i>. Checking your firmware's options via the firmware setup utility (typically access by pressing Del, F2, F10, or F12 at boot time) is also worth doing, but you'll need to check every option yourself. Most EFI-enabled PCs include at least one reference to an option you can set; however, manuals and firmware setup tools often don't make a big deal of this feature, particularly on boards with relatively primitive EFI support. For instance, the manual for a Gigabyte GA-78LMT-S2P motherboard includes the following paragraph, on p. 28:</p>
-
-<div class="quote">
-<ul>
-<li><b>EFI CD/DVD Boot Option</b><br/>Set this item to <b>EFI</b> if you want to install the operating system to a hard drive larger than 2.2 TB. Make sure the operating system to be installed supports booting from a GPT partition, such as Windows 7 64-bit and Windows Server 2003 64-bit. <b>Auto</b> lets the BIOS automatically configure this setting depending on the hard drive you install. (Default: Auto)</li>
-</ul>
-</div>
-
-<p>A casual reader might easily overlook this option, or misinterpret it to mean that the feature is much less important than it is. In fact, this particular motherboard offers very poor control over its EFI vs. BIOS booting features. (See <a href="http://www.rodsbooks.com/gb-hybrid-efi/">my Web page on this EFI implementation</a> for details.)</p>
-
-<p>Some manuals omit even mention of EFI, and instead refer to "legacy boot" or some similar term, referring to BIOS-style booting. Such references may imply that the firmware supports EFI booting if the "legacy boot" mode is disabled or restricted in some way.</p>
-
-<p>Understated EFI features often indicate a slapdash approach to EFI. Such systems sometimes implement EFI as a layer atop a conventional BIOS. More modern EFIs, though, completely replace the BIOS. Some manufacturers, such as ASUS and its sibling ASRock, are now actively promoting their more advanced EFI implementations. Such products often come with flashy new GUIs in their firmware.</p>
-
-<p>Positive identification of EFI support in your firmware does <i>not</i> guarantee that your current OSes are booting in EFI mode. (Mac OS X booting on a Mac is an exception to this rule, though.) For that, you'll need to run some tests in your running OSes.</p>
-
-<h2>Identifying Your Linux Boot Mode</h2>
-
-<p>Identifying your boot mode in Linux is relatively straightforward. The simplest way is to check for the presence of a <tt>/sys/firmware/efi</tt> directory. The mere existence of this directory indicates that the computer has booted in EFI mode. Its absence suggests a BIOS-mode boot&mdash;but see below for an important caveat.</p>
-
-<p>Another test, which produces more detailed information about the EFI implementation, is to check the kernel ring buffer for references to EFI. You can do this as follows:</p>
-
-<ol>
-
-<li>Launch a terminal program in GUI mode, or log in using text mode.</li>
-
-<li>Type <b><tt>dmesg | grep EFI</tt></b>.
-
-</ol>
-
-<p>The result on a BIOS-based computer should be few or no lines of output. On an EFI-based computer, though, the output will be extensive:</p>
-
-<pre class="listing">
-[    0.000000] Command line: BOOT_IMAGE=dev000:\EFI\elilo\bzImage-3.2.7 root=/dev/mapper/nessus-g_root  dolvm ro
-[    0.000000] EFI v2.10 by TianoCore.org
-[    0.000000] Kernel-defined memdesc doesn't match the one from EFI!
-[    0.000000] EFI: mem00: type=7, attr=0xf, range=[0x0000000000086000-0x000000000009c000) (0MB)
-[    0.000000] EFI: mem01: type=4, attr=0xf, range=[0x000000000009c000-0x000000000009d000) (0MB)
-...
-[    0.000000] EFI: mem58: type=0, attr=0x1, range=[0x00000000fec00000-0x0000000100000000) (20MB)
-[    0.000000] EFI: mem59: type=7, attr=0xf, range=[0x0000000100000000-0x0000000230000000) (4864MB)
-[    0.000000] Kernel command line: BOOT_IMAGE=dev000:\EFI\elilo\bzImage-3.2.7 root=/dev/mapper/nessus-g_root  dolvm ro
-[    0.844752] fbcon: EFI VGA (fb0) is primary device
-[    0.853525] fb0: EFI VGA frame buffer device
-[    1.061571] EFI Variables Facility v0.08 2004-May-17
-</pre>
-
-<p>I've actually cut quite a few lines from this output; there are a total of 60 <tt>EFI: mem<i>##</i></tt> lines on this computer. (Another of my computers has 148 such lines!) A BIOS-based computer will lack most or all of these lines, and certainly the <tt>EFI: mem<i>##</i></tt> lines. I've heard of some BIOS-based computers that produce the final <tt>EFI Variables Facility</tt> line, though.</p>
-
-<p>One caveat exists to these tests: It's possible to boot Linux in EFI mode but disable the EFI features that create the <tt>/sys/firmware/efi</tt> directory and the copious EFI output in <tt>dmesg</tt>. This can happen because your kernel was compiled without EFI support or because you've added the <tt>noefi</tt> line to your existing BIOS boot loader configuration. To the best of my knowledge, no major Linux distribution ships with EFI support disabled in either of these ways, so chances are your tests won't mislead you to thinking you're using BIOS mode unless you've recompiled your kernel or deliberately added a <tt>noefi</tt> parameter to your boot loader configuration.</p>
-
-<h2>Identifying Your Windows Boot Mode</h2>
-
-<p>I know of no easy command or standard display that positively identifies an EFI boot of Windows; however, Microsoft has tied use of the GUID Partition Table (GPT) to EFI booting. If you've booted from a GPT disk, then you <i>must</i> be using EFI, and if you've booted from a Master Boot Record (MBR) disk, you <i>must</i> have booted in BIOS mode. Therefore, you can check your partition table type as a proxy for your boot mode. To do this in Windows 7, follow these steps:</p>
-
-<ol>
-
-<li>Open the Control Panel.</li>
-
-<li>Click System and Security.</li>
-
-<li>Click Create and Format Hard Disk Partitions under Administrative Tools. The Disk Management window should open.</li>
-
-<li>Right-click on Disk 0 on the left side of the bottom pane of the window. A context menu should appear.</li>
-
-<li>Click Properties in the context menu. A Properties dialog box should open.</li>
-
-<li>Select the Volumes tab. The result should resemble the below figure. The Partition Style item identifies the partition table type&mdash;GPT in this example.</li>
-
-</ol>
-
-    <br /><img src="windows-gpt.png" align="center" width="414"
-    height="461" alt="Under Windows, you can use the disk's partition table
-    type to determine your boot mode." border=2> <br />
-
-<p>An important caveat with this method is that you must examine your boot disk. It's possible to use GPT on a data disk even on a BIOS-based computer, or to use an MBR data disk even on an EFI-based computer. Thus, if you examine the wrong disk, you can be led to an incorrect conclusion about your computer's boot mode.</p>
-
-<hr />
-
-<p>copyright &copy; 2012 by Roderick W. Smith</p>
-
-<p>This document is licensed under the terms of the <a href="FDL-1.3.txt">GNU Free Documentation License (FDL), version 1.3.</a></p>
-
-<p>If you have problems with or comments about this Web page, please e-mail me at <a href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com.</a> Thanks.</p>
-
-<p><a href="index.html">Go to the main rEFInd page</a></p>
-
-<p><a href="using.html">Learn how to use rEFInd</a></p>
-
-  <p><a href="http://www.rodsbooks.com/">Return</a> to my main Web page.</p>
-</body>
-</html>
+<?xml version="1.0" encoding="utf-8" standalone="no"?>\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r
+  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
+\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+  <title>The rEFInd Boot Manager: What's Your Boot Mode?</title>\r
+  <link href="../Styles/styles.css" rel="stylesheet" type="text/css" />\r
+</head>\r
+\r
+<body>\r
+  <h1>The rEFInd Boot Manager:<br />What's Your Boot Mode?</h1>\r
+\r
+  <p class="subhead">by Roderick W. Smith, <a\r
+href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>\r
+\r
+<p>Originally written: 3/14/2012; last Web page update: 4/19/2012, referencing rEFInd 0.2.7</p>\r
+\r
+\r
+<p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>\r
+\r
+<table border="1">\r
+<tr>\r
+<td>Donate $1.00</td>\r
+<td>Donate $2.50</td>\r
+<td>Donate $5.00</td>\r
+<td>Donate $10.00</td>\r
+<td>Donate another value</td>\r
+</tr>\r
+<tr>\r
+<td><form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">\r
+<input type="hidden" name="cmd" value="_xclick">\r
+<input type="hidden" name="business" value="rodsmith@rodsbooks.com">\r
+<input type="hidden" name="item_name" value="rEFInd Boot Manager">\r
+<input type="hidden" name="currency_code" value="USD">\r
+<input type="hidden" name="amount" value="1.00">\r
+<input type="image" src="http://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">\r
+</form>\r
+\r
+</td>\r
+<td><form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">\r
+<input type="hidden" name="cmd" value="_xclick">\r
+<input type="hidden" name="business" value="rodsmith@rodsbooks.com">\r
+<input type="hidden" name="item_name" value="rEFInd Boot Manager">\r
+<input type="hidden" name="currency_code" value="USD">\r
+<input type="hidden" name="amount" value="2.50">\r
+<input type="image" src="http://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">\r
+</form>\r
+\r
+</td>\r
+<td><form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">\r
+<input type="hidden" name="cmd" value="_xclick">\r
+<input type="hidden" name="business" value="rodsmith@rodsbooks.com">\r
+<input type="hidden" name="item_name" value="rEFInd Boot Manager">\r
+<input type="hidden" name="currency_code" value="USD">\r
+<input type="hidden" name="amount" value="5.00">\r
+<input type="image" src="http://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">\r
+</form>\r
+\r
+</td>\r
+<td><form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">\r
+<input type="hidden" name="cmd" value="_xclick">\r
+<input type="hidden" name="business" value="rodsmith@rodsbooks.com">\r
+<input type="hidden" name="item_name" value="rEFInd Boot Manager">\r
+<input type="hidden" name="currency_code" value="USD">\r
+<input type="hidden" name="amount" value="10.00">\r
+<input type="image" src="http://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">\r
+</form>\r
+\r
+</td>\r
+<td>\r
+<form action="https://www.paypal.com/cgi-bin/webscr" method="post">\r
+<input type="hidden" name="cmd" value="_donations">\r
+<input type="hidden" name="business" value="rodsmith@rodsbooks.com">\r
+<input type="hidden" name="lc" value="US">\r
+<input type="hidden" name="no_note" value="0">\r
+<input type="hidden" name="currency_code" value="USD">\r
+<input type="hidden" name="item_name" value="rEFInd Boot Manager">\r
+<input type="hidden" name="bn" value="PP-DonationsBF:btn_donate_LG.gif:NonHostedGuest">\r
+<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">\r
+<img alt="Donate with PayPal" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">\r
+</form>\r
+</td></tr>\r
+</table> \r
+\r
+<hr />\r
+\r
+<p>This page is part of the documentation for the rEFInd boot manager. If a Web search has brought you here, you may want to start at the <a href="index.html">main page.</a></p>\r
+\r
+<hr />\r
+\r
+<p>Before you invest time in downloading and trying to install rEFInd, you may want to verify that you can actually use the program at all. rEFInd is useful only on EFI-based computers, not older BIOS-based computers. In fact, most EFI-based <i>x</i>86-64 computers provide a Compatibility Support Module (CSM), which is essentially a BIOS emulation mode. Some EFI implementations are in fact built atop a conventional BIOS, and retain BIOS's boot abilities via this underlying code. Thus, it's possible that you're currently booting a modern EFI-capable computer in BIOS mode.</p>\r
+\r
+<p>Unfortunately, determining which mode you're using can be tricky; the clues are subtle or hidden in ways that require specialized knowledge to extract. This page will help you figure it out. I first present general information on identifying your hardware's capabilities. I then describe ways to identify your current boot mode in both Linux and Windows.</p>\r
+\r
+<h2>Identifying Your Hardware's Capabilities</h2>\r
+\r
+<p>Let's get the easy case out of the way: If you have a Macintosh with an Intel CPU, it's got EFI capabilities, and you'll be able to use rEFInd. Earlier Macs with PowerPC CPUs use OpenFirmware, and rEFInd can't be used with them.</p>\r
+\r
+<p>For everything else, it can be harder to tell. Your best bet is to locate a PDF version of your computer's or motherboard's manual and search it for the string <i>EFI</i>. Checking your firmware's options via the firmware setup utility (typically access by pressing Del, F2, F10, or F12 at boot time) is also worth doing, but you'll need to check every option yourself. Most EFI-enabled PCs include at least one reference to an option you can set; however, manuals and firmware setup tools often don't make a big deal of this feature, particularly on boards with relatively primitive EFI support. For instance, the manual for a Gigabyte GA-78LMT-S2P motherboard includes the following paragraph, on p. 28:</p>\r
+\r
+<div class="quote">\r
+<ul>\r
+<li><b>EFI CD/DVD Boot Option</b><br/>Set this item to <b>EFI</b> if you want to install the operating system to a hard drive larger than 2.2 TB. Make sure the operating system to be installed supports booting from a GPT partition, such as Windows 7 64-bit and Windows Server 2003 64-bit. <b>Auto</b> lets the BIOS automatically configure this setting depending on the hard drive you install. (Default: Auto)</li>\r
+</ul>\r
+</div>\r
+\r
+<p>A casual reader might easily overlook this option, or misinterpret it to mean that the feature is much less important than it is. In fact, this particular motherboard offers very poor control over its EFI vs. BIOS booting features. (See <a href="http://www.rodsbooks.com/gb-hybrid-efi/">my Web page on this EFI implementation</a> for details.)</p>\r
+\r
+<p>Some manuals omit even mention of EFI, and instead refer to "legacy boot" or some similar term, referring to BIOS-style booting. Such references may imply that the firmware supports EFI booting if the "legacy boot" mode is disabled or restricted in some way.</p>\r
+\r
+<p>Understated EFI features often indicate a slapdash approach to EFI. Such systems sometimes implement EFI as a layer atop a conventional BIOS. More modern EFIs, though, completely replace the BIOS. Some manufacturers, such as ASUS and its sibling ASRock, are now actively promoting their more advanced EFI implementations. Such products often come with flashy new GUIs in their firmware.</p>\r
+\r
+<p>Positive identification of EFI support in your firmware does <i>not</i> guarantee that your current OSes are booting in EFI mode. (Mac OS X booting on a Mac is an exception to this rule, though.) For that, you'll need to run some tests in your running OSes.</p>\r
+\r
+<h2>Identifying Your Linux Boot Mode</h2>\r
+\r
+<p>Identifying your boot mode in Linux is relatively straightforward. The simplest way is to check for the presence of a <tt>/sys/firmware/efi</tt> directory. The mere existence of this directory indicates that the computer has booted in EFI mode. Its absence suggests a BIOS-mode boot&mdash;but see below for an important caveat.</p>\r
+\r
+<p>Another test, which produces more detailed information about the EFI implementation, is to check the kernel ring buffer for references to EFI. You can do this as follows:</p>\r
+\r
+<ol>\r
+\r
+<li>Launch a terminal program in GUI mode, or log in using text mode.</li>\r
+\r
+<li>Type <b><tt>dmesg | grep EFI</tt></b>.\r
+\r
+</ol>\r
+\r
+<p>The result on a BIOS-based computer should be few or no lines of output. On an EFI-based computer, though, the output will be extensive:</p>\r
+\r
+<pre class="listing">\r
+[    0.000000] Command line: BOOT_IMAGE=dev000:\EFI\elilo\bzImage-3.2.7 root=/dev/mapper/nessus-g_root  dolvm ro\r
+[    0.000000] EFI v2.10 by TianoCore.org\r
+[    0.000000] Kernel-defined memdesc doesn't match the one from EFI!\r
+[    0.000000] EFI: mem00: type=7, attr=0xf, range=[0x0000000000086000-0x000000000009c000) (0MB)\r
+[    0.000000] EFI: mem01: type=4, attr=0xf, range=[0x000000000009c000-0x000000000009d000) (0MB)\r
+...\r
+[    0.000000] EFI: mem58: type=0, attr=0x1, range=[0x00000000fec00000-0x0000000100000000) (20MB)\r
+[    0.000000] EFI: mem59: type=7, attr=0xf, range=[0x0000000100000000-0x0000000230000000) (4864MB)\r
+[    0.000000] Kernel command line: BOOT_IMAGE=dev000:\EFI\elilo\bzImage-3.2.7 root=/dev/mapper/nessus-g_root  dolvm ro\r
+[    0.844752] fbcon: EFI VGA (fb0) is primary device\r
+[    0.853525] fb0: EFI VGA frame buffer device\r
+[    1.061571] EFI Variables Facility v0.08 2004-May-17\r
+</pre>\r
+\r
+<p>I've actually cut quite a few lines from this output; there are a total of 60 <tt>EFI: mem<i>##</i></tt> lines on this computer. (Another of my computers has 148 such lines!) A BIOS-based computer will lack most or all of these lines, and certainly the <tt>EFI: mem<i>##</i></tt> lines. I've heard of some BIOS-based computers that produce the final <tt>EFI Variables Facility</tt> line, though.</p>\r
+\r
+<p>One caveat exists to these tests: It's possible to boot Linux in EFI mode but disable the EFI features that create the <tt>/sys/firmware/efi</tt> directory and the copious EFI output in <tt>dmesg</tt>. This can happen because your kernel was compiled without EFI support or because you've added the <tt>noefi</tt> line to your existing BIOS boot loader configuration. To the best of my knowledge, no major Linux distribution ships with EFI support disabled in either of these ways, so chances are your tests won't mislead you to thinking you're using BIOS mode unless you've recompiled your kernel or deliberately added a <tt>noefi</tt> parameter to your boot loader configuration.</p>\r
+\r
+<h2>Identifying Your Windows Boot Mode</h2>\r
+\r
+<p>The easiest way to determine your boot mode in Windows is probably to use the <tt>bcdedit</tt> program to examine your boot loader configuration. To do so, launch an administrative Command Prompt (by right-clicking a Command Prompt icon and selecting Run As Administrator from the context menu) and then type <tt class="userinput">bcdedit</tt> in the window. The result will include two blocks of information, on the boot manager and the boot loader. The latter is more diagnostic. On an EFI-booted system, it will resemble the following:</p>\r
+\r
+<pre class="listing">Windows Boot Loader\r
+-------------------\r
+identifier              {current}\r
+device                  partition=C:\r
+path                    \Windows\system32\winload.efi\r
+description             Windows 7 Home Premium (recovered)\r
+locale                  en-US\r
+recoverysequence        {2844aaae-9978-11e0-a381-afc0564c0e08}\r
+recoveryenabled         Yes\r
+osdevice                partition=C:\r
+systemroot              \Windows\r
+resumeobject            {3aa4c728-9935-11e0-9f12-806e6f6e6963}</pre>\r
+\r
+<p>The important part is the value of the <tt>path</tt> line. Note that it identifies an EFI executable&mdash;<tt>\Windows\system32\winload.efi</tt>. On a BIOS-based computer, by contrast, this line refers to <tt>\Windows\system32\winload.exe</tt>&mdash;a standard Windows <tt>.exe</tt> file, not an EFI <tt>.efi</tt> file.</p>\r
+\r
+<p>Another way to identify your boot mode is to examine your partitions. Microsoft has tied use of the GUID Partition Table (GPT) to EFI booting. If you've booted from a GPT disk, then you <i>must</i> be using EFI, and if you've booted from a Master Boot Record (MBR) disk, you <i>must</i> have booted in BIOS mode. Therefore, you can check your partition table type as a proxy for your boot mode. To do this in Windows 7, follow these steps:</p>\r
+\r
+<ol>\r
+\r
+<li>Open the Control Panel.</li>\r
+\r
+<li>Click System and Security.</li>\r
+\r
+<li>Click Create and Format Hard Disk Partitions under Administrative Tools. The Disk Management window should open.</li>\r
+\r
+<li>Right-click on Disk 0 on the left side of the bottom pane of the window. A context menu should appear.</li>\r
+\r
+<li>Click Properties in the context menu. A Properties dialog box should open.</li>\r
+\r
+<li>Select the Volumes tab. The result should resemble the below figure. The Partition Style item identifies the partition table type&mdash;GPT in this example.</li>\r
+\r
+</ol>\r
+\r
+    <br /><img src="windows-gpt.png" align="center" width="414"\r
+    height="461" alt="Under Windows, you can use the disk's partition table\r
+    type to determine your boot mode." border=2> <br />\r
+\r
+<p>An important caveat with this method is that you must examine your boot disk. It's possible to use GPT on a data disk even on a BIOS-based computer, or to use an MBR data disk even on an EFI-based computer. Thus, if you examine the wrong disk, you can be led to an incorrect conclusion about your computer's boot mode.</p>\r
+\r
+<hr />\r
+\r
+<p>copyright &copy; 2012 by Roderick W. Smith</p>\r
+\r
+<p>This document is licensed under the terms of the <a href="FDL-1.3.txt">GNU Free Documentation License (FDL), version 1.3.</a></p>\r
+\r
+<p>If you have problems with or comments about this Web page, please e-mail me at <a href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com.</a> Thanks.</p>\r
+\r
+<p><a href="index.html">Go to the main rEFInd page</a></p>\r
+\r
+<p><a href="using.html">Learn how to use rEFInd</a></p>\r
+\r
+  <p><a href="http://www.rodsbooks.com/">Return</a> to my main Web page.</p>\r
+</body>\r
+</html>\r
index 20e12466a468c66e5d0e471264d1a2fca18950c3..ccbfb5b464f1fc36ad920375199a06a14eaea4be 100644 (file)
@@ -14,7 +14,7 @@
   <p class="subhead">by Roderick W. Smith, <a
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
-  <p>Originally written: 3/14/2012; last Web page update: 4/14/2012, referencing rEFInd 0.2.6</p>
+  <p>Originally written: 3/14/2012; last Web page update: 4/19/2012, referencing rEFInd 0.2.7</p>
 
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
@@ -172,6 +172,11 @@ timeout 20
    <td>None</td>
    <td>rEFInd defaults to a graphical mode; however, if you prefer to do without the flashy graphics, you can run it in text mode by including this option.</td>
 </tr>
+<tr>
+   <td><tt>scan_driver_dirs</tt></td>
+   <td>directory path(s)</td>
+   <td>Scans the specified directory or directories for EFI driver files. If rEFInd discovers <tt>.efi</tt> files in those directories, they're loaded and activated as drivers.</td>
+</tr>
 <tr>
    <td><tt>scanfor</tt></td>
    <td><tt>internal</tt>, <tt>external</tt>, <tt>optical</tt>, <tt>hdbios</tt>, <tt>biosexternal</tt>, <tt>cd</tt>, and <tt>manual</tt></td>
@@ -197,11 +202,12 @@ timeout 20
 # Sample refind.conf file
 timeout 5
 banner custom.bmp
+scan_driver_dirs drivers,EFI/refind/drivers
 scanfor manual,external,optical
 default_selection elilo
 </pre>
 
-<p>This example sets a timeout of 5 seconds; loads a custom graphic file called <tt>custom.bmp</tt> from the directory in which <tt>refind.efi</tt> resides; uses manual boot loader configuration but also scans for external EFI boot loaders and EFI boot loaders on optical discs; and sets the default boot loader to the first loader found that includes the string <tt>elilo</tt>. Of course, since this file specifies use of manual boot loader configuration, it's not complete; you'll need to add at least one OS stanza to be able to boot from anything but an external disk or optical drive....</p>
+<p>This example sets a timeout of 5 seconds; loads a custom graphic file called <tt>custom.bmp</tt> from the directory in which <tt>refind.efi</tt> resides; scans the <tt>drivers</tt> and <tt>EFI/refind/drivers</tt> directories for EFI drivers; uses manual boot loader configuration but also scans for external EFI boot loaders and EFI boot loaders on optical discs; and sets the default boot loader to the first loader found that includes the string <tt>elilo</tt>. Of course, since this file specifies use of manual boot loader configuration, it's not complete; you'll need to add at least one OS stanza to be able to boot from anything but an external disk or optical drive, as described shortly.</p>
 
 <h2>Creating OS Stanzas</h2>
 
@@ -406,7 +412,7 @@ menuentry Gentoo {
 
 <p><a href="index.html">Go to the main rEFInd page</a></p>
 
-<p><a href="linux.html">Learn about methods of booting Linux with rEFInd</a></p>
+<p><a href="linux.html">Learn about how to adjust rEFInd's appearance</a></p>
 
   <p><a href="http://www.rodsbooks.com/">Return</a> to my main Web page.</p>
 </body>
index 0789f199a8c0d306223ab68af3f4b54bcee79953..bb28a916d3795f1a25413521c028d9622fff15c8 100644 (file)
@@ -14,7 +14,7 @@
 <p class="subhead">by Roderick W. Smith, <a
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
-<p>Originally written: 3/14/2012; last Web page update: 4/14/2012, referencing rEFInd 0.2.6</p>
+<p>Originally written: 3/14/2012; last Web page update: 4/19/2012, referencing rEFInd 0.2.7</p>
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
 
@@ -104,12 +104,16 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <li>Set OS-specific boot options, such as to launch Mac OS X with verbose text-mode debug messages.</li>
 
+<li>Load EFI drivers for filesystems or hardware devices not supported natively by your firmware. (This feature is absent in some builds of rEFIt and in rEFInd prior to version 0.2.7.)</li>
+
 </ul>
 
 <p>I've used rEFIt on a couple of computers for over a year, but I've found that it has some frustrating limitations. It tends to flood the screen with non-functional BIOS boot options, for instance; and it has a number of bugs on UEFI-based systems. I therefore expanded on rEFIt, giving rEFInd features that improve on or go beyond those of rEFIt, such as:</p>
 
 <ul>
 
+<li>Bug fixes, focusing on those that have bothered me personally, such as those I've just mentioned.</li>
+
 <li>User-configurable methods of detecting boot loaders:
 
     <ul>
@@ -122,6 +126,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <li>The ability to fine-tune options passed to EFI boot loaders, via manual configuration.</li>
 
+<li>The ability to specify additional directories to scan for boot loaders and drivers (as of version 0.2.7).</li>
+
 <li>Proper handling of more OS options than can fit on the screen. (rEFIt displays an empty list in graphical mode when it detects too many OSes.)</li>
 
 <li>Additional OS icons (all of which are Linux distributions, at least so far). This can make it easier to find a specific distribution in the boot list if you've installed multiple Linux distributions.</li>
@@ -138,7 +144,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 </ul>
 
-<p>On the flip side, at least for Mac users, rEFInd comes with less sophisticated Mac installation tools than does rEFIt, in favor of more OS-agnostic packaging. Also, rEFInd doesn't support loading EFI drivers; that job should be done in other ways when using rEFInd.</p>
+<p>On the flip side, at least for Mac users, rEFInd comes with less sophisticated Mac installation tools than does rEFIt, in favor of more OS-agnostic packaging.</p>
 
 <p>If these features sound useful, then read on and try rEFInd. If not, you may need to look elsewhere. My <a href="http://www.rodsbooks.com/efi-bootloaders/index.html">Managing EFI Boot Loaders for Linux</a> page may be useful to you in this case.</p>
 
index d2070f06fb9cc628ced37519193ab9d43c241b9a..2899079b6afd97c59c8eda7e4f77b7871795bf49 100644 (file)
@@ -14,7 +14,7 @@
   <p class="subhead">by Roderick W. Smith, <a
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
-  <p>Originally written: 3/14/2012; last Web page update: 4/14/2012, referencing rEFInd 0.2.6</p>
+  <p>Originally written: 3/14/2012; last Web page update: 4/19/2012, referencing rEFInd 0.2.7</p>
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
 
@@ -96,7 +96,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <ul>
 
-<li><b><a href="http://sourceforge.net/projects/refind/files/0.2.6/refind-src-0.2.6.zip/download">A
+<li><b><a href="http://sourceforge.net/projects/refind/files/0.2.7/refind-src-0.2.7.zip/download">A
     source code zip file</a></b>&mdash;This is useful if you want to
     compile the software locally. Note that I use Linux with the <a
     href="http://sourceforge.net/projects/gnu-efi">GNU-EFI</a> development
@@ -104,7 +104,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
     that toolchain is theoretically possible, but I've not attempted
     it.</li>
 
-<li><b><a href="http://sourceforge.net/projects/refind/files/0.2.6/refind-bin-0.2.6.zip/download">A
+<li><b><a href="http://sourceforge.net/projects/refind/files/0.2.7/refind-bin-0.2.7.zip/download">A
     binary zip file</a></b>&mdash;Download this if you want to install rEFInd on
     an <i>x</i>86 or <i>x</i>86-64 computer and have no need to test rEFInd
     first by booting it on an optical disc. This zip file package includes both
@@ -112,25 +112,28 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
     versions of rEFInd. Which you install depends on your architecture, as
     described on the <a href="installing.html">Installing rEFInd</a> page.</li>
 
-<li><b><a href="http://sourceforge.net/projects/refind/files/0.2.6/refind-cd-0.2.6.zip/download">A
-    CD-R image file</a></b>&mdash;This download contains the same files as the
-    zip file, but you can burn it to a CD-R to test rEFInd without installing it
-    first. (It boots on UEFI PCs, but fails on at least some Macs.) If you like
-    it, you can then copy the files from the CD-R to your hard disk. The files
-    are named in such a way that the disc should boot on either 64-bit
-    (<i>x</i>86-64) or 32-bit (<i>x</i>86) EFI computers. Note that there's a
-    bug that causes rEFInd to complain about invalid parameters while scanning
-    various directories. You can safely ignore this message, but you'll need to
-    press a key to dismiss it. I've included an open source EFI shell program on
-    this disc that's not included in the binary zip file, so that you can access
-    an EFI shell from a bootable disc even if you don't have an EFI shell
-    available from your regular hard disk.</li>
+<li><b><a
+    href="http://sourceforge.net/projects/refind/files/0.2.7/refind-cd-0.2.7.zip/download">A
+    CD-R image file</a></b>&mdash;This download contains the same files as
+    the zip file, but you can burn it to a CD-R to test rEFInd without
+    installing it first. (It boots on UEFI PCs, but fails on some older
+    Macs.) If you like it, you can then copy the files from the CD-R to
+    your hard disk. The files are named in such a way that the disc should
+    boot on either 64-bit (<i>x</i>86-64) or 32-bit (<i>x</i>86) EFI
+    computers. Note that there's a bug that causes rEFInd to complain about
+    invalid parameters while scanning various directories. You can safely
+    ignore this message, but you'll need to press a key to dismiss it. I've
+    included an open source EFI shell program on this disc that's not
+    included in the binary zip file, so that you can access an EFI shell
+    from a bootable disc even if you don't have an EFI shell available from
+    your regular hard disk. This can be an extremely valuable diagnostic
+    tool if you know about about using an EFI shell.</li>
 
 </ul>
 
 <p>If you're using another platform, you can give rEFInd a try; however, you'll need to build it from source code yourself or track down a binary from another source. (Perhaps by the time you read this it will be included in Linux distributions built for unusual CPUs.)</p>
 
-<p>If you download a zip file, you'll need to extract the files with a tool such as <tt>unzip</tt>, which is included with Linux and Mac OS X. Numerous Windows utilities also support this format, such as <a href="http://www.pkware.com/software/pkzip/">PKZIP</a> and <a href="http://www.7-zip.org/">7-Zip.</a></p>
+<p>To extract the files from the zip file images I've provided, you'll need a tool such as <tt>unzip</tt>, which is included with Linux and Mac OS X. Numerous Windows utilities also support this format, such as <a href="http://www.pkware.com/software/pkzip/">PKZIP</a> and <a href="http://www.7-zip.org/">7-Zip.</a></p>
 
 <p>You should be able to create a bootable USB flash drive from either the binary zip file or the CD-R image file; just treat the flash drive as if it were a hard disk and install rEFInd as described on the <a href="installing.html">installation page.</a> Using the fallback boot loader name of <tt>EFI/boot/bootx64.efi</tt> is likely to be the most useful way to install rEFInd to a removable medium.</p>
 
index 7fe532258fed63896ee0ef36ffe3f3083d02cf12..59c8a86fa98c484ff3afe65b0ac28881d725fefb 100644 (file)
@@ -14,7 +14,7 @@
   <p class="subhead">by Roderick W. Smith, <a
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
-  <p>Originally written: 3/14/2012; last Web page update: 4/14/2012, referencing rEFInd 0.2.6</p>
+  <p>Originally written: 3/14/2012; last Web page update: 4/19/2012, referencing rEFInd 0.2.7</p>
 
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
@@ -117,6 +117,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <li><a href="configfile.html">Configuring the Boot Manager</a>&mdash;For advanced users, information on customizing a rEFInd installation</li>
 
+<li><a href="themes.html">Theming rEFind</a>&mdash;Information on third-party themes for rEFInd</li>
+
 <li><a href="linux.html">Options for Booting Linux</a>&mdash;Methods of booting Linux, particularly with the EFI stub loader (distribution maintainers should read this!)</li>
 
 <li><a href="revisions.html">Revisions</a>&mdash;Information on the history of rEFInd releases</li>
index 0009d550c7e915e966ff127c8b6fc9a221ab5f0f..2209f88cbaf30ce0ea5d9d16a6ebbb7fa44945a9 100644 (file)
@@ -14,7 +14,7 @@
   <p class="subhead">by Roderick W. Smith, <a
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
-  <p>Originally written: 3/14/2012; last Web page update: 4/17/2012, referencing rEFInd 0.2.6</p>
+  <p>Originally written: 3/14/2012; last Web page update: 4/19/2012, referencing rEFInd 0.2.7</p>
 
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
@@ -145,9 +145,9 @@ Filesystem     1K-blocks  Used Available Use% Mounted on
 <h2>Installing rEFInd Using Mac OS X</h2>
 </a>
 
-<p class="sidebar">One of the reasons I've abandoned rEFIt's GUI installation tools for Mac OS X is that there are several bug reports (such as <a href="https://sourceforge.net/tracker/index.php?func=detail&aid=3147364&group_id=161917&atid=821764">this one</a> and <a href="https://sourceforge.net/tracker/?func=detail&aid=3218104&group_id=161917&atid=821764">this one</a>) that the rEFIt installer may be causing filesystem corruption on disks over about 500 MiB. I don't have such a disk on my Mac, so I can't test solutions. Rather than risk other peoples' hard disks, I thought it best to revert to a manual installation proceudure that will, I hope, be less likely to cause problems.</p>
+<p class="sidebar">One of the reasons I've abandoned rEFIt's GUI installation tools for Mac OS X is that there are several bug reports (such as <a href="https://sourceforge.net/tracker/index.php?func=detail&aid=3147364&group_id=161917&atid=821764">this one</a> and <a href="https://sourceforge.net/tracker/?func=detail&aid=3218104&group_id=161917&atid=821764">this one</a>) that the rEFIt installer may be causing filesystem corruption on disks over about 500 MiB. I don't have such a disk on my Mac, so I can't test solutions. Rather than risk other peoples' hard disks, I thought it best to revert to a manual installation proceudure that will, I hope, be less likely to cause problems. I've received reports that rEFInd doesn't have rEFIt's disk-corruption problems, so the manual installation procedure, although less convenient, seems to have paid dividends in the form of safety.</p>
 
-<p>The procedure for installing rEFInd on a Mac is similar to that for installing it under Linux, except that you can (and probably should) install it to the OS X's system directory or some other HFS+ partition rather than to the ESP, and you must use the <tt>bless</tt> utility rather than <tt>efibootmgr</tt>. To be precise, you should follow these steps:</p>
+<p>The procedure for installing rEFInd on a Mac is similar to that for installing it under Linux, except that you can (and probably should) install it to OS X's system partition or some other HFS+ partition rather than to the ESP, and you must use the <tt>bless</tt> utility rather than <tt>efibootmgr</tt>. To be precise, you should follow these steps:</p>
 
 <ol>
 
@@ -155,7 +155,7 @@ Filesystem     1K-blocks  Used Available Use% Mounted on
 
 <li>If you want to install rEFInd on your ESP, you must first mount it. You can do this by typing <b><tt>mkdir /Volumes/esp</tt></b> followed by <b><tt>sudo mount_msdos /dev/disk0s1 /Volumes/esp</tt></b>. Note that this step is optional, and in fact I've had problems blessing a boot loader on the ESP, so I don't recommend doing this. Also, you may need to change <tt>/dev/disk0s1</tt> to something else if your ESP is at an unusual location. Use a tool such as my <a href="http://www.rodsbooks.com/gdisk/">GPT fdisk (<tt>gdisk</tt>)</a> to examine your partition table to find your ESP if necessary.</li>
 
-<li>Type <b><tt>sudo mkdir -p /efi/refind</tt></b> to create a suitable directory for rEFInd. If you want to place rEFInd on your ESP, you should adjust the pathname appropriately, as in <tt>/Volumes/esp/efi/refind</tt> if you mounted your ESP as described in the previous step. Alternatively, you can use the Finder to create the directory.</li>
+<li>Type <b><tt>sudo mkdir -p /efi/refind</tt></b> to create a suitable directory for rEFInd. If you want to place rEFInd on the ESP or some other partition, you should adjust the pathname appropriately, as in <tt>/Volumes/esp/efi/refind</tt>. Alternatively, you can use the Finder to create the directory.</li>
 
 <li>Copy the files in the <tt>refind</tt> subdirectory of the rEFInd binary package to the like-named directory you've just created. You can do this in the Finder or by typing <b><tt>sudo cp -r refind/* /efi/refind/</tt></b> in your Terminal window after changing into the rEFInd package's main directory.</li>
 
@@ -169,7 +169,7 @@ Filesystem     1K-blocks  Used Available Use% Mounted on
 
 <p>When you reboot, your Mac should bring up the rEFInd menu, and should continue to do so thereafter. If you make changes that break this association, you can re-run the <tt>bless</tt> command (if necessary, restoring the rEFInd files first). This might be necessary after installing system updates from Apple or if you upgrade rEFInd to a newer version.</p>
 
-<p>If you're replacing rEFIt, you may discover that rEFInd works on the first boot, but the system reverts back to rEFIt or a direct boot to OS X on the second boot. To fix this problem, you can remove the rEFItBlesser program, which is located at <tt>/Library/StartupItems/rEFItBlesser</tt>. This program attempts to keep rEFIt set as the default boot loader, but it also has the purpose of protecting the computer from launching the wrong OS after waking from sleep. If you want that protection, my suggestion is to install rEFIt and rEFItBlesser and then replace the <tt>refit.efi</tt> file with <tt>refind_x64.efi</tt> or <tt>refind_ia32.efi</tt> (renaming it to <tt>refit.efi</tt>. Used in this way, rEFInd will still look for its own configuration file, <tt>refind.conf</tt>, so you'll need to move it but <i>not</i> rename it. If you don't move the icons from the rEFInd package, your icons will continue to look like rEFIt icons, and you'll be missing the new icons for specific Linux distributions that rEFInd provides.</p>
+<p>If you're replacing rEFIt, you may discover that rEFInd works on the first boot, but the system reverts back to rEFIt or a direct boot to OS X on the second boot. To fix this problem, you can remove the rEFItBlesser program, which is located at <tt>/Library/StartupItems/rEFItBlesser</tt>. This program attempts to keep rEFIt set as the default boot loader, but it also has the purpose of protecting the computer from launching the wrong OS after waking from sleep. If you want that protection, my suggestion is to install rEFIt and rEFItBlesser and then replace the <tt>refit.efi</tt> file with <tt>refind_x64.efi</tt> or <tt>refind_ia32.efi</tt> (renaming it to <tt>refit.efi</tt>. Used in this way, rEFInd will still look for its own configuration file, <tt>refind.conf</tt>, so you'll need to move it but <i>not</i> rename it. If you don't move the icons from the rEFInd package, your icons will continue to look like rEFIt icons, and you'll be missing the new icons for specific Linux distributions that rEFInd provides. One final caveat: It's conceivable that rEFItBlesser is what's causing filesystem corruption for some users, so if you've been having this problem with rEFIt, it might be worth disabling this program and not using it with rEFInd.</p>
 
 <p>If you want to remove rEFInd from your system, you can delete its files. The Mac will revert to booting using whatever standard boot loader it can find. Alternatively, you can use <tt>bless</tt> to bless another EFI boot loader. The GUI Startup Disk utility in System Preferences provides a simplified interface that enables you to select which OS X installation to boot, but it doesn't look for non-Apple boot loaders, so you can't use it to enable rEFInd.</p>
 
index c8df001a4502bb1bc8c077b0470d2b1c5d21675e..d1999f1520e12f2851ab93083a0e93672f69cd24 100644 (file)
@@ -14,7 +14,7 @@
   <p class="subhead">by Roderick W. Smith, <a
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
-  <p>Originally written: 3/14/2012; last Web page update: 4/14/2012, referencing rEFInd 0.2.6</p>
+  <p>Originally written: 3/14/2012; last Web page update: 4/19/2012, referencing rEFInd 0.2.7</p>
 
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
index f1bbdb8d84be775da41d4102e2185be44d70252c..50a131b757728a6d3ee0c32c38dc49fc023a0bf6 100644 (file)
@@ -15,11 +15,11 @@ ifeq ($(ARCH),x86_64)
   LIBEG = build64
 endif
 
-LOCAL_CPPFLAGS  = -I$(SRCDIR) -I$(SRCDIR)/../include -I$(SRCDIR)/../libeg -DDEBIAN_VERSION="L\"$(DEBVER)\""
+LOCAL_CPPFLAGS  = -I$(SRCDIR) -I$(SRCDIR)/../include -I$(SRCDIR)/../libeg
 LOCAL_LDFLAGS   = -L$(SRCDIR)/../libeg/$(LIBEG)
 LOCAL_LIBS      = -leg
 
-OBJS            = main.o config.o menu.o screen.o icns.o lib.o bootsvcs.o
+OBJS            = main.o config.o menu.o screen.o icns.o lib.o driver_support.o
 TARGET          = refind.efi
 
 all: $(TARGET)
diff --git a/refind/bootsvcs.h b/refind/bootsvcs.h
deleted file mode 100644 (file)
index d9500e1..0000000
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * File to implement an full version of EFI_BOOT_SERVICES, to go beyond
- * what GNU-EFI provides. Most of the data structures in this file are taken
- * from the Tianocore UDK's UefiSpec.h file or HandleParsingLib.h files.
- * The EFI_DEVICE_PATH_PROTOCOL definition is from
- * http://wiki.phoenix.com/wiki/index.php/EFI_DEVICE_PATH_PROTOCOL.
- * The UefiSpec.h and HandleParsingLib files include the following copyright
- * notice:
- * 
- * Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
- * This program and the accompanying materials are licensed and made available under
- * the terms and conditions of the BSD License that accompanies this distribution.
- * The full text of the license may be found at
- * http://opensource.org/licenses/bsd-license.php.
- *
- * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- *
- */
-
-#include <efi/efi.h>
-#include <efi/efilib.h>
-
-#ifndef _MY_BOOT_SERVICES_FILE
-#define _MY_BOOT_SERVICES_FILE
-
-typedef struct _EFI_DEVICE_PATH_PROTOCOL {
-   UINT8 Type;
-   UINT8 SubType;
-   UINT8 Length[2];
-} EFI_DEVICE_PATH_PROTOCOL;
-
-typedef
-EFI_STATUS
-(EFIAPI *EFI_CONNECT_CONTROLLER)(
-  IN  EFI_HANDLE                    ControllerHandle,
-  IN  EFI_HANDLE                    *DriverImageHandle,   OPTIONAL
-  IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath, OPTIONAL
-  IN  BOOLEAN                       Recursive
-  );
-
-typedef
-EFI_STATUS
-(EFIAPI *EFI_DISCONNECT_CONTROLLER)(
-  IN  EFI_HANDLE                     ControllerHandle,
-  IN  EFI_HANDLE                     DriverImageHandle, OPTIONAL
-  IN  EFI_HANDLE                     ChildHandle        OPTIONAL
-  );
-
-typedef
-EFI_STATUS
-(EFIAPI *EFI_OPEN_PROTOCOL) (
-   IN EFI_HANDLE                 Handle,
-   IN EFI_GUID                   * Protocol,
-   OUT VOID                      **Interface,
-   IN  EFI_HANDLE                ImageHandle,
-   IN  EFI_HANDLE                ControllerHandle, OPTIONAL
-     IN  UINT32                    Attributes
-);
-
-typedef
-EFI_STATUS
-(EFIAPI *EFI_CLOSE_PROTOCOL) (
-   IN EFI_HANDLE               Handle,
-   IN EFI_GUID                 * Protocol,
-   IN EFI_HANDLE               ImageHandle,
-   IN EFI_HANDLE               DeviceHandle
-);
-
-typedef struct {
-   EFI_HANDLE  AgentHandle;
-   EFI_HANDLE  ControllerHandle;
-   UINT32      Attributes;
-   UINT32      OpenCount;
-} EFI_OPEN_PROTOCOL_INFORMATION_ENTRY;
-
-typedef
-EFI_STATUS
-(EFIAPI *EFI_OPEN_PROTOCOL_INFORMATION) (
-   IN  EFI_HANDLE                          UserHandle,
-   IN  EFI_GUID                            * Protocol,
-   IN  EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,
-   OUT UINTN                               *EntryCount
-);
-
-typedef
-EFI_STATUS
-(EFIAPI *EFI_PROTOCOLS_PER_HANDLE) (
-   IN EFI_HANDLE       UserHandle,
-   OUT EFI_GUID        ***ProtocolBuffer,
-   OUT UINTN           *ProtocolBufferCount
-);
-
-typedef
-EFI_STATUS
-(EFIAPI *EFI_LOCATE_HANDLE_BUFFER) (
-   IN EFI_LOCATE_SEARCH_TYPE       SearchType,
-   IN EFI_GUID                     * Protocol OPTIONAL,
-   IN VOID                         *SearchKey OPTIONAL,
-   IN OUT UINTN                    *NumberHandles,
-   OUT EFI_HANDLE                  **Buffer
-);
-
-typedef
-EFI_STATUS
-(EFIAPI *EFI_LOCATE_PROTOCOL) (
-   EFI_GUID  * Protocol,
-   VOID      *Registration, OPTIONAL
-   VOID      **Interface
-);
-
-///
-/// EFI Boot Services Table.
-///
-typedef struct _MY_BOOT_SERVICES {
-  ///
-  /// The table header for the EFI Boot Services Table.
-  ///
-  EFI_TABLE_HEADER                Hdr;
-
-  //
-  // Task Priority Services
-  //
-  EFI_RAISE_TPL                   RaiseTPL;
-  EFI_RESTORE_TPL                 RestoreTPL;
-
-  //
-  // Memory Services
-  //
-  EFI_ALLOCATE_PAGES              AllocatePages;
-  EFI_FREE_PAGES                  FreePages;
-  EFI_GET_MEMORY_MAP              GetMemoryMap;
-  EFI_ALLOCATE_POOL               AllocatePool;
-  EFI_FREE_POOL                   FreePool;
-
-  //
-  // Event & Timer Services
-  //
-  EFI_CREATE_EVENT                  CreateEvent;
-  EFI_SET_TIMER                     SetTimer;
-  EFI_WAIT_FOR_EVENT                WaitForEvent;
-  EFI_SIGNAL_EVENT                  SignalEvent;
-  EFI_CLOSE_EVENT                   CloseEvent;
-  EFI_CHECK_EVENT                   CheckEvent;
-
-  //
-  // Protocol Handler Services
-  //
-  EFI_INSTALL_PROTOCOL_INTERFACE    InstallProtocolInterface;
-  EFI_REINSTALL_PROTOCOL_INTERFACE  ReinstallProtocolInterface;
-  EFI_UNINSTALL_PROTOCOL_INTERFACE  UninstallProtocolInterface;
-  EFI_HANDLE_PROTOCOL               HandleProtocol;
-  VOID                              *Reserved;
-  EFI_REGISTER_PROTOCOL_NOTIFY      RegisterProtocolNotify;
-  EFI_LOCATE_HANDLE                 LocateHandle;
-  EFI_LOCATE_DEVICE_PATH            LocateDevicePath;
-  EFI_INSTALL_CONFIGURATION_TABLE   InstallConfigurationTable;
-
-  //
-  // Image Services
-  //
-  EFI_IMAGE_LOAD                    LoadImage;
-  EFI_IMAGE_START                   StartImage;
-  EFI_EXIT                          Exit;
-  EFI_IMAGE_UNLOAD                  UnloadImage;
-  EFI_EXIT_BOOT_SERVICES            ExitBootServices;
-
-  //
-  // Miscellaneous Services
-  //
-  EFI_GET_NEXT_MONOTONIC_COUNT      GetNextMonotonicCount;
-  EFI_STALL                         Stall;
-  EFI_SET_WATCHDOG_TIMER            SetWatchdogTimer;
-
-  //
-  // DriverSupport Services
-  //
-  EFI_CONNECT_CONTROLLER            ConnectController;
-  EFI_DISCONNECT_CONTROLLER         DisconnectController;
-
-  //
-  // Open and Close Protocol Services
-  //
-  EFI_OPEN_PROTOCOL                 OpenProtocol;
-  EFI_CLOSE_PROTOCOL                CloseProtocol;
-  EFI_OPEN_PROTOCOL_INFORMATION     OpenProtocolInformation;
-
-  //
-  // Library Services
-  //
-  EFI_PROTOCOLS_PER_HANDLE          ProtocolsPerHandle;
-  EFI_LOCATE_HANDLE_BUFFER          LocateHandleBuffer;
-  EFI_LOCATE_PROTOCOL               LocateProtocol;
-//   EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES    InstallMultipleProtocolInterfaces;
-//   EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES  UninstallMultipleProtocolInterfaces;
-// 
-//   //
-//   // 32-bit CRC Services
-//   //
-//   EFI_CALCULATE_CRC32               CalculateCrc32;
-// 
-//   //
-//   // Miscellaneous Services
-//   //
-//   EFI_COPY_MEM                      CopyMem;
-//   EFI_SET_MEM                       SetMem;
-//   EFI_CREATE_EVENT_EX               CreateEventEx;
-} MY_BOOT_SERVICES;
-
-// Below is from http://git.etherboot.org/?p=mirror/efi/shell/.git;a=commitdiff;h=b1b0c63423cac54dc964c2930e04aebb46a946ec;
-// Seems to have been replaced by ParseHandleDatabaseByRelationshipWithType(), but the latter isn't working for me....
-EFI_STATUS
-LibScanHandleDatabase (
-  EFI_HANDLE  DriverBindingHandle, OPTIONAL
-  UINT32      *DriverBindingHandleIndex, OPTIONAL
-  EFI_HANDLE  ControllerHandle, OPTIONAL
-  UINT32      *ControllerHandleIndex, OPTIONAL
-  UINTN       *HandleCount,
-  EFI_HANDLE  **HandleBuffer,
-  UINT32      **HandleType
-  );
-
-extern MY_BOOT_SERVICES *gBS;
-
-#define EFI_HANDLE_TYPE_UNKNOWN                     0x000
-#define EFI_HANDLE_TYPE_IMAGE_HANDLE                0x001
-#define EFI_HANDLE_TYPE_DRIVER_BINDING_HANDLE       0x002
-#define EFI_HANDLE_TYPE_DEVICE_DRIVER               0x004
-#define EFI_HANDLE_TYPE_BUS_DRIVER                  0x008
-#define EFI_HANDLE_TYPE_DRIVER_CONFIGURATION_HANDLE 0x010
-#define EFI_HANDLE_TYPE_DRIVER_DIAGNOSTICS_HANDLE   0x020
-#define EFI_HANDLE_TYPE_COMPONENT_NAME_HANDLE       0x040
-#define EFI_HANDLE_TYPE_DEVICE_HANDLE               0x080
-#define EFI_HANDLE_TYPE_PARENT_HANDLE               0x100
-#define EFI_HANDLE_TYPE_CONTROLLER_HANDLE           0x200
-#define EFI_HANDLE_TYPE_CHILD_HANDLE                0x400
-
-
-// Below from EfiApi.h
-#define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL  0x00000001
-#define EFI_OPEN_PROTOCOL_GET_PROTOCOL        0x00000002
-#define EFI_OPEN_PROTOCOL_TEST_PROTOCOL       0x00000004
-#define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008
-#define EFI_OPEN_PROTOCOL_BY_DRIVER           0x00000010
-#define EFI_OPEN_PROTOCOL_EXCLUSIVE           0x00000020
-
-
-#endif
similarity index 93%
rename from refind/bootsvcs.c
rename to refind/driver_support.c
index 47d40e7155a615b4659371391bd0eb02d4699b6c..e04dd9d28db644afe0a2f90f6ae01b7a48ace3e0 100644 (file)
@@ -1,8 +1,10 @@
 /*
- * File to implement an full version of EFI_BOOT_SERVICES, to go beyond
- * what GNU-EFI provides. These functions were taken, with modification,
- * from various EDK2 and earlier files (see comments preceding the
- * functions and other blocks of code). The original source files
+ * File to implement LibScanHandleDatabase(), which is used by rEFInd's
+ * driver-loading code (inherited from rEFIt), but which has not been
+ * implemented in GNU-EFI and seems to have been dropped from current
+ * versions of the Tianocore library. This function was taken from a git
+ * site with EFI code, but some of the constants it uses were taken from
+ * a more recent EDK2 package (see below for details). The original files
  * bore the following copyright notice:
  *
  * Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
  *
  */
 
-#include "bootsvcs.h"
+#include "driver_support.h"
 #include "refit_call_wrapper.h"
 
-// Following "global" constants are from AutoGen.c....
+// Following "global" constants are from EDK2's AutoGen.c....
 EFI_GUID gEfiLoadedImageProtocolGuid = { 0x5B1B31A1, 0x9562, 0x11D2, { 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }};
 EFI_GUID gEfiDriverBindingProtocolGuid = { 0x18A031AB, 0xB443, 0x4D1A, { 0xA5, 0xC0, 0x0C, 0x09, 0x26, 0x1E, 0x9F, 0x71 }};
 EFI_GUID gEfiDriverConfiguration2ProtocolGuid = { 0xBFD7DC1D, 0x24F1, 0x40D9, { 0x82, 0xE7, 0x2E, 0x09, 0xBB, 0x6B, 0x4E, 0xBE }};
@@ -74,7 +76,7 @@ LibScanHandleDatabase (
   // Retrieve the list of all handles from the handle database
   //
 
-  Status = refit_call5_wrapper(gBS->LocateHandleBuffer,
+  Status = refit_call5_wrapper(BS->LocateHandleBuffer,
      AllHandles,
      NULL,
      NULL,
@@ -116,7 +118,7 @@ LibScanHandleDatabase (
     // Retrieve the list of all the protocols on each handle
     //
 
-    Status = refit_call3_wrapper(gBS->ProtocolsPerHandle,
+    Status = refit_call3_wrapper(BS->ProtocolsPerHandle,
                   (*HandleBuffer)[HandleIndex],
                   &ProtocolGuidArray,
                   &ArrayCount
@@ -152,7 +154,7 @@ LibScanHandleDatabase (
         // Retrieve the list of agents that have opened each protocol
         //
 
-        Status = refit_call4_wrapper(gBS->OpenProtocolInformation,
+        Status = refit_call4_wrapper(BS->OpenProtocolInformation,
                       (*HandleBuffer)[HandleIndex],
                       ProtocolGuidArray[ProtocolIndex],
                       &OpenInfo,
diff --git a/refind/driver_support.h b/refind/driver_support.h
new file mode 100644 (file)
index 0000000..5e09945
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * File to implement LibScanHandleDatabase(), which is used by rEFInd's
+ * driver-loading code (inherited from rEFIt), but which has not been
+ * implemented in GNU-EFI and seems to have been dropped from current
+ * versions of the Tianocore library. This function was taken from a git
+ * site with EFI code. The original file bore the following copyright
+ * notice:
+ *
+ * Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+ * This program and the accompanying materials are licensed and made available under
+ * the terms and conditions of the BSD License that accompanies this distribution.
+ * The full text of the license may be found at
+ * http://opensource.org/licenses/bsd-license.php.
+ *
+ * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ *
+ */
+
+#include <efi/efi.h>
+#include <efi/efilib.h>
+
+#ifndef _MY_SCAN_HANDLE_DATABASE
+#define _MY_SCAN_HANDLE_DATABASE
+
+// Below is from http://git.etherboot.org/?p=mirror/efi/shell/.git;a=commitdiff;h=b1b0c63423cac54dc964c2930e04aebb46a946ec;
+// Seems to have been replaced by ParseHandleDatabaseByRelationshipWithType(), but the latter isn't working for me....
+EFI_STATUS
+LibScanHandleDatabase (
+  EFI_HANDLE  DriverBindingHandle, OPTIONAL
+  UINT32      *DriverBindingHandleIndex, OPTIONAL
+  EFI_HANDLE  ControllerHandle, OPTIONAL
+  UINT32      *ControllerHandleIndex, OPTIONAL
+  UINTN       *HandleCount,
+  EFI_HANDLE  **HandleBuffer,
+  UINT32      **HandleType
+  );
+
+
+#define EFI_HANDLE_TYPE_UNKNOWN                     0x000
+#define EFI_HANDLE_TYPE_IMAGE_HANDLE                0x001
+#define EFI_HANDLE_TYPE_DRIVER_BINDING_HANDLE       0x002
+#define EFI_HANDLE_TYPE_DEVICE_DRIVER               0x004
+#define EFI_HANDLE_TYPE_BUS_DRIVER                  0x008
+#define EFI_HANDLE_TYPE_DRIVER_CONFIGURATION_HANDLE 0x010
+#define EFI_HANDLE_TYPE_DRIVER_DIAGNOSTICS_HANDLE   0x020
+#define EFI_HANDLE_TYPE_COMPONENT_NAME_HANDLE       0x040
+#define EFI_HANDLE_TYPE_DEVICE_HANDLE               0x080
+#define EFI_HANDLE_TYPE_PARENT_HANDLE               0x100
+#define EFI_HANDLE_TYPE_CONTROLLER_HANDLE           0x200
+#define EFI_HANDLE_TYPE_CHILD_HANDLE                0x400
+
+#endif
index 2b2d78cdb29249209c1d123873061883fdc4f6cf..41feccc3ff29376efd4779ca7a9d010ba821943e 100644 (file)
@@ -49,7 +49,7 @@
 #include "icns.h"
 #include "menu.h"
 #include "refit_call_wrapper.h"
-#include "bootsvcs.h"
+#include "driver_support.h"
 #include "../include/syslinux_mbr.h"
 
 // 
@@ -1001,7 +1001,7 @@ static LEGACY_ENTRY * AddLegacyEntry(IN CHAR16 *LoaderTitle, IN REFIT_VOLUME *Vo
     SubEntry->Volume          = Entry->Volume;
     SubEntry->LoadOptions     = Entry->LoadOptions;
     AddMenuEntry(SubScreen, (REFIT_MENU_ENTRY *)SubEntry);
-    
+
     AddMenuEntry(SubScreen, &MenuEntryReturn);
     Entry->me.SubScreen = SubScreen;
     AddMenuEntry(&MainMenu, (REFIT_MENU_ENTRY *)Entry);
@@ -1159,7 +1159,7 @@ static EFI_STATUS ConnectAllDriversToAllControllers(VOID)
     // GNU EFI's EFI_BOOT_SERVICES data structure is truncated, but all the
     // items are in memory, so point a more complete data structure to it
     // so that we can use items not in GNU EFI's implementation....
-    gBS = (MY_BOOT_SERVICES*) BS;
+//    gBS = (MY_BOOT_SERVICES*) BS;
 
     Status = LibLocateHandle(AllHandles,
                              NULL,
@@ -1198,7 +1198,7 @@ static EFI_STATUS ConnectAllDriversToAllControllers(VOID)
 
             if (!Parent) {
                 if (HandleType[Index] & EFI_HANDLE_TYPE_DEVICE_HANDLE) {
-                   Status = refit_call4_wrapper(gBS->ConnectController,
+                   Status = refit_call4_wrapper(BS->ConnectController,
                                                 AllHandleBuffer[Index],
                                                 NULL,
                                                 NULL,