public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Andrew Fish" <afish@apple.com>
To: devel@edk2.groups.io, vlrzprgts@gmail.com
Subject: Re: [edk2-devel] Question about Block IO protocol devices
Date: Thu, 27 Jan 2022 17:28:32 -0800	[thread overview]
Message-ID: <0A58CE0A-5481-4B25-95E4-5AA64D51DF44@apple.com> (raw)
In-Reply-To: <CANPuzFwSeBsPqOGs2oc313s6fNqumC189LW-gKm=J=hR2n-qrA@mail.gmail.com>



> On Jan 27, 2022, at 4:34 PM, valerij zaporogeci <vlrzprgts@gmail.com> wrote:
> 
> Hi, edk2. I would be glad to clarify one thing. When I request all
> handles, on which Block IO protocol (BIOP) is installed (through
> LocateHandleBuffer(ByProtocol), and then open Device Path protocol
> (DPP) on every of them to see what devices support BIOP, I don't see
> ones, that should represent the whole physical (raw) disk. In other
> words, there are no devices, whose DP would end with 4.1 Type.SubType
> node _and_ partition number n == 0, this is what the spec suggests as
> a way of representing the whole (raw) disk (as opposite to a
> partition, on which n =/= 0). Instead, I am getting BIOP instances on
> devices, whose DP ends at the level before, a parent device that is,
> for example, say 3.1 (Messaging.ATAPI). These are supposedly for
> representing the whole (raw) disk? because there are no other thing
> being that. E.g. if I have a harddisk with MBR and one partition on
> it, the DP for the partition device, supporting BIOP, would be
> something like:
> 
> PciRoot(0)\Pci(0, 0)\Ata(0)\HD(1, MBR, sign, start, size)
> 
> But there wouldn't be a device enumerated like:
> 
> PciRoot(0)\Pci(0, 0)\Ata(0)\HD(0,MBR, sign)
> 
> Instead, there would be one like this:
> 
> PciRoot(0)\Pci(0, 0)\Ata(0)
> 
> the question is:
> what DP the specification defines to represent a whole (raw) disk?
> 1) the one, ending with 4.1 Type.SubType and partition number n == 0

I see the text in table 10-49 but I don’t know of any code that makes a node for the entire disk partition. 

If you look at the BlockIO protocol the partitions that are created due to the partitions on the disk will have BlockIo->Media->LogicalPartition set to TRUE.

The partition driver produce a logical partition for each valid MBR partition:
https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c

The disk driver is going to produce a device path that points to the raw disk:
PciRoot(0)\Pci(0, 0)\Ata(0)

> 2) the DP of the parent of any partition, residing on it, for example
> the one, ending with 3.1 Type.SubType
> 

This is the raw disk as produced by the disk driver. BlockIo->Media->LogicalPartition is FALSE.

I don’t remember the use case for HD(0,MBR, sign) type of device path node? It is not for legacy BOOT as that would be a BBS entry. 

Thanks,

Andrew Fish

> Thank you.
> 
> 
> 
> 
> 


  reply	other threads:[~2022-01-28  1:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-28  0:34 Question about Block IO protocol devices valerij zaporogeci
2022-01-28  1:28 ` Andrew Fish [this message]
2022-01-28  2:19   ` [edk2-devel] " valerij zaporogeci
2022-01-28  3:19     ` Andrew Fish
2022-01-28  3:45       ` valerij zaporogeci

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0A58CE0A-5481-4B25-95E4-5AA64D51DF44@apple.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox