From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 01EC11A1E2F for ; Mon, 19 Sep 2016 10:49:49 -0700 (PDT) Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 721C8550B1; Mon, 19 Sep 2016 17:49:48 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-98.phx2.redhat.com [10.3.116.98]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8JHnlbj008037; Mon, 19 Sep 2016 13:49:47 -0400 To: Saqib Khan References: From: Laszlo Ersek Cc: edk2-devel@ml01.01.org Message-ID: <2c8f7b31-7cc5-38cf-a56f-d60229ace8e9@redhat.com> Date: Mon, 19 Sep 2016 19:49:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 19 Sep 2016 17:49:48 +0000 (UTC) Subject: Re: Help Required legacy booting from an EFI 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: Mon, 19 Sep 2016 17:49:49 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 09/19/16 17:00, Saqib Khan wrote: > Hello all, this is my first post to this list and i am very new to edk2 > development. > > I started by building BootManagerMenuApp with following functionality > > - Boot from BootManagerManueApp > - Run an Helloworld EFI > - Run windows 7 EFI to boot windows 7 > > Now i want to develop an EFI which will first run Helloworld EFI then it > will boot windows 7 which is installed on legacy boot (NOT EFI). > > I have looked through http://bluestop.org/edk2/docs/trunk/ documentation > thoroughly but i am not able to get any thing for legacy boot from an EFI. > > > It will be helpful if someone guide me the flow for legacy booting from an > EFI . You can add your EFI application to a SysPrep#### load option, then the legacy-booted Windows OS to a normal Boot#### load option. See "3.1.7 Required System Preparation Applications" in the UEFI-2.6 spec, about the ordering between SysPrep#### and Boot####. Furthermore, legacy boot can be triggered by using a BBS (BIOS Boot Specification) device path in the Boot#### option. This devpath node type is documented in UEFI-2.6 "Table 98. Device Node Table", and in the Compatibility Support Module Specification, rev 0.98, "3.2.1 Legacy BIOS Protocol", near BBS_BBS_DEVICE_PATH. For legacy boot to work, your platform firmware must of course include a Compatibility Support Module. As an example platform, SeaBIOS can be built as a CSM, then embedded into OVMF with the -D CSM_ENABLE build switch. (Grep OvmfPkg/OvmfPkg*.{dsc,fdf} for CSM_ENABLE.) Specifically for Windows 7 though, you don't need a full CSM in order to boot it under UEFI. You can boot it in UEFI mode just fine, as long as you have some VBE services installed in the C segment. Windows 7 will run those functions in its internal real-mode emulator, for setting up the display: https://en.wikipedia.org/wiki/Virtual_DOS_machine That is, the VBE functions will not be executed natively, they will be interpreted / emulated. We utilized this fact for booting UEFI Windows 7 without a CSM on QEMU, on the virtual QXL video card; see OvmfPkg/QemuVideoDxe/VbeShim.*. Thanks Laszlo