linuxboot / linuxboot/uefisettings

Hiidb access from userspace not working

Open
#8 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

investigation
Dominant language
Rust
Stars
95
Forks
13
PR merge metrics
No merged PRs in 30d

Description

Hi all,

I'm working on accessing and modifying BIOS/UEFI settings (such as toggling hardware ports) from Linux userspace on an ARM-based system using the uefisettings tool. The goal is to interact with the HII (Human Interface Infrastructure) database that stores BIOS configuration menus.
Current Setup:

I'm using EDK2, and have customized the HiiDatabaseDxe driver to manually create an EFI variable named HiiDb-1b838190-4625-4ead-abc9-cd5e6af18fe0, following the format expected by uefisettings.

This variable contains:

UEFI variable flags for boot/runtime access.

The size of the HII database.

The physical memory address where the HII database is located in /dev/mem.

Example:

$ hexdump -C /sys/firmware/efi/efivars/HiiDb-1b838190-4625-4ead-abc9-cd5e6af18fe0
00000000 06 00 00 00 18 0d 00 00 00 00 c9 ed |............|

I verified that /dev/mem at 0xEDC90000 (as pointed to in the variable) contains valid-looking IFR data and string content.

I also see other EFI variable files under /sys/firmware/efi/efivars/ for specific formsets, holding BIOS option values.

Problems I'm Facing:

uefisettings fails to parse the HII database, and commands like show-ifr, list-questions, list-strings, or even hii extract-db fail with:

Can't parse more package lists

I added debug logging inside uefisettings, and noticed:

The seek operation on /dev/mem works correctly.

But the subsequent read_exact fails to copy data into the expected buffer (it seems like a zero-length or incomplete read).

I'm not familiar with Rust, and I suspect this might be a memory allocation issue—possibly stack vs heap or incorrect buffer sizing.

What Works:

The HII database is clearly published and accessible in memory.

The format of the manually created HiiDb-* variable matches expectations.

I can read specific efivars corresponding to BIOS option values for particular formsets.

What I Need Help With:

Why is uefisettings unable to read the data correctly from /dev/mem despite a valid memory region and variable?

Could this be due to Rust’s read_exact requiring specific buffer alignment or size?

How can I debug or modify this behavior?

Are there any known limitations or required conditions (e.g., memory page alignment, permissions, architecture-specific quirks) for uefisettings ?

Is there a way to feed the extracted HII binary data into uefisettings directly, bypassing the need for /dev/mem access?

Any Rust-side fix or workaround suggestions to make the tool read the HII data correctly?

Any documentation or working examples where others have successfully parsed and modified BIOS settings via uefisettings?

I wanted to understand what I need to do exactly to make uefisettings work to modify options of Bios from userspace. Any documentation or guidence can really help me . I am breaking my head from last month to figure out why it fails .

Any guidance or suggestions would be deeply appreciated—especially on resolving the read_exact issue and getting uefisettings to recognize and work with the HII database correctly.

Thanks in advance!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the /dev/mem read path exercised by `hii extract-db` and the `show-ifr`, `list-questions`, and `list-strings` commands, focusing on the reported `read_exact` failure after seeking. Reproduce the failure using the HiiDb EFI variable and its referenced memory region, then verify that the tool can read and parse the complete HII database on the affected ARM system.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, rust
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.