From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-x241.google.com (mail-qk0-x241.google.com [IPv6:2607:f8b0:400d:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 50AF980347 for ; Mon, 6 Mar 2017 19:14:33 -0800 (PST) Received: by mail-qk0-x241.google.com with SMTP id n141so25731106qke.3 for ; Mon, 06 Mar 2017 19:14:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=xBGi7rS+yzsdJLkpDbKdcKENS11rAtRCxPIhRiewEEo=; b=rrunB0/zcrGF9ZIs7qCZabUfNLqagu660c1iRKRNnP43jaInth8LLSbdPHBhjM/Mx7 dryyULbY/kELBcaXWWCWqDW0EqzX1U2LPdRw91qZANkZed+bvsJPx1kWcX/FkZFqYnEZ 8QV6aU6dYFWCqz/4KshLorgx8X+q2cz9MebN90x2CT0qDKS2c1opT9pQBjVFJLuPU4Zv uClwZ+ROsO1P9CrcuFWkcm4yROTrPh1QKHLXD24lkbZU4ULwYGvtqIHpt7s9/Fa0B3BC ZUCFDHvz/P5bD4TQuhcOu6MOXoXEFkZf3c1F1JmLQvEVqHEeXMqlP7xVUjYvgVOZ3sNK O4aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=xBGi7rS+yzsdJLkpDbKdcKENS11rAtRCxPIhRiewEEo=; b=rd96aMv0pRrE5YJcN3+QTGlyqwfV77otzDTqgtuJRMkzZnRR2akYEQN2SQzn5t6FvN V7bkfVD5U4TPXcoN2WMjAlBal1D4YK4EnU+TxjKoMSYOOcQf6i+CNW6ipYFpcIUgBTZV 8Qnr5Gu1U4T8XYmwUdMhwQNBbLuWvYTksg5NH2hDEhHvo8Q0vCKX2i8fE2gR5QIbMNaV mou7lMShuDmlPAC7ztUkyGkdvJ/uUpqf04O3vGZBVEt6T86/PKmsDglpOVIFpggauqxS 5mI9/6xb9mFRoseA5bMXb4WiWt/hfiJ1C5yDzULfjWQkikPlCX/22EvDFbZuJCTIL8pI Rvrw== X-Gm-Message-State: AMke39kVPAvx/BDOMKz2jrPqdTaeL3ReD8cn75vKClkGCzJdDL788hr+gTXR7dsjCOBlBg== X-Received: by 10.237.53.113 with SMTP id b46mr18458192qte.119.1488856472028; Mon, 06 Mar 2017 19:14:32 -0800 (PST) Received: from foober.ini.cmu.edu (pool-108-39-248-175.pitbpa.fios.verizon.net. [108.39.248.175]) by smtp.gmail.com with ESMTPSA id v26sm2901013qtc.13.2017.03.06.19.14.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Mar 2017 19:14:31 -0800 (PST) From: "Gabriel L. Somlo" To: edk2-devel@ml01.01.org Cc: lersek@redhat.com, jordan.l.justen@intel.com, reza.jelveh@tuhh.de, agraf@suse.de, kraxel@redhat.com Date: Mon, 6 Mar 2017 22:14:19 -0500 Message-Id: <1488856465-8965-1-git-send-email-gsomlo@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [RFC PATCH 0/6] OVMF: HFS+ (and Mac OS X boot) X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Mar 2017 03:14:33 -0000 This series is intended to restart the conversation re. adding boot support for Mac OS X to QEMU via OVMF. The *last* three patches represent what's left of Reza's excellent work on getting OVMF to support booting OS X. They are rebased to the point where they still apply cleanly and work, but I haven't made any significant changes to them beyond that. The *first* three patches (1-3 of 6) provide the BSD-licensed HFS+ filesystem support required by Reza's work: - patch 1/6: After a bit of archaeology, I managed to isolate the original EFI "File System Wrapper" (FSW) files released under the BSD by the "rEFIt" project; One additional file, also BSD-licensed, was imported from the "rEFInd" project. The FSW is an abstraction layer that facilitates the creation of a file system driver by providing a set methods for mount/unmount/readdir/etc. - patch 2/6: fix a few compiler errors and other discrepancies to facilitate integrating FSW into EDK2/OVMF. - patch 3/6: A BSD-licensed implementation of an FSW HFS+ driver. Based on Apple's HFS+ specification (TN1150), this is a minimalistic, bare-bones set of FSW methods capable of locating and loading files from an HFS+ volume. Lots of functionality (e.g. stat, readdir, hard/sym links, or accessing files with more than 8 fragments) is unimplemented at this time. I only implemented the methods necessary to support loading Apple's boot.efi and kernel. For any extra features (such as stat, readdir, etc.) I'd need to figure out how to navigate around on a mounted volume (e.g. from the UEFI shell ?) to cause the rest of the methods to be called, so I could test whether they work or not. Particularly support for fragmented files -- I'd have to create one somehow (against OS X and HFS's best efforts to prevent it), then cause it to be accessed from the UEFI shell to test that whatever I'm implementing actually works. Any "EDK2 filesystem developer's primer" on how to do those things would be immensely helpful at this point. Also, I would like some feedback and advice on where to go from here. At this time, neither the FSW wrapper nor the HFS+ driver I wrote comply with EDK2's coding standards. Before I start working on that, it would be helpful to find out whether the FSW layer is of any interest to EDK2 as a way to facilitate adding support for arbitrary new filesystems. If not, it might be worth factoring out the common bits and roll the the whole thing up into a standalone HFS+ driver, which would be a significantly different direction to go. The series is also available on GitHub, in my "macboot" branch: https://github.com/gsomlo/edk2/tree/macboot A set of instructions on how to get things working is available here: http://www.contrib.andrew.cmu.edu/~somlo/OSXKVM/ Thanks in advance for any feedback, advice, etc. --Gabriel Gabriel L. Somlo (6): FswHfsPlus: add File System Wrapper (FSW) interface code FswHfsPlus: connect FSW code to EDK2, fix compile discrepancies FswHfsPlus: implement FSW driver for the HFS+ file system EdkCompatibilityPkg: allow ConsoleControl protocol to be used OvmfPkg: add Apple boot support OvmfPkg: enable AppleSupport library for Ovmf firmware EdkCompatibilityPkg/EdkCompatibilityPkg.dec | 2 + OvmfPkg/FswHfsPlus/FswHfsPlus.inf | 57 ++ OvmfPkg/FswHfsPlus/fsw_base.h | 158 +++ OvmfPkg/FswHfsPlus/fsw_core.c | 929 +++++++++++++++++ OvmfPkg/FswHfsPlus/fsw_core.h | 517 ++++++++++ OvmfPkg/FswHfsPlus/fsw_efi.c | 1040 ++++++++++++++++++++ OvmfPkg/FswHfsPlus/fsw_efi.h | 102 ++ OvmfPkg/FswHfsPlus/fsw_efi_base.h | 81 ++ OvmfPkg/FswHfsPlus/fsw_efi_edk2_base.h | 76 ++ OvmfPkg/FswHfsPlus/fsw_efi_lib.c | 129 +++ OvmfPkg/FswHfsPlus/fsw_hfsplus.c | 535 ++++++++++ OvmfPkg/FswHfsPlus/fsw_hfsplus.h | 238 +++++ OvmfPkg/FswHfsPlus/fsw_lib.c | 294 ++++++ OvmfPkg/FswHfsPlus/fsw_strfunc.h | 453 +++++++++ OvmfPkg/Include/Library/AppleSupportLib.h | 28 + OvmfPkg/Library/AppleSupportLib/AppleSupport.c | 107 ++ .../Library/AppleSupportLib/AppleSupportLib.inf | 50 + OvmfPkg/Library/AppleSupportLib/Bds.c | 151 +++ OvmfPkg/Library/AppleSupportLib/Bds.h | 21 + OvmfPkg/Library/AppleSupportLib/Common.h | 24 + OvmfPkg/Library/AppleSupportLib/Console.c | 86 ++ OvmfPkg/Library/AppleSupportLib/Console.h | 28 + OvmfPkg/Library/AppleSupportLib/Datahub.c | 104 ++ OvmfPkg/Library/AppleSupportLib/Datahub.h | 32 + .../Library/PlatformBootManagerLib/BdsPlatform.c | 10 + .../Library/PlatformBootManagerLib/BdsPlatform.h | 1 + .../PlatformBootManagerLib.inf | 1 + OvmfPkg/OvmfPkgIa32.dsc | 8 + OvmfPkg/OvmfPkgIa32.fdf | 3 + OvmfPkg/OvmfPkgIa32X64.dsc | 8 + OvmfPkg/OvmfPkgIa32X64.fdf | 3 + OvmfPkg/OvmfPkgX64.dsc | 8 + OvmfPkg/OvmfPkgX64.fdf | 3 + 33 files changed, 5287 insertions(+) create mode 100644 OvmfPkg/FswHfsPlus/FswHfsPlus.inf create mode 100644 OvmfPkg/FswHfsPlus/fsw_base.h create mode 100644 OvmfPkg/FswHfsPlus/fsw_core.c create mode 100644 OvmfPkg/FswHfsPlus/fsw_core.h create mode 100644 OvmfPkg/FswHfsPlus/fsw_efi.c create mode 100644 OvmfPkg/FswHfsPlus/fsw_efi.h create mode 100644 OvmfPkg/FswHfsPlus/fsw_efi_base.h create mode 100644 OvmfPkg/FswHfsPlus/fsw_efi_edk2_base.h create mode 100644 OvmfPkg/FswHfsPlus/fsw_efi_lib.c create mode 100644 OvmfPkg/FswHfsPlus/fsw_hfsplus.c create mode 100644 OvmfPkg/FswHfsPlus/fsw_hfsplus.h create mode 100644 OvmfPkg/FswHfsPlus/fsw_lib.c create mode 100644 OvmfPkg/FswHfsPlus/fsw_strfunc.h create mode 100644 OvmfPkg/Include/Library/AppleSupportLib.h create mode 100644 OvmfPkg/Library/AppleSupportLib/AppleSupport.c create mode 100644 OvmfPkg/Library/AppleSupportLib/AppleSupportLib.inf create mode 100644 OvmfPkg/Library/AppleSupportLib/Bds.c create mode 100644 OvmfPkg/Library/AppleSupportLib/Bds.h create mode 100644 OvmfPkg/Library/AppleSupportLib/Common.h create mode 100644 OvmfPkg/Library/AppleSupportLib/Console.c create mode 100644 OvmfPkg/Library/AppleSupportLib/Console.h create mode 100644 OvmfPkg/Library/AppleSupportLib/Datahub.c create mode 100644 OvmfPkg/Library/AppleSupportLib/Datahub.h -- 2.7.4