From owner-freebsd-hackers@freebsd.org Fri Mar 23 21:01:42 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89187F6E59A; Fri, 23 Mar 2018 21:01:42 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AE2A8C67A; Fri, 23 Mar 2018 21:01:42 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A2D7420DFB; Fri, 23 Mar 2018 17:01:41 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Fri, 23 Mar 2018 17:01:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=GSoh2J2M2IH1AKrh2UBc1L8P1PIDd 6o2uE3DJRO/dVY=; b=kaMQC3uTBEtrtk0k3v027Qza48d74SIoVlVX26AO8jFKy RQ6fUY5hZTCBkiQ7aIbV6MNX1uU3NnTiYdJQEod/10QPrO7z8Ew2yhV0LVp8jv5Y GFtFoYSbdVDkrkNtNokOhkxjbIE1KFSDdnIsUy8BJvPq/fSkhWgCVIhV5uNX8Ddw p9siOPfgcmh+KnKm4tk/7HBvvHZaP2sdp2UVwQc5d/g/DoDkbvmGDRAWlEf91UYa djQkAfdTpjKJzt9Ty0V8295WnO4/pasGIUeekvg83waAm1VBw29S9LZKEVD9cui/ GL6/AiLpPFyzP5MnkAfhC8tdkr6pPEivfQ/PPtPCw== X-ME-Sender: Received: from [10.57.111.169] (unknown [209.63.143.172]) by mail.messagingengine.com (Postfix) with ESMTPA id 0838B7E183; Fri, 23 Mar 2018 17:01:40 -0400 (EDT) From: Benno Rice Message-Id: <35FF5A67-B8CA-43C8-B39E-6797066CBD7E@FreeBSD.org> Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: Testing requested: Hybrid ISO/USB boot Date: Fri, 23 Mar 2018 14:01:39 -0700 In-Reply-To: <3373772881814803857@scdbackup.webframe.org> Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org To: Thomas Schmitt References: <3373772881814803857@scdbackup.webframe.org> X-Mailer: Apple Mail (2.3445.5.20) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2018 21:01:42 -0000 > On Mar 22, 2018, at 1:48 PM, Thomas Schmitt wrote: >=20 > Hi, >=20 > Benno Rice wrote: >> I=E2=80=99ve been working on the ability to create hybrid ISO/HDD = boot images for >> x86, a la what Linux systems do with ISOHYBRID. >=20 > Waving friendly over the fence i feel entitled to give some neighbor's > review. Hello! Thanks for your response. [snip] >> https://people.freebsd.org/~benno/hybrid-bootonly.iso.xz >=20 > This does not look much like it addresses EFI. >=20 > $ xorriso -indev hybrid-bootonly.iso -report_el_torito plain = -report_system_area plain > ... > El Torito catalog : 19 1 > El Torito images : N Pltf B Emul Ld_seg Hdpt Ldsiz = LBA > El Torito boot img : 1 BIOS y none 0x0000 0x00 4 = 20 > El Torito boot img : 2 BIOS y none 0x0000 0x00 1600 = 24 > ... > MBR partition table: N Status Type Start Blocks > MBR partition : 1 0x80 0xa5 1 16 >=20 > UEFI 2.4, 12.3.2.1, says about El Torito: > "A Platform Id of 0xEF indicates an EFI System Partition." > But entry 2 of this catalog is in a section with Platform Id 0x00 (x86 = BIOS). >=20 > If byte 38977 (decimal) was 0xef rather than 0x00, then it would be = marked > as an El Torito boot image for EFI. I think I=E2=80=99ve addressed this in this revision: https://svnweb.freebsd.org/changeset/base/331463 = And I=E2=80=99ve regenerated the image here: https://people.freebsd.org/~benno/hybrid-bootonly-20180323-00.iso.xz = > Further: This section begins at byte address 38976 by a byte value = 0x90. > According to El Torito specs this means that another section follows. > Correct would be value 0x91, which announces the end of the catalog. > (El Torito 1.0, Figure 4, Offset 0) I=E2=80=99ll look into this too. > On HDD, EFI looks for specially marked partitions in GPT or MBR = partition > table. > In MBR partiton table it looks for a partition of type 0xEF. > (UEFI 2.4, 5.2.2) > In GPT it looks for Type GUID C12A7328-F81F-11D2-BA4B-00A0C93EC93B. > (UEFI 2.4, Table 19) >=20 > So to mark the EFI partition, hybrid-bootonly.iso should have a MBR > partition number 2 with type 0xEF, start at 512-byte block 24*2048/512 = =3D 96, > size 1600 blocks. > (Strangely El Torito addresses by 2048-byte blocks but counts by = 512-byte > blocks. Size limit is 65535 blocks. But counts 0 and 1 mean to EFI > "up to end of medium=E2=80=9D.) I=E2=80=99ll look in to this one too. >> I=E2=80=99ve tested this image under qemu=20 >=20 > OVMF/SDK-II/Tianocore is too tolerant with the EFI specs and with = silently > using BIOS boot equipment. Real iron EFIs insist much more in = compliance. So it appears. Thanks again for looking at this! Thanks, Benno.=