Skip to content

Boot Linux after running the application #917

Closed
@JohnAZoidberg

Description

@JohnAZoidberg

I'm building an application with uefi-rs and if I run it, it exits and then I try to boot Linux it crashes.
Windows works just fine.

The minimal example is:

#[entry]
fn main(image_handle: Handle, mut system_table: SystemTable<Boot>) -> Status {
    uefi_services::init(&mut system_table).unwrap();
    Status::NOT_FOUND
}

Tried on hardware and on QEMU. On QEMU it looks like this right after I select the OS from Grub

!!!! X64 Exception Type - 06(#UD - Invalid Opcode)  CPU Apic ID - 00000000 !!!!
RIP  - 000000003E13F018, CS  - 0000000000000038, RFLAGS - 0000000000210246
RAX  - 0000000000000000, RCX - 000000003E191E98, RDX - 0000000000000000
RBX  - 0000000000000004, RSP - 000000003FF0FD08, RBP - 000000003FF28740
RSI  - 000000003E167518, RDI - 000000003FF6A5E0
R8   - 000000003FF27140, R9  - 000000003F4807A0, R10 - 0000000000000001
R11  - 00000000000000E1, R12 - 000000003E191EE0, R13 - 0000000000000100
R14  - 000000003FF28840, R15 - 000000003E191E98
DS   - 0000000000000030, ES  - 0000000000000030, FS  - 0000000000000030
GS   - 0000000000000030, SS  - 0000000000000030
CR0  - 0000000080010033, CR2 - 0000000000000000, CR3 - 000000003FC01000
CR4  - 0000000000000668, CR8 - 0000000000000000
DR0  - 0000000000000000, DR1 - 0000000000000000, DR2 - 0000000000000000
DR3  - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 0000000000000400
GDTR - 000000003F9DE000 0000000000000047, LDTR - 0000000000000000
IDTR - 000000003F471018 0000000000000FFF,   TR - 0000000000000000
FXSAVE_STATE - 000000003FF0F960
!!!! Find image based on IP(0x3E13F018) (No PDB)  (ImageBase=000000003DF1E000, EntryPoint=000000003DF1F000) !!!!

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