From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eastrmfepo203.cox.net (eastrmfepo203.cox.net [68.230.241.218]) by ml01.01.org (Postfix) with ESMTP id 79710209589F4 for ; Fri, 11 Aug 2017 20:20:38 -0700 (PDT) Received: from eastrmimpo109.cox.net ([68.230.241.222]) by eastrmfepo203.cox.net (InterMail vM.8.01.05.28 201-2260-151-171-20160122) with ESMTP id <20170812032259.RHRQ16450.eastrmfepo203.cox.net@eastrmimpo109.cox.net> for ; Fri, 11 Aug 2017 23:22:59 -0400 Received: from nessus.rodsbooks.com ([72.209.58.79]) by eastrmimpo109.cox.net with cox id w3Ny1v00Y1iZxRU013Nygm; Fri, 11 Aug 2017 23:22:59 -0400 X-CT-Class: Clean X-CT-Score: 0.00 X-CT-RefID: str=0001.0A020201.598E7493.000B, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CT-Spam: 0 X-Authority-Analysis: v=2.2 cv=Atue5K1P c=1 sm=1 tr=0 a=z3VlLZBMWEV9qHpJH5brsw==:117 a=z3VlLZBMWEV9qHpJH5brsw==:17 a=IkcTkHD0fZMA:10 a=KeKAF7QvOSUA:10 a=VuW-04m-3F0A:10 a=pGLkceISAAAA:8 a=28bguoTQAAAA:8 a=4E4QJx-j2-v2llnJVU4A:9 a=QEXdDO2ut3YA:10 a=6kGIvZw6iX1k4Y-7sg4_:22 a=voRV_PY5qW-4FQMV9MBC:22 X-CM-Score: 0.00 Authentication-Results: cox.net; none Received: from [192.168.1.2] (nessus.rodsbooks.com [192.168.1.2]) by nessus.rodsbooks.com (Postfix) with ESMTP id 898D12A022A for ; Fri, 11 Aug 2017 23:22:58 -0400 (EDT) To: edk2-devel@lists.01.org References: <42CE0497-A269-4D40-9E65-31A3CE27F197@apple.com> From: Rod Smith Message-ID: <3b578f09-8c29-4168-2524-49c8a2d5e210@rodsbooks.com> Date: Fri, 11 Aug 2017 23:22:58 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <42CE0497-A269-4D40-9E65-31A3CE27F197@apple.com> Subject: Re: What Bios data is sent to the Bootloader/OS ? X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Aug 2017 03:20:38 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit On Aug 11, 2017, at 6:00 AM, Rafael Machado wrote: >> >> Hi everyone >> >> I have a question that probably some guys here can help. >> The scenario I have, is that I need to create a OS image that must be able >> to boot at a UEFI system (with no csm module), and at a legacy bios system. >> My fist thought is that this is not possible. If I understand you correctly, it most definitely IS possible. Most major Linux distributions provide installation media that can boot in either BIOS/CSM/legacy mode or in EFI/UEFI mode. Replicating what those media do might not be the best way to go, though, since they are also typically designed to boot when written to optical media or when written to USB flash drives. To do this, they use a sort of "Frankenstein's Monster" disk format, so unless you need this cross-media compatibility, too, using the tools and procedures used to create these installation media would be overkill and would create something that's overly complex. These media do illustrate the practicality of what you're suggesting -- or at least, what I *BELIEVE* you're suggesting. If I've misinterpreted, please clarify your needs. >> The OS in this case is Linux, and the bootloader is Grub or Syslinux. A single GRUB (or SYSLINUX) binary will not do the job; however, there are both BIOS and EFI builds of both GRUB and SYSLINUX. The details of what you'd do would depend on the boot medium (hard disk, USB flash drive, optical disc, etc.); however, broadly speaking you need to write both BIOS-mode and EFI-mode versions of your chosen boot loader to the boot medium, with suitable configuration files in appropriate locations. Both GRUB and SYSLINUX are boot loaders that can load a Linux kernel into memory. The Linux kernel, in turn, does not need to be built for either BIOS or EFI environments; the same kernel binary will work in either environment. (One partial exception is that there's a feature known as the EFI stub loader that turns the Linux kernel into its own EFI boot loader. If you wanted to use this feature, it would obviously need to be compiled into the kernel. GRUB does not require this feature, though, and its presence will not interfere with the kernel being booted on a BIOS-based computer. Thus, you probably don't need to worry about it for your purposes. I mention it simply so you don't think it's an issue if you read something about it elsewhere.) -- Rod Smith rodsmith@rodsbooks.com http://www.rodsbooks.com