What is Device Path?

Quick note explaining Device Path for BIOS/UEFI and embedded firmware readers.

3 min read
Đọc bằng English 日本語
BIOS Terms cover

A UEFI Device Path describes the route to a device, controller, partition, or boot file. It is not a string path like C:\Windows; it is a binary sequence of Device Path Nodes. Each node has a Type, SubType, Length, and node-specific data.

In simple terms, a filesystem path tells you where a file lives inside a volume. A Device Path tells firmware how to reach that volume and then the file.

Node structure

Every Device Path node starts with the same header:

typedef struct {
  UINT8 Type;
  UINT8 SubType;
  UINT8 Length[2];
} EFI_DEVICE_PATH_PROTOCOL;
FieldMeaningWhat to check while debugging
TypeMajor node group: hardware, ACPI, messaging, media…Which layer of the path is this node describing?
SubTypeSpecific node kindPCI, USB, SATA, HD, FilePath, and so on
LengthTotal node length including the headerA bad length can make the parser walk into garbage
DataNode-specific payloadDevice/function, partition GUID, file path, etc.

Quick checklist

Real Boot#### example

A Windows boot option may contain a path like this:

PciRoot(0x0)
  /Pci(0x17,0x0)
  /Sata(0x0,0xFFFF,0x0)
  /HD(1,GPT,xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,0x800,0x100000)
  /\EFI\Microsoft\Boot\bootmgfw.efi
NodeMeaningValues worth checking
PciRoot(0x0)PCI root bridge 0Usually the main root complex
Pci(0x17,0x0)PCI device/function0x17 is the device number, 0x0 is the function
Sata(...)SATA controller/port pathPort or controller changes can invalidate the path
HD(...)Partition that contains the loaderPartition number, GPT GUID/signature, start LBA, size
\EFI\...\bootmgfw.efiFilePath nodeThe .efi file firmware must open

The key point: a Device Path does not merely say “open bootmgfw.efi”. It also describes the controller and partition that must be reached first.

Common failure pattern

After cloning a disk, recreating the EFI System Partition, updating BIOS, or clearing CMOS, a Boot#### variable may still exist while its embedded Device Path is stale. Boot Manager can read the variable, but it cannot open the referenced partition or file. The visible symptom may be “missing boot option”, “boots the wrong Windows Boot Manager”, or “No bootable device”.

Takeaway

A Device Path is firmware’s binary map. DevicePathToText() only renders that map for humans; firmware still walks the structured nodes.

Public references

Found this useful?

Save it or share it with someone learning firmware, BIOS/UEFI, and embedded systems.

Nội dung liên quan

Một số bài viết, ghi chú hoặc project có liên quan đến nội dung bạn vừa đọc.

Biến note thành bài viết hoàn chỉnh

Notes là nơi ghi nhanh khái niệm.