Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Device behaves erractically after calling boot::open_protocol_exclusive::<DevicePath> #1725

Open
@Trolldemorted

Description

@Trolldemorted

Thanks for giving us a nice API to UEFI! I have built a very simple demo app to test it, but my device (X12SPi-TF) behaves strangely after the app exits gracefully: I see the boot menu as expected, but I can neither start my app a second time, nor boot into the operating system on my NVMe (GRUB -> Ubuntu Server 2024). No matter what I select, after a brief glitch I get back to the boot menu. After a power reset the device works as expected again, and I can start the app once or boot into GRUB.

My app only attempts to open theDevicePath protocol on all handles that support theBlockIO protocol:

#[entry]fnmain() ->Status{    uefi::helpers::init().unwrap();info!("uefitest starting up");test_bug().unwrap();    boot::stall(10_000_000);Status::SUCCESS}fntest_bug() ->Result{info!("### Enumerating BlockIO handles ###");let block_io_handles = boot::locate_handle_buffer(SearchType::ByProtocol(&BlockIO::GUID)).unwrap();for handlein block_io_handles.iter(){letOk(_device_path_proto) = boot::open_protocol_exclusive::<DevicePath>(*handle)else{continue;};info!("DevicePath proto opened");}Ok(())}

I am testing with uefi0.35.0 with the logger, panic_handler, alloc, and global_allocator feature (rustc 1.88.0).

Is there something obvious which I am missing, or could this be a firmware bug? I anticipated that an UEFI app could be started a second time, and that I could boot into a mundane OS after running an app. Do I need to reset the environment somehow before exiting? If I omit theboot::open_protocol_exclusive::<DevicePath> call and just loop over the BlockIO protocols, everything behaves as expected, and I can boot into GRUB as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp