From 2ff7542329e1f3c48723052580896a8a0794098a Mon Sep 17 00:00:00 2001
From: srs5694
Date: Fri, 15 Jun 2012 19:28:47 -0400
Subject: [PATCH] Fix drivers to work on Macs.
---
BUILDING.txt | 19 ++++++++++++++-----
NEWS.txt | 5 +++++
docs/refind/getting.html | 4 ++--
docs/refind/todo.html | 18 ++++--------------
filesystems/AutoGen.c | 3 ++-
filesystems/Make.common | 4 +++-
filesystems/VBoxFswParam.h | 8 ++++----
filesystems/fsw_core.h | 1 -
filesystems/fsw_efi.c | 5 ++++-
refind/main.c | 2 --
10 files changed, 38 insertions(+), 31 deletions(-)
diff --git a/BUILDING.txt b/BUILDING.txt
index 04aba2e..8140481 100644
--- a/BUILDING.txt
+++ b/BUILDING.txt
@@ -216,13 +216,22 @@ unclear about others. Here's how I installed the toolkit:
- TARGET = RELEASE (DEBUG might work, but I've not tested it).
- TARGET_ARCH = X64 (on x86-64; leave this as IA32 on x86)
- TOOL_CHAIN_TAG = GCC45 (or other value depending on your GCC version;
- type "gcc -v" to learn your GCC version number)
+ type "gcc -v" to learn your GCC version number). Note that GCC 4.7
+ doesn't have its own entry, so use GCC46 for GCC 4.7.
The Makefile for the drivers reads some of these variables from this
file and uses them when accessing directories, so be sure to type these
- entries in the case specified. Note that the documentation refers to
- editing Conf/tools_def.txt in addition to Conf/target.txt, but doesn't
- specify what to change in Conf/tools_def.txt. I haven't found it
- necessary to make any changes in Conf/tools_def.txt.
+ entries in the case specified.
+
+10) The documentation refers to editing Conf/tools_def.txt in addition to
+ Conf/target.txt, but doesn't specify what to change in
+ Conf/tools_def.txt. I haven't found it necessary to make any changes in
+ Conf/tools_def.txt EXCEPT when using GCC 4.7 on a Fedora 17 system.
+ (I haven't used GCC 4.7 on other platforms, so this may well be
+ necessary on other systems, too.) With that setup, I found it
+ necessary to change the following line:
+ *_GCC46_X64_ASM_FLAGS = DEF(GCC46_ASM_FLAGS) -m64 -melf_x86_64
+ to:
+ *_GCC46_X64_ASM_FLAGS = DEF(GCC46_ASM_FLAGS) -m64
11) Type "make -C /usr/local/UDK2010/MyWorkSpace/BaseTools/Source/C".
(This step is not documented on the EDK Web page.)
diff --git a/NEWS.txt b/NEWS.txt
index a5024eb..b9ac7a7 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,3 +1,8 @@
+0.4.3 (?/??/2012):
+------------------
+
+- Filesystem drivers now work on EFI 1.x systems, such as Macs.
+
0.4.2 (6/3/2012):
-----------------
diff --git a/docs/refind/getting.html b/docs/refind/getting.html
index 8f87dcb..670eb94 100644
--- a/docs/refind/getting.html
+++ b/docs/refind/getting.html
@@ -15,7 +15,7 @@
href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
Originally written: 3/14/2012; last Web page update:
-6/3/2012, referencing rEFInd 0.4.2
+6/7/2012, referencing rEFInd 0.4.2
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!
@@ -150,7 +150,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
Getting rEFInd from Your OS's Repositories
-If you use Arch Linux, you can obtain rEFInd from its repositories, in both stable and git (experimental) releases. The git release is likely to include pre-release bug fixes and new features, but those features may be poorly tested or undocumented.
+If you use Arch Linux, you can obtain rEFInd from its repositories, in both stable and git (experimental) releases. The git release is likely to include pre-release bug fixes and new features, but those features may be poorly tested or undocumented.
You can also obtain rEFInd from the Nix Packages collection, which creates packages for a number of OSes using its own packaging system.
diff --git a/docs/refind/todo.html b/docs/refind/todo.html
index 5fe9114..763d699 100644
--- a/docs/refind/todo.html
+++ b/docs/refind/todo.html
@@ -293,20 +293,10 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com
- - The drivers I've built fail to load on a 32-bit Mac Mini; I get an
- "incompatible version" error message at an EFI shell, or an error
- code of 80000019 when rEFInd tries to load them. (These two
- messages are equivalent.) I suspect the problem is related to the
- EFI version 1.x used on the Mac, as opposed to UEFI
- 2.x used on PCs. I'm looking into the problem. In the
- meantime, if you have this problem, I recommend tracking down
- equivalent drivers from other sources. (See the drivers page for some pointers.) I'd
- appreciate hearing from
- you if you have problems along these lines. Please tell me what
- type of computer you're using, and especially the firmware version
- data (from rEFInd's "about" screen). This may help me narrow down
- the cause.
+ - The 32-bit versions of the drivers return filesystem labels that
+ omit the first two characters of the name. If the name is shorter
+ than two characters, the driver may return the wrong volume's
+ label. The 64-bit builds seem to be unaffected by this bug.
- Drivers for additional filesystems are required. Given the recent
shift to ext4fs, that should be the priority; however, other Linux
diff --git a/filesystems/AutoGen.c b/filesystems/AutoGen.c
index cc01832..894b438 100644
--- a/filesystems/AutoGen.c
+++ b/filesystems/AutoGen.c
@@ -193,7 +193,8 @@ ProcessLibraryDestructorList (
}
-const UINT32 _gUefiDriverRevision = 0x00020000U;
+//const UINT32 _gUefiDriverRevision = 0x00020000U;
+const UINT32 _gUefiDriverRevision = 0x00010000U;
const UINT32 _gDxeRevision = 0x00000000U;
diff --git a/filesystems/Make.common b/filesystems/Make.common
index 1301150..1c5872b 100644
--- a/filesystems/Make.common
+++ b/filesystems/Make.common
@@ -46,7 +46,9 @@ ALL_EFILIBS = $(EFILIB)/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevel
INCLUDE_DIRS = -I $(EDK2BASE)/MdePkg \
-I $(EDK2BASE)/MdePkg/Include \
- -I $(EDK2BASE)/MdePkg/Include/$(ARCHDIR)
+ -I $(EDK2BASE)/MdePkg/Include/$(ARCHDIR) \
+ -I $(EDK2BASE)/EdkCompatibilityPkg/Foundation/Framework/Include \
+ -I $(EDK2BASE)/EdkCompatibilityPkg/Foundation/Library/Dxe/Include
FSW_NAMES = fsw_efi fsw_core fsw_efi_lib fsw_lib AutoGen
OBJS = $(FSW_NAMES:=.o)
diff --git a/filesystems/VBoxFswParam.h b/filesystems/VBoxFswParam.h
index 0f20c9e..0c44f89 100644
--- a/filesystems/VBoxFswParam.h
+++ b/filesystems/VBoxFswParam.h
@@ -56,10 +56,10 @@
# define DivU64x32(x,y,z) DivU64x32((x),(y))
-INTN CompareGuidEdk1(
- IN EFI_GUID *Guid1,
- IN EFI_GUID *Guid2
- );
+// INTN CompareGuidEdk1(
+// IN EFI_GUID *Guid1,
+// IN EFI_GUID *Guid2
+// );
//#define CompareGuid(x, y) CompareGuidEdk1((x),(y))
# define HOST_EFI 1
diff --git a/filesystems/fsw_core.h b/filesystems/fsw_core.h
index 284913c..4464cbd 100644
--- a/filesystems/fsw_core.h
+++ b/filesystems/fsw_core.h
@@ -478,7 +478,6 @@ fsw_u16 fsw_to_lower(fsw_u16 ch);
/*@}*/
-
/**
* \name Posix Mode Macros
* These macros can be used globally to test fields and bits in
diff --git a/filesystems/fsw_efi.c b/filesystems/fsw_efi.c
index a364a2d..7c4ea0f 100644
--- a/filesystems/fsw_efi.c
+++ b/filesystems/fsw_efi.c
@@ -50,6 +50,9 @@
*/
#include "fsw_efi.h"
+#include "fsw_core.h"
+//#include
+//#include
#define DEBUG_LEVEL 0
@@ -77,7 +80,7 @@
/** Helper macro for stringification. */
#define FSW_EFI_STRINGIFY(x) #x
/** Expands to the EFI driver name given the file system type name. */
-#define FSW_EFI_DRIVER_NAME(t) L"rEFInd 0.4.1 " FSW_EFI_STRINGIFY(t) L" File System Driver"
+#define FSW_EFI_DRIVER_NAME(t) L"rEFInd 0.4.2 " FSW_EFI_STRINGIFY(t) L" File System Driver"
// function prototypes
diff --git a/refind/main.c b/refind/main.c
index 298a6d2..312b126 100644
--- a/refind/main.c
+++ b/refind/main.c
@@ -156,8 +156,6 @@ static EFI_STATUS StartEFIImageList(IN EFI_DEVICE_PATH **DevicePaths,
// load the image into memory
ReturnStatus = Status = EFI_NOT_FOUND; // in case the list is empty
for (DevicePathIndex = 0; DevicePaths[DevicePathIndex] != NULL; DevicePathIndex++) {
-// Print(L"About to try loading '%s' from '%s'\n", ImageTitle, DevicePathToStr(DevicePaths[DevicePathIndex]));
-// PauseForKey();
ReturnStatus = Status = refit_call6_wrapper(BS->LoadImage, FALSE, SelfImageHandle, DevicePaths[DevicePathIndex], NULL, 0, &ChildImageHandle);
if (ReturnStatus != EFI_NOT_FOUND)
break;
--
2.39.2