]> code.delx.au - refind/commitdiff
Version 0.3.0 (beta) release. Adds "resolution" option to refind.conf.
authorsrs5694 <srs5694@users.sourceforge.net>
Sun, 22 Apr 2012 19:54:00 +0000 (15:54 -0400)
committersrs5694 <srs5694@users.sourceforge.net>
Sun, 22 Apr 2012 19:54:00 +0000 (15:54 -0400)
22 files changed:
NEWS.txt
docs/refind/bootmode.html
docs/refind/configfile.html
docs/refind/drivers.html
docs/refind/features.html
docs/refind/getting.html
docs/refind/index.html
docs/refind/installing.html
docs/refind/linux.html
docs/refind/revisions.html
docs/refind/themes.html
docs/refind/todo.html
docs/refind/using.html
libeg/efiGraphicsOutput.h [deleted file]
libeg/image.c
libeg/libegint.h
libeg/screen.c
refind.conf-sample
refind/config.c
refind/global.h
refind/main.c
refind/screen.c

index 36fb2fb09f0c250bf29fcc53dbe7fb1984914430..2947edfc0317a34a2e06f9c49168b79efdbadc3f 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,6 +1,27 @@
-0.2.8 (?/??/2012):
+0.3.0 (?/??/2012):
 ------------------
 
+- I'm officially upgrading this project's status from "alpha" to "beta" and
+  giving it a bump from 0.2.x to 0.3.0. This doesn't reflect any major
+  milestone with this version; rather, it reflects my sense that rEFInd has
+  been "out there" for a while, and although I've gotten bug reports,
+  they've been minor and/or have been fixed. The program still has known
+  bugs, but my impression is that it is, overall, usable by ordinary users.
+
+- Added "resolution" option to refind.conf, which enables setting the video
+  resolution. To use it, pass two numeric values, as in "resolution 1024
+  768" to use a 1024x768 video mode. Note that not all modes are supported.
+  If you specify a non-supported video mode on a UEFI system, a message
+  appears listing the supported video modes and you must then press a key
+  to continue, using the default video mode (usually 800x600).
+  Unfortunately, I don't know the calls to get a list of supported video
+  modes on older EFI 1.x systems (including Macs), so on Macs setting an
+  incorrect video mode silently fails (you keep using the default mode).
+  This makes changing your video mode a hit-or-miss proposition on Macs.
+  CAUTION: It's possible to set a legal video mode that your monitor can't
+  handle, in which case you'll get a blank display until you boot an OS
+  that resets the video mode.
+
 - Fixed (maybe) a bug that caused rEFInd to crash when returning from an
   EFI shell or other programs on Macs, particularly when rEFInd used
   graphical mode. I'm not 100% sure this bug is squashed because I still
index f002cb885546682ebc5dc8420b62939265ee9f22..f7478e13e8cf713f81f70aa030f2c415022cdd4b 100644 (file)
@@ -14,7 +14,7 @@
   <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
+<p>Originally written: 3/14/2012; last Web page update: 4/22/2012, referencing rEFInd 0.3.0</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
index 354349e67e1757606fe6665c1c1fe1c38fc61802..b43819d6fbca72b99c5ee2e48e119766c056e062 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/19/2012, referencing rEFInd 0.2.7</p>
+  <p>Originally written: 3/14/2012; last Web page update: 4/22/2012, referencing rEFInd 0.3.0</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>resolution</tt></td>
+   <td>Two integer values</td>
+   <td>Sets the video resolution used by rEFInd; takes a width and a height as options. For instance, <tt>resolution 1024 768</tt> sets the resolution to 1024x768. If you set a resolution that doesn't work on a UEFI-based system, rEFInd displays a message along with a list of valid modes. On an system built around EFI 1.<i>x</i> (such as a Mac), setting an incorrect resolution fails silently; you'll get the system's default resolution. You'll also get the system's default resolution if you set either resolution value to <tt>0</tt> or if you pass anything but two numbers. (Note that passing a resolution with an <tt>x</tt>, as in <tt>1024x768</tt>, will be interpreted as <i>one</i> option and so will cause the default resolution to be used.) Also, be aware that it is possible to set a valid resolution for your video card that's invalid for your monitor. If you do this, your monitor will go blank until you've booted an OS that resets the video mode.</td>
+</tr>
 <tr>
    <td><tt>scan_driver_dirs</tt></td>
    <td>directory path(s)</td>
@@ -216,7 +221,7 @@ default_selection elilo
 
 <h2>Creating OS Stanzas</h2>
 
-<p>OS stanzas in rEFInd are similar to those in GRUB Legacy, GRUB 2, or ELILO. You can use them to add configuration options to those that are auto-detected. You cannot modify the auto-detected options, though; if you just want to tweak one OS's configuration, you has several options, none of which is ideal:</p>
+<p>OS stanzas in rEFInd are similar to those in GRUB Legacy, GRUB 2, or ELILO. You can use them to add configuration options to those that are auto-detected. You cannot modify the auto-detected options, though; if you just want to tweak one OS's configuration, you have several options, none of which is ideal:</p>
 
 <ul>
 
index 8f09ae5b409e6cb40064b1c01391f47cba134046..60dead38d2c6ebc6f3307dac26a9ca27006aedc1 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: 4/19/2012; last Web page update: 4/19/2012, referencing rEFInd 0.2.7</p>
+  <p>Originally written: 4/19/2012; last Web page update: 4/22/2012, referencing rEFInd 0.3.0</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>
@@ -149,7 +149,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>The Clover EFI Tools ext2fs driver performs much like the rEFIt ext2fs driver, but it doesn't deliver a filesystem label, which makes it less desirable. The NTFS driver from this package is nice and speedy, though, so if for some reason you need to place a boot loader on an NTFS volume, this driver might be worth tracking down.</p>
 
-<p>Although both ext2fs and ReiserFS are case-sensitive, these drivers treat them in a case-insensitive way. Symbolic links work, which opens up possibilities for configuration, such as using a single kernel binary for multiple Linux distributions, with a link in one subdirectory pointing to a file in another directory. (If you try this, though, be sure to use <i>relative</t> links, as in <tt>../otherdist/bzImage.efi</tt>, at least if the partition is not Linux's root filesystem.)</p>
+<p>Although both ext2fs and ReiserFS are case-sensitive, these drivers treat them in a case-insensitive way. Symbolic links work, which opens up possibilities for configuration, such as using a single kernel binary for multiple Linux distributions, with a link in one subdirectory pointing to a file in another directory. (If you try this, though, be sure to use <i>relative</i> links, as in <tt>../otherdist/bzImage.efi</tt>, at least if the partition is not Linux's root filesystem.)</p>
 
 </ul>
 
index bb28a916d3795f1a25413521c028d9622fff15c8..3d3fb05e3b2e996a6f9b22d64c23c01b4620502b 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/19/2012, referencing rEFInd 0.2.7</p>
+<p>Originally written: 3/14/2012; last Web page update: 4/22/2012, referencing rEFInd 0.3.0</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>
 
@@ -128,6 +128,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <li>The ability to specify additional directories to scan for boot loaders and drivers (as of version 0.2.7).</li>
 
+<li>The ability to set the screen's resolution, within limits imposed by the EFI (as of rEFInd 0.3.0).</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>
index 2899079b6afd97c59c8eda7e4f77b7871795bf49..da91a3f91feca90022af02834cf153c6d407c016 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/19/2012, referencing rEFInd 0.2.7</p>
+  <p>Originally written: 3/14/2012; last Web page update: 4/22/2012, referencing rEFInd 0.3.0</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>
 
@@ -88,7 +88,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <hr />
 
-<p><b>Note:</b> I consider rEFInd to be <i>alpha-quality software!</i> Although rEFIt 0.14, upon which rEFInd is based, is beta-quality, I've changed a great deal of the code, and I'm still learning about it. I'm discovering bugs (old and new) and fixing them every day or two. That said, rEFInd is a usable program in its current form on many systems. If you have problems, feel free to drop me a line.</p>
+<p><b>Note:</b> I consider rEFInd to be <i>beta-quality software!</i> I'm discovering bugs (old and new) and fixing them every few days. That said, rEFInd is a usable program in its current form on many systems. If you have problems, feel free to drop me a line.</p>
 
 <h2>Getting rEFInd from Sourceforge</h2>
 
@@ -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.7/refind-src-0.2.7.zip/download">A
+<li><b><a href="http://sourceforge.net/projects/refind/files/0.3.0/refind-src-0.3.0.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.7/refind-bin-0.2.7.zip/download">A
+<li><b><a href="http://sourceforge.net/projects/refind/files/0.3.0/refind-bin-0.3.0.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
@@ -113,7 +113,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
     described on the <a href="installing.html">Installing rEFInd</a> page.</li>
 
 <li><b><a
-    href="http://sourceforge.net/projects/refind/files/0.2.7/refind-cd-0.2.7.zip/download">A
+    href="http://sourceforge.net/projects/refind/files/0.3.0/refind-cd-0.3.0.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
index 5032ac0cb5dbb4ac0e330bad124807fc8f629eee..be0e0d9180023a4a4d82e36381d7b1758a515369 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/19/2012, referencing rEFInd 0.2.7</p>
+  <p>Originally written: 3/14/2012; last Web page update: 4/22/2012, referencing rEFInd 0.3.0</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>
@@ -129,7 +129,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 </ul>
 
-<p><b>Note:</b> I consider rEFInd to be <i>alpha-quality software!</i> Although rEFIt 0.14, upon which rEFInd is based, is beta-quality, I've changed a great deal of the code, and I'm still learning about it. I'm discovering bugs (old and new) and fixing them every day or two. That said, rEFInd is a usable program in its current form on many systems. If you have problems, feel free to drop me a line.</p>
+<p><b>Note:</b> I consider rEFInd to be <i>beta-quality software!</i> I'm discovering bugs (old and new) and fixing them every few days. That said, rEFInd is a usable program in its current form on many systems. If you have problems, feel free to drop me a line.</p>
 
 <a name="references">
 <h2>References and Additional Information</h2>
@@ -149,6 +149,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <li>My own <a href="http://www.rodsbooks.com/efi-bootloaders/">EFI Boot Loaders for Linux</a> page provides information on installing and configuring several common Linux EFI boot loaders and boot managers.</li>
 
+<li>Phoenix Technologies maintains a <a href="http://wiki.phoenix.com/wiki/index.php/Main_Page">wiki on EFI topics,</a> including <a href="http://wiki.phoenix.com/wiki/index.php/Category:UEFI_2.0">information on many EFI system calls</a> useful to programmers.</li>
+
 </ul></li> <!-- Informational Web pages -->
 
 <li><b>Additional programs</b>
index 2209f88cbaf30ce0ea5d9d16a6ebbb7fa44945a9..e7dcaef612ae3b9143aaf9a5c3c4fc14f77eab99 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/19/2012, referencing rEFInd 0.2.7</p>
+  <p>Originally written: 3/14/2012; last Web page update: 4/22/2012, referencing rEFInd 0.3.0</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 a2df4316779cc66b689af88693882c59fc5292bb..9232a3beace159581bf16da557d44eeaf3f04efc 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/19/2012; last Web page update: 4/19/2012, referencing rEFInd 0.2.7</p>
+<p>Originally written: 3/19/2012; last Web page update: 4/22/2012, referencing rEFInd 0.3.0</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 788d8f6673d59172bac74eadda790e87109d3ebd..8b53c10b455a6672ac5cbd1cf3684fcc4556a8b1 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>Last Web page update: 4/19/2012</p>
+<p>Last Web page update: 4/22/2012</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>
@@ -93,6 +93,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <ul>
 
+<li><b>0.3.0 (4/22/2012)</b>&mdash;This version marks the official transition from alpha to beta status for rEFInd. This isn't because of any important objective milestone being passed; it's just that rEFInd has been used by many people who have reported no show-stopping bugs, so I'm now confident that rEFInd is stable enough for general use. That's not to say it's perfect; it still has numerous <a href="todo.html">known bugs and limitations.</a> That's why it's still beta. To get down to specifics, this version adds two new configuration file tokens: <tt>resolution</tt>, which sets the screen resolution; and <tt>scan_all_linux_kernels</tt>, which adds Linux kernel files to the boot loader list even if they lack <tt>.efi</tt> filename extensions. See the <a href="configfile.html">Configuring the Boot Manager</a> page for details on these new options. I've also fixed some bugs: One that sometimes caused Macs to crash when returning from the EFI shell or other programs; another that caused rEFInd to fail to scan filesystems if the filesystem driver didn't return a volume name; and a third that caused rEFInd to fail to detect boot loaders depending on the case of the filename on some EFIs (this is really a workaround for an EFI implementation bug). The first of these is a <i>very</i> tentative fix and it could have negative effects on some systems (non-Mac EFI 1.x systems or Macs that weren't affected by the bug in other recent releases), so be sure to <a href="mailto:rodsmith@rodsbooks.com">contact me</a> if rEFInd crashes or otherwise misbehaves after you use an EFI shell.</li>
+
 <li><b>0.2.7 (4/19/2012)</b>&mdash;I've added two new tokens to the <tt>refind.conf</tt> file, with associated new functionality. The new <tt>scan_driver_dirs</tt> option tells rEFInd where to scan for EFI drivers, in addition to the default of the <tt>drivers</tt> subdirectory of the rEFInd installation directory. For more on EFI drivers, see <a href="drivers.html">Using EFI Drivers.</a> Note that previous versions of rEFInd couldn't load drivers at all, although they could make use of hardware and filesystems activated by drivers loaded before rEFInd launched. The second new token is <tt>also_scan_dirs</tt>, which adds arbitrary directories to the list that rEFInd scans for boot loaders. (Without this option, rEFInd scans each volume's boot directory and every subdirectory of the <tt>/EFI</tt> directory, with the exception of <tt>/EFI/tools</tt> and rEFInd's own directory.) This version also fixes a minor bug that caused rEFInd to sometimes include itself in the list of OS options. Finally, if you build rEFInd yourself, you should be aware that it now requires a newer version of the GNU-EFI library than it required in the past. See the <tt>BUILDING.txt</tt> file, included in the source code package, for details.</li>
 
 <li><b>0.2.6 (4/14/2012)</b>&mdash;This version provides one bug fix and one new feature. The bug was introduced in version 0.2.5 and prevents rEFInd from identifying a Linux initial RAM disk file on some (but not all) EFI implementations. The new feature is the <tt>volume</tt> stanza token, which enables you to manually load a boot program from a filesystem other than the one from which rEFInd launched. You can specify a volume either by its label (as in <tt>volume KERNELS</tt> to load from the volume with a filesystem name <tt>KERNELS</tt>) or by number followed by a colon (as in <tt>volume 0:</tt> for the first filesystem or <tt>volume 1:</tt> for the second). See the <a href="configfile.html">Configuring the Boot Manager</a> page for more on this new feature.</li>
index 9e6ed3220bddc351caac6094d8b869a41a24c13c..2049bba3224bd437080174c437d22b6f6d693d67 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: 4/19/2012; last Web page update: 4/19/2012, referencing rEFInd 0.2.7</p>
+  <p>Originally written: 4/19/2012; last Web page update: 4/22/2012, referencing rEFInd 0.3.0</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 21e07382239870ad43233785b199e6f998abdb31..09e78eaf78d1f8b24da1ebfded366253fe5f550e 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/19/2012, referencing rEFInd 0.2.7</p>
+  <p>Originally written: 3/14/2012; last Web page update: 4/22/2012, referencing rEFInd 0.3.0</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>
@@ -97,7 +97,9 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <ul>
 
-<li>Testing! rEFIt was complex enough that changes such as the ones I've made have the potential to disrupt the program's operation in unexpected ways. I can only test on a handful of systems with a limited number of configurations. Therefore, if you try rEFInd and run into bugs, please report them to me!</li>
+<li>Testing! rEFIt was complex enough that changes such as the ones I've made have the potential to disrupt the program's operation in unexpected ways. Since the initial 0.2.0 release, I've continued to add features to rEFInd, and every new feature is another way for bugs to get into the program. I can only test on a handful of systems with a limited number of configurations. Therefore, if you try rEFInd and run into bugs, please report them to me!</li>
+
+<li>Currently, rEFInd can detect whether it's compiled for <i>x</i>86 or <i>x</i>86-64 systems and displays this information in its "About" screen (AboutrEFInd() in main.c). I'd like to add detection for Itanium and ARM systems, but I have no way to test such changes.</li>
 
 <li>I have little talent with graphics manipulation programs, so rEFInd's boot logo, such as it is, is pretty weak. If you have artistic talent and would like to create a rEFInd logo, please feel free to send it to me. I won't make any final decision about changes until at least June 30 of 2012.</li>
 
@@ -111,7 +113,7 @@ them on the project's Sourceforge page). For more information on designing theme
 
 <li>The code could be more flexible in its handling of the sizes of various graphical elements, and particularly drawn text. Prior to version 0.2.2, submenu text was invisible on UEFI-based PCs with 800x600 and smaller displays because of an inability to properly crop the graphics fields that hold the text. With version 0.2.2, I've put a band-aid on this problem by reducing the field size so that it now works on 800x600 displays, but smaller displays still suffer from this problem. This is just an example of the inflexibility of certain layout issues within rEFInd.</li>
 
-<li>I'd like to add a configuration option to set the screen resolution. Many computers seem to default to 800x600, even when the hardware can handle much higher resolutions. A higher resolution would enable fitting more OS tags on the screen at once. I haven't yet looked into the system calls that would enable such changes.</li>
+<li>Text mode has a known display glitch: Not all loaders are shown until you use the cursor keys to move down the list, effectively "drawing" the "invisible" tags. This obviously needs to be fixed.</li>
 
 <li>Although the ICNS file format used by rEFInd supports multiple image sizes, if a size that rEFInd needs isn't present in the file, rEFInd can't use the icon. The ability to scale images to the desired size would be useful.</li>
 
@@ -123,11 +125,9 @@ them on the project's Sourceforge page). For more information on designing theme
 
 <li>There's currently no way to create a manual boot stanza for a BIOS-booted OS. This isn't a big priority for me personally, but I can see how it could be for some people.</li>
 
-<li>I'd like to find a way to get rEFInd to launch BIOS boot loaders on UEFI-based systems. This option currently works only on Macs&mdash;or at least, I've not gotten it to work on any of my UEFI-based PCs.</li>
-
-<li>Returning from a program (such as an EFI shell or a boot loader that fails) produces an error message about a failure when "(re)opening our installation volume" on some computers. (Among mine, only a 32-bit Mac Mini produces this message.) In some cases, rEFInd then hangs. I don't fully understand its cause or why it doesn't appear on most systems. This needs investigating and fixing.</li>
+<li>I'd like to find a way to get rEFInd to launch BIOS boot loaders on UEFI-based systems. This option currently works only on Macs&mdash;or at least, I've not gotten it to work on any of my UEFI-based PCs. (I have an idea about this, but haven't yet investigated it in detail. If you'd like to help on this, <a href="mailto:rodsmith@rodsbooks.com">e-mail me</a> for my thoughts.)</li>
 
-<li>The <a href="http://www.rodsbooks.com/gb-hybrid-efi/">Gigabyte Hybrid EFI</a> has a bug that causes the allegedly case-insensitive <tt>StriCmp()</tt> function to perform a case-sensitive comparison. This causes any number of bugs in file matching. For instance: Changing the case of icon filename extensions (or various other parts of icon filenames) causes icons to be replaced by ugly "generic" ones; rEFInd sometimes appears in its own menu (the firmware sometimes returns an all-caps version of the filename, but other times returns the filename with the correct case, causing a mismatch if the path includes lowercase elements); and boot loaders will not be detected if their filenames use uppercase <tt>.EFI</tt> extensions. Some of these problems can be overcome by converting both strings to be compared to one case before doing the comparison, but others aren't so easy, since I think <tt>StriCmp()</tt> is being called internally to the EFI. In any event, it'd be nice to fix some of these problems. OTOH, this is a workaround for a bug on just one EFI implementation, and a dismal one at that, so I'm inclined to just let it go.</li>
+<li>The <a href="http://www.rodsbooks.com/gb-hybrid-efi/">Gigabyte Hybrid EFI</a> has a bug that causes the allegedly case-insensitive <tt>StriCmp()</tt> function to perform a case-sensitive comparison. This causes any number of bugs in file matching. For instance: Changing the case of icon filename extensions (or various other parts of icon filenames) causes icons to be replaced by ugly "generic" ones; and rEFInd sometimes appears in its own menu (the firmware sometimes returns an all-caps version of the filename, but other times returns the filename with the correct case, causing a mismatch if the path includes lowercase elements). Some of these problems can be overcome by converting both strings to be compared to one case before doing the comparison, but others aren't so easy, since I think <tt>StriCmp()</tt> is being called internally to the EFI. In any event, it'd be nice to fix some of these problems. OTOH, this is a workaround for a bug on just one EFI implementation, and a dismal one at that, so I'm inclined to just let it go.</li>
 
 <li>I've received queries about rEFInd's ability to work with Apple's whole-disk encryption scheme that's new with OS X 10.7. Unfortunately, I lack the hardware to test this.</li>
 
@@ -135,6 +135,8 @@ them on the project's Sourceforge page). For more information on designing theme
 
 <li>I'd like to find a way to enable users to enter customizations for boot options and then save them to the <tt>refind.conf</tt> file.</li>
 
+<li>Auto-detected boot loaders are currently displayed in an arbitrary order, aside from the crude internal/external/optical distinctions, which can be affected by the order of options in <tt>scanfor</tt>. I'd like to sort entries by file timestamp within each directory, with the newest entry first. This will be beneficial because using the directory name as the entry in <tt>default_selection</tt> will then return the most recent boot loader in that directory, which is most likely the desired result when you upgrade a Linux kernel with an EFI stub loader. (As it is, to guarantee use of the most recent kernel, you must update <tt>refind.conf</tt>.) There might also be other ways to sort entries to some beneficial end, but I haven't thought of any.</li>
+
 <li>It should be possible to override specific auto-detected boot loader settings&mdash;say, to disable one specific boot loader or change its icon.</li>
 
 <li>A way to read boot options set via <tt>efibootmgr</tt>, <tt>bless</tt>, or similar options from NVRAM to add to the boot set would be useful.</li>
index d1999f1520e12f2851ab93083a0e93672f69cd24..d9f527a614f81b884d525244d6b8bccf02cb589f 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/19/2012, referencing rEFInd 0.2.7</p>
+  <p>Originally written: 3/14/2012; last Web page update: 4/22/2012, referencing rEFInd 0.3.0</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>
diff --git a/libeg/efiGraphicsOutput.h b/libeg/efiGraphicsOutput.h
deleted file mode 100644 (file)
index 7f80094..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-/*++\r
-\r
-Copyright (c) 2006, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
-\r
-Module Name:\r
-\r
-  GraphicsOutput.h\r
-\r
-Abstract:\r
-\r
-  Graphics Output Protocol from the UEFI 2.0 specification.\r
-\r
-  Abstraction of a very simple graphics device.\r
-\r
---*/\r
-\r
-#ifndef __GRAPHICS_OUTPUT_H__\r
-#define __GRAPHICS_OUTPUT_H__\r
-\r
-#include <efiUgaDraw.h>\r
-\r
-#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \\r
-  { \\r
-    0x9042a9de, 0x23dc, 0x4a38, 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a \\r
-  }\r
-\r
-/* typedef struct _EFI_GRAPHICS_OUTPUT_PROTOCOL EFI_GRAPHICS_OUTPUT_PROTOCOL; */\r
-struct _EFI_GRAPHICS_OUTPUT_PROTOCOL;\r
-\r
-typedef struct {\r
-  UINT32            RedMask;\r
-  UINT32            GreenMask;\r
-  UINT32            BlueMask;\r
-  UINT32            ReservedMask;\r
-} EFI_PIXEL_BITMASK;\r
-\r
-typedef enum {\r
-  PixelRedGreenBlueReserved8BitPerColor,\r
-  PixelBlueGreenRedReserved8BitPerColor,\r
-  PixelBitMask,\r
-  PixelBltOnly,\r
-  PixelFormatMax\r
-} EFI_GRAPHICS_PIXEL_FORMAT;\r
-\r
-typedef struct {\r
-  UINT32                     Version;\r
-  UINT32                     HorizontalResolution;\r
-  UINT32                     VerticalResolution;\r
-  EFI_GRAPHICS_PIXEL_FORMAT  PixelFormat;\r
-  EFI_PIXEL_BITMASK          PixelInformation;\r
-  UINT32                     PixelsPerScanLine;\r
-} EFI_GRAPHICS_OUTPUT_MODE_INFORMATION;\r
-\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE) (\r
-  IN  struct _EFI_GRAPHICS_OUTPUT_PROTOCOL  *This,\r
-  IN  UINT32                                ModeNumber,\r
-  OUT UINTN                                 *SizeOfInfo,\r
-  OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION  **Info\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Return the current video mode information.\r
-\r
-  Arguments:\r
-    This                  - Protocol instance pointer.\r
-    ModeNumber            - The mode number to return information on.\r
-    SizeOfInfo            - A pointer to the size, in bytes, of the Info buffer.\r
-    Info                  - A pointer to callee allocated buffer that returns information about ModeNumber.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - Mode information returned.\r
-    EFI_DEVICE_ERROR      - A hardware error occurred trying to retrieve the video mode.\r
-    EFI_NOT_STARTED       - Video display is not initialized. Call SetMode () \r
-    EFI_INVALID_PARAMETER - One of the input args was NULL.\r
-\r
---*/\r
-;\r
-\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE) (\r
-  IN  struct _EFI_GRAPHICS_OUTPUT_PROTOCOL * This,\r
-  IN  UINT32                       ModeNumber\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Return the current video mode information.\r
-\r
-  Arguments:\r
-    This             - Protocol instance pointer.\r
-    ModeNumber       - The mode number to be set.\r
-\r
-  Returns:\r
-    EFI_SUCCESS      - Graphics mode was changed.\r
-    EFI_DEVICE_ERROR - The device had an error and could not complete the request.\r
-    EFI_UNSUPPORTED  - ModeNumber is not supported by this device.\r
-\r
---*/\r
-;\r
-\r
-typedef EFI_UGA_PIXEL EFI_GRAPHICS_OUTPUT_BLT_PIXEL;\r
-\r
-typedef union {\r
-  EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel;\r
-  UINT32                        Raw;\r
-} EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION;\r
-\r
-typedef enum {\r
-  EfiBltVideoFill,\r
-  EfiBltVideoToBltBuffer,\r
-  EfiBltBufferToVideo, \r
-  EfiBltVideoToVideo,\r
-  EfiGraphicsOutputBltOperationMax\r
-} EFI_GRAPHICS_OUTPUT_BLT_OPERATION;\r
-\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT) (\r
-  IN  struct _EFI_GRAPHICS_OUTPUT_PROTOCOL    * This,\r
-  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL           * BltBuffer, OPTIONAL\r
-  IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION       BltOperation,\r
-  IN  UINTN                                   SourceX,\r
-  IN  UINTN                                   SourceY,\r
-  IN  UINTN                                   DestinationX,\r
-  IN  UINTN                                   DestinationY,\r
-  IN  UINTN                                   Width,\r
-  IN  UINTN                                   Height,\r
-  IN  UINTN                                   Delta         OPTIONAL\r
-  );\r
-\r
-/*++\r
-\r
-  Routine Description:\r
-    The following table defines actions for BltOperations:\r
-    EfiBltVideoFill - Write data from the  BltBuffer pixel (SourceX, SourceY) \r
-      directly to every pixel of the video display rectangle \r
-      (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). \r
-      Only one pixel will be used from the BltBuffer. Delta is NOT used.\r
-    EfiBltVideoToBltBuffer - Read data from the video display rectangle \r
-      (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in \r
-      the BltBuffer rectangle (DestinationX, DestinationY ) \r
-      (DestinationX + Width, DestinationY + Height). If DestinationX or \r
-      DestinationY is not zero then Delta must be set to the length in bytes \r
-      of a row in the BltBuffer.\r
-    EfiBltBufferToVideo - Write data from the  BltBuffer rectangle \r
-      (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the \r
-      video display rectangle (DestinationX, DestinationY) \r
-      (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is \r
-      not zero then Delta must be set to the length in bytes of a row in the \r
-      BltBuffer.\r
-    EfiBltVideoToVideo - Copy from the video display rectangle (SourceX, SourceY)\r
-     (SourceX + Width, SourceY + Height) .to the video display rectangle \r
-     (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). \r
-     The BltBuffer and Delta  are not used in this mode.\r
-\r
-  Arguments:\r
-    This          - Protocol instance pointer.\r
-    BltBuffer     - Buffer containing data to blit into video buffer. This \r
-                    buffer has a size of Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL)\r
-    BltOperation  - Operation to perform on BlitBuffer and video memory\r
-    SourceX       - X coordinate of source for the BltBuffer.\r
-    SourceY       - Y coordinate of source for the BltBuffer.\r
-    DestinationX  - X coordinate of destination for the BltBuffer.\r
-    DestinationY  - Y coordinate of destination for the BltBuffer.\r
-    Width         - Width of rectangle in BltBuffer in pixels.\r
-    Height        - Hight of rectangle in BltBuffer in pixels.\r
-    Delta         -\r
-  \r
-  Returns:\r
-    EFI_SUCCESS           - The Blt operation completed.\r
-    EFI_INVALID_PARAMETER - BltOperation is not valid.\r
-    EFI_DEVICE_ERROR      - A hardware error occured writting to the video \r
-                             buffer.\r
-\r
---*/\r
-;\r
-\r
-typedef struct {\r
-  UINT32                                 MaxMode;\r
-  UINT32                                 Mode;\r
-  EFI_GRAPHICS_OUTPUT_MODE_INFORMATION   *Info;\r
-  UINTN                                  SizeOfInfo;\r
-  EFI_PHYSICAL_ADDRESS                   FrameBufferBase;\r
-  UINTN                                  FrameBufferSize;\r
-} EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE;\r
-\r
-typedef struct _EFI_GRAPHICS_OUTPUT_PROTOCOL {\r
-  EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE  QueryMode;\r
-  EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE    SetMode;\r
-  EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT         Blt;\r
-  EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE        *Mode;\r
-} EFI_GRAPHICS_OUTPUT_PROTOCOL;\r
-\r
-extern EFI_GUID gEfiGraphicsOutputProtocolGuid;\r
-\r
-#endif\r
index 27671951548389ca0a40a0801b29a1a4818cc6fd..4dac964bdbb4fb1f4564096a023db48b765949f2 100644 (file)
@@ -153,7 +153,7 @@ static EFI_STATUS egFindESP(OUT EFI_FILE_HANDLE *RootDir)
     EFI_STATUS          Status;
     UINTN               HandleCount = 0;
     EFI_HANDLE          *Handles;
-    
+
     Status = LibLocateHandle(ByProtocol, &ESPGuid, NULL, &HandleCount, &Handles);
     if (!EFI_ERROR(Status) && HandleCount > 0) {
         *RootDir = LibOpenRoot(Handles[0]);
index 6bcdf1dcf66d52b58991df4d7c8a1c7f86284e9f..1b2cff82f5ae9c08f55f1fc148cb2835196d8ec4 100644 (file)
@@ -49,6 +49,8 @@ typedef EG_IMAGE * (*EG_DECODE_FUNC)(IN UINT8 *FileData, IN UINTN FileDataLength
 
 /* functions */
 
+BOOLEAN egSetScreenSize(IN UINTN ScreenWidth, IN UINTN ScreenHeight);
+
 VOID egRestrictImageArea(IN EG_IMAGE *Image,
                          IN UINTN AreaPosX, IN UINTN AreaPosY,
                          IN OUT UINTN *AreaWidth, IN OUT UINTN *AreaHeight);
index 1fa517a82e26675b064e3df701cbef3756d25aa7..a183578570be45b40a9922854682bb037d693451 100644 (file)
@@ -35,6 +35,7 @@
  */
 
 #include "libegint.h"
+#include "../refind/screen.h"
 #include "refit_call_wrapper.h"
 
 #include <efiUgaDraw.h>
@@ -62,7 +63,7 @@ static UINTN egScreenHeight = 600;
 
 VOID egInitScreen(VOID)
 {
-    EFI_STATUS Status;
+    EFI_STATUS Status = EFI_SUCCESS;
     UINT32 UGAWidth, UGAHeight, UGADepth, UGARefreshRate;
 
     // get protocols
@@ -96,6 +97,68 @@ VOID egInitScreen(VOID)
     }
 }
 
+// Sets the screen resolution to the specified value, if possible.
+// If the specified value is not valid, displays a warning with the valid
+// modes on UEFI systems, or silently fails on EFI 1.x systems. Note that
+// this function attempts to set ANY screen resolution, even 0x0 or
+// ridiculously large values.
+// Returns TRUE if successful, FALSE if not.
+BOOLEAN egSetScreenSize(IN UINTN ScreenWidth, IN UINTN ScreenHeight) {
+   EFI_STATUS Status = EFI_SUCCESS;
+   EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
+   UINT32 ModeNum = 0;
+   UINTN Size;
+   BOOLEAN ModeSet = FALSE;
+   UINT32 UGAWidth, UGAHeight, UGADepth, UGARefreshRate;
+
+   if (GraphicsOutput != NULL) { // GOP mode (UEFI)
+      // Do a loop through the modes to see if the specified one is available;
+      // and if so, switch to it....
+      while ((Status == EFI_SUCCESS) && (!ModeSet)) {
+         Status = refit_call4_wrapper(GraphicsOutput->QueryMode, GraphicsOutput, ModeNum, &Size, &Info);
+         if ((Status == EFI_SUCCESS) && (Size >= sizeof(*Info)) &&
+             (Info->HorizontalResolution == ScreenWidth) && (Info->VerticalResolution == ScreenHeight)) {
+            Status = refit_call2_wrapper(GraphicsOutput->SetMode, GraphicsOutput, ModeNum);
+            ModeSet = (Status == EFI_SUCCESS);
+         } // if
+         ModeNum++;
+      } // while()
+
+      if (ModeSet) {
+         egScreenWidth = ScreenWidth;
+         egScreenHeight = ScreenHeight;
+      } else {// If unsuccessful, display an error message for the user....
+         Print(L"Error setting mode %d x %d; using default mode!\nAvailable modes are:\n", ScreenWidth, ScreenHeight);
+         ModeNum = 0;
+         Status = EFI_SUCCESS;
+         while (Status == EFI_SUCCESS) {
+            Status = refit_call4_wrapper(GraphicsOutput->QueryMode, GraphicsOutput, ModeNum, &Size, &Info);
+            if ((Status == EFI_SUCCESS) && (Size >= sizeof(*Info))) {
+               Print(L"Mode %d: %d x %d\n", ModeNum, Info->HorizontalResolution, Info->VerticalResolution);
+            } // else
+            ModeNum++;
+         } // while()
+         PauseForKey();
+      } // if()
+   } else if (UgaDraw != NULL) { // UGA mode (EFI 1.x)
+      // Try to use current color depth & refresh rate for new mode. Maybe not the best choice
+      // in all cases, but I don't know how to probe for alternatives....
+      Status = refit_call5_wrapper(UgaDraw->GetMode, UgaDraw, &UGAWidth, &UGAHeight, &UGADepth, &UGARefreshRate);
+      Status = refit_call5_wrapper(UgaDraw->SetMode, UgaDraw, ScreenWidth, ScreenHeight, UGADepth, UGARefreshRate);
+      if (Status == EFI_SUCCESS) {
+         egScreenWidth = ScreenWidth;
+         egScreenHeight = ScreenHeight;
+         ModeSet = TRUE;
+      } else {
+         // TODO: Find a list of supported modes and display it.
+         // NOTE: Below doesn't actually appear unless we explicitly switch to text mode.
+         // This is just a placeholder until something better can be done....
+         Print(L"Error setting mode %d x %d; unsupported mode!\n");
+      } // if/else
+   } // if/else if
+   return (ModeSet);
+} // BOOLEAN egSetScreenSize()
+
 VOID egGetScreenSize(OUT UINTN *ScreenWidth, OUT UINTN *ScreenHeight)
 {
     if (ScreenWidth != NULL)
@@ -129,12 +192,12 @@ BOOLEAN egHasGraphicsMode(VOID)
 BOOLEAN egIsGraphicsModeEnabled(VOID)
 {
     EFI_CONSOLE_CONTROL_SCREEN_MODE CurrentMode;
-    
+
     if (ConsoleControl != NULL) {
         refit_call4_wrapper(ConsoleControl->GetMode, ConsoleControl, &CurrentMode, NULL, NULL);
         return (CurrentMode == EfiConsoleControlScreenGraphics) ? TRUE : FALSE;
     }
-    
+
     return FALSE;
 }
 
@@ -160,15 +223,15 @@ VOID egSetGraphicsModeEnabled(IN BOOLEAN Enable)
 VOID egClearScreen(IN EG_PIXEL *Color)
 {
     EFI_UGA_PIXEL FillColor;
-    
+
     if (!egHasGraphics)
         return;
-    
+
     FillColor.Red   = Color->r;
     FillColor.Green = Color->g;
     FillColor.Blue  = Color->b;
     FillColor.Reserved = 0;
-    
+
     if (GraphicsOutput != NULL) {
         // EFI_GRAPHICS_OUTPUT_BLT_PIXEL and EFI_UGA_PIXEL have the same
         // layout, and the header from TianoCore actually defines them
@@ -185,7 +248,7 @@ VOID egDrawImage(IN EG_IMAGE *Image, IN UINTN ScreenPosX, IN UINTN ScreenPosY)
 {
     if (!egHasGraphics)
         return;
-    
+
     if (Image->HasAlpha) {
         Image->HasAlpha = FALSE;
         egSetPlane(PLPTR(Image, a), 0, Image->Width * Image->Height);
index 26ee27b10911eb490610c05f2d45ac49f65540f5..882e437ab5fb2da70bdca23c1f0821cae94f931c 100644 (file)
@@ -45,6 +45,18 @@ timeout 20
 #
 #textonly
 
+# Set the screen's video resolution. Pass this option two values,
+# corresponding to the X and Y resolutions. Note that not all resolutions
+# are supported. On UEFI systems, passing an incorrect value results in a
+# message being shown on the screen to that effect, along with a list of
+# supported modes. On EFI 1.x systems (e.g., Macintoshes), setting an
+# incorrect mode silently fails. On both types of systems, setting an
+# incorrect resolution results in the default resolution being used.
+# A resolution of 1024x768 usually works, but higher values often don't.
+# Default is "0 0" (use the system default resolution, usually 800x600).
+#
+#resolution 1024 768
+
 # Which non-bootloader tools to show on the tools line, and in what
 # order to display them:
 #  shell     - the EFI shell
index f08d3dcd37648fc24b8549b58d67d9c4895c11cd..0a15cc6ebd7c485cab0a6c7bec29f0bc037a2bf6 100644 (file)
@@ -175,15 +175,15 @@ static CHAR16 *ReadLine(REFIT_FILE *File)
                 *q++ = *p++;
         }
         *q = 0;
-        
+
     } else if (File->Encoding == ENCODING_UTF16_LE) {
-        
+
         CHAR16 *p, *LineStart, *LineEnd;
-        
+
         p = File->Current16Ptr;
         if (p >= File->End16Ptr)
             return NULL;
-        
+
         LineStart = p;
         for (; p < File->End16Ptr; p++)
             if (*p == 13 || *p == 10)
@@ -193,19 +193,19 @@ static CHAR16 *ReadLine(REFIT_FILE *File)
             if (*p != 13 && *p != 10)
                 break;
         File->Current16Ptr = p;
-        
+
         LineLength = (UINTN)(LineEnd - LineStart) + 1;
         Line = AllocatePool(LineLength * sizeof(CHAR16));
         if (Line == NULL)
             return NULL;
-        
+
         for (p = LineStart, q = Line; p < LineEnd; )
             *q++ = *p++;
         *q = 0;
-        
+
     } else
         return NULL;   // unsupported encoding
-    
+
     return Line;
 }
 
@@ -410,6 +410,10 @@ VOID ReadConfig(VOID)
         } else if (StriCmp(TokenList[0], L"textonly") == 0) {
             GlobalConfig.TextOnly = TRUE;
 
+        } else if ((StriCmp(TokenList[0], L"resolution") == 0) && (TokenCount == 3)) {
+           GlobalConfig.RequestedScreenWidth = Atoi(TokenList[1]);
+           GlobalConfig.RequestedScreenHeight = Atoi(TokenList[2]);
+
         } else if (StriCmp(TokenList[0], L"scan_all_linux_kernels") == 0) {
            GlobalConfig.ScanAllLinux = TRUE;
 
index d4e8aaa29e13651191634bf69b43b62e1605f74d..2cd9b37dcc28e413d8de67092debe6524c7a2d67 100644 (file)
@@ -153,6 +153,8 @@ typedef struct {
 typedef struct {
    BOOLEAN     TextOnly;
    BOOLEAN     ScanAllLinux;
+   UINTN       RequestedScreenWidth;
+   UINTN       RequestedScreenHeight;
    UINTN       Timeout;
    UINTN       HideUIFlags;
    UINTN       MaxTags;     // max. number of OS entries to show simultaneously in graphics mode
index 03b53cc0fc4cc10a408702dbae55b705d6c50ad3..35c125afe26bd08678bfd09c67861030a5641c7a 100644 (file)
@@ -85,7 +85,7 @@ static REFIT_MENU_ENTRY MenuEntryExit     = { L"Exit rEFInd", TAG_EXIT, 1, 0, 0,
 static REFIT_MENU_SCREEN MainMenu       = { L"Main Menu", NULL, 0, NULL, 0, NULL, 0, L"Automatic boot" };
 static REFIT_MENU_SCREEN AboutMenu      = { L"About", NULL, 0, NULL, 0, NULL, 0, NULL };
 
-REFIT_CONFIG GlobalConfig = { FALSE, FALSE, 20, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL,
+REFIT_CONFIG GlobalConfig = { FALSE, FALSE, 0, 0, 20, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL,
                               {TAG_SHELL, TAG_ABOUT, TAG_SHUTDOWN, TAG_REBOOT, 0, 0, 0, 0, 0 }};
 
 //
@@ -96,7 +96,7 @@ static VOID AboutrEFInd(VOID)
 {
     if (AboutMenu.EntryCount == 0) {
         AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
-        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.2.7.3");
+        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.3.0");
         AddMenuInfoLine(&AboutMenu, L"");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith");
index fe57a23dca8597ef0a97208b41e5194e05592c5f..86407f4d18edacec730cfde53953e3c34459cbfd 100644 (file)
@@ -37,6 +37,7 @@
 #include "global.h"
 #include "screen.h"
 #include "config.h"
+#include "libegint.h"
 #include "refit_call_wrapper.h"
 
 #include "egemb_refind_banner.h"
@@ -73,10 +74,10 @@ static BOOLEAN haveError = FALSE;
 VOID InitScreen(VOID)
 {
     UINTN i;
-    
+
     // initialize libeg
     egInitScreen();
-    
+
     if (egHasGraphicsMode()) {
         egGetScreenSize(&UGAWidth, &UGAHeight);
         AllowGraphicsMode = TRUE;
@@ -85,23 +86,23 @@ VOID InitScreen(VOID)
         egSetGraphicsModeEnabled(FALSE);   // just to be sure we are in text mode
     }
     GraphicsScreenDirty = TRUE;
-    
+
     // disable cursor
     refit_call2_wrapper(ST->ConOut->EnableCursor, ST->ConOut, FALSE);
-    
+
     // get size of text console
     if (refit_call4_wrapper(ST->ConOut->QueryMode, ST->ConOut, ST->ConOut->Mode->Mode, &ConWidth, &ConHeight) != EFI_SUCCESS) {
         // use default values on error
         ConWidth = 80;
         ConHeight = 25;
     }
-    
+
     // make a buffer for a whole text line
     BlankLine = AllocatePool((ConWidth + 1) * sizeof(CHAR16));
     for (i = 0; i < ConWidth; i++)
         BlankLine[i] = ' ';
     BlankLine[i] = 0;
-    
+
     // show the banner (even when in graphics mode)
     DrawScreenHeader(L"Initializing...");
 }
@@ -112,10 +113,15 @@ VOID SetupScreen(VOID)
         // switch to text mode if requested
         AllowGraphicsMode = FALSE;
         SwitchToText(FALSE);
-        
+
     } else if (AllowGraphicsMode) {
         // clear screen and show banner
         // (now we know we'll stay in graphics mode)
+        if ((GlobalConfig.RequestedScreenWidth > 0) && (GlobalConfig.RequestedScreenHeight > 0) &&
+            egSetScreenSize(GlobalConfig.RequestedScreenWidth, GlobalConfig.RequestedScreenHeight)) {
+              UGAWidth = GlobalConfig.RequestedScreenWidth;
+              UGAHeight = GlobalConfig.RequestedScreenHeight;
+        } // if user requested a particular screen resolution
         SwitchToGraphics();
         BltClearScreen(TRUE);
     }
@@ -143,7 +149,7 @@ VOID BeginTextScreen(IN CHAR16 *Title)
 {
     DrawScreenHeader(Title);
     SwitchToText(FALSE);
-    
+
     // reset error flag
     haveError = FALSE;
 }
@@ -154,7 +160,7 @@ VOID FinishTextScreen(IN BOOLEAN WaitAlways)
         SwitchToText(FALSE);
         PauseForKey();
     }
-    
+
     // reset error flag
     haveError = FALSE;
 }
@@ -163,18 +169,18 @@ VOID BeginExternalScreen(IN BOOLEAN UseGraphicsMode, IN CHAR16 *Title)
 {
     if (!AllowGraphicsMode)
         UseGraphicsMode = FALSE;
-    
+
     if (UseGraphicsMode) {
         SwitchToGraphics();
         BltClearScreen(FALSE);
     }
-    
+
     // show the header
     DrawScreenHeader(Title);
-    
+
     if (!UseGraphicsMode)
         SwitchToText(TRUE);
-    
+
     // reset error flag
     haveError = FALSE;
 }
@@ -183,12 +189,12 @@ VOID FinishExternalScreen(VOID)
 {
     // make sure we clean up later
     GraphicsScreenDirty = TRUE;
-    
+
     if (haveError) {
         SwitchToText(FALSE);
         PauseForKey();
     }
-    
+
     // reset error flag
     haveError = FALSE;
 }
@@ -236,7 +242,7 @@ static BOOLEAN ReadAllKeyStrokes(VOID)
     BOOLEAN       GotKeyStrokes;
     EFI_STATUS    Status;
     EFI_INPUT_KEY key;
-    
+
     GotKeyStrokes = FALSE;
     for (;;) {
         Status = refit_call2_wrapper(ST->ConIn->ReadKeyStroke, ST->ConIn, &key);
@@ -259,10 +265,10 @@ VOID PauseForKey(VOID)
         refit_call1_wrapper(BS->Stall, 5000000);     // 5 seconds delay
         ReadAllKeyStrokes();    // empty the buffer again
     }
-    
+
     refit_call3_wrapper(BS->WaitForEvent, 1, &ST->ConIn->WaitForKey, &index);
     ReadAllKeyStrokes();        // empty the buffer to protect the menu
-    
+
     Print(L"\n");
 }
 
@@ -272,7 +278,7 @@ VOID DebugPause(VOID)
     // show console and wait for key
     SwitchToText(FALSE);
     PauseForKey();
-    
+
     // reset error flag
     haveError = FALSE;
 }
@@ -281,7 +287,7 @@ VOID DebugPause(VOID)
 VOID EndlessIdleLoop(VOID)
 {
     UINTN index;
-    
+
     for (;;) {
         ReadAllKeyStrokes();
         refit_call3_wrapper(BS->WaitForEvent, 1, &ST->ConIn->WaitForKey, &index);
@@ -295,34 +301,34 @@ VOID EndlessIdleLoop(VOID)
 BOOLEAN CheckFatalError(IN EFI_STATUS Status, IN CHAR16 *where)
 {
     CHAR16 ErrorName[64];
-    
+
     if (!EFI_ERROR(Status))
         return FALSE;
-    
+
     StatusToString(ErrorName, Status);
     refit_call2_wrapper(ST->ConOut->SetAttribute, ST->ConOut, ATTR_ERROR);
     Print(L"Fatal Error: %s %s\n", ErrorName, where);
     refit_call2_wrapper(ST->ConOut->SetAttribute, ST->ConOut, ATTR_BASIC);
     haveError = TRUE;
-    
+
     //BS->Exit(ImageHandle, ExitStatus, ExitDataSize, ExitData);
-    
+
     return TRUE;
 }
 
 BOOLEAN CheckError(IN EFI_STATUS Status, IN CHAR16 *where)
 {
     CHAR16 ErrorName[64];
-    
+
     if (!EFI_ERROR(Status))
         return FALSE;
-    
+
     StatusToString(ErrorName, Status);
     refit_call2_wrapper(ST->ConOut->SetAttribute, ST->ConOut, ATTR_ERROR);
     Print(L"Error: %s %s\n", ErrorName, where);
     refit_call2_wrapper(ST->ConOut->SetAttribute, ST->ConOut, ATTR_BASIC);
     haveError = TRUE;
-    
+
     return TRUE;
 }
 
@@ -351,18 +357,18 @@ VOID BltClearScreen(IN BOOLEAN ShowBanner)
             if (Banner != NULL)
                 MenuBackgroundPixel = Banner->PixelData[0];
         }
-        
+
         // clear and draw banner
         egClearScreen(&MenuBackgroundPixel);
         if (Banner != NULL)
             BltImage(Banner, (UGAWidth - Banner->Width) >> 1,
                      ((UGAHeight - LAYOUT_TOTAL_HEIGHT) >> 1) + LAYOUT_BANNER_HEIGHT - Banner->Height);
-        
+
     } else {
         // clear to standard background color
         egClearScreen(&StdBackgroundPixel);
     }
-    
+
     GraphicsScreenDirty = FALSE;
 }