Get Boot Device in UEFI

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Octocontrabass
Member
Member
Posts: 5568
Joined: Mon Mar 25, 2013 7:01 pm

Re: Get Boot Device in UEFI

Post by Octocontrabass »

robertapengelly wrote: Tue Dec 03, 2024 1:19 amsecondary IDE channel
Looks like primary IDE channel to me.
robertapengelly wrote: Tue Dec 03, 2024 1:19 amStill a little confused as to what the rest of it means though.
The bit at the end means it's the first partition in the partition table, the partition table is a legacy MBR, the MBR signature is 0x6EF86D7A, the partition starts at LBA 011(typo?), and the partition is 0x1043F blocks long. I'm not sure why there's no file path after that.
User avatar
robertapengelly
Posts: 14
Joined: Mon Jun 24, 2024 6:29 am
Contact:

Re: Get Boot Device in UEFI

Post by robertapengelly »

Yeah, it was a typo it was supposed to be 0x11, so the partition starts at 17 and is 66623 sectors which is right for my partition.
Octocontrabass wrote: Tue Dec 03, 2024 2:23 pm Looks like primary IDE channel to me.
What's the 0x7, 0x1 for then? I'm guessing your referring to the Ata part as the primary IDE channel?
Octocontrabass
Member
Member
Posts: 5568
Joined: Mon Mar 25, 2013 7:01 pm

Re: Get Boot Device in UEFI

Post by Octocontrabass »

robertapengelly wrote: Wed Dec 04, 2024 2:17 amWhat's the 0x7, 0x1 for then?
That tells you you'll find the IDE controller at device 0x7 function 0x1 when you enumerate the PCI bus. The ATA part tell you where you'll find the drive when you enumerate the IDE controller.
User avatar
robertapengelly
Posts: 14
Joined: Mon Jun 24, 2024 6:29 am
Contact:

Re: Get Boot Device in UEFI

Post by robertapengelly »

Awesome thanks for all your help. One last thing, I thought PCI disks are 0x1F0 and 0x170, have I got them wrong or am I mistaking what you mean with the device/function stuff?
Octocontrabass
Member
Member
Posts: 5568
Joined: Mon Mar 25, 2013 7:01 pm

Re: Get Boot Device in UEFI

Post by Octocontrabass »

robertapengelly wrote: Sat Dec 07, 2024 9:35 pmOne last thing, I thought PCI disks are 0x1F0 and 0x170, have I got them wrong or am I mistaking what you mean with the device/function stuff?
I think you might be getting something mixed up. The device/function is the address within the PCI configuration space where you'll find the PCI IDE controller's configuration registers. You'll read the class code from the configuration space to see whether the IDE controller is operating in PCI native mode or ISA compatibility mode. In PCI native mode, you need to read the Base Address Registers in the configuration space to find the I/O ports for communicating with the disks. In ISA compatibility mode, you'll use ports 0x1F0 and 0x170.
Post Reply