Skip to content

Support UEFI booting for guest Linux in arch x86_64 #229

@Solicey

Description

@Solicey

Currently in arch x86_64, the booting of guest Linux is done in a legacy BIOS way. However, most x86 PCs nowadays are using UEFI as an substitution. It may lead to problems if we are booting Hvisor using UEFI, while booting guest Linux using legacy BIOS. For example, in the above situtiation, it is hard to find a suitable Linux framebuffer for Linux. The only one I found available is called vesafb, which lacks the ability to demonstrate early console output.

Therefore, we are looking for a minimal way to 'fake' an UEFI environment for guest Linux. In x86_64, this can be achieved by filling in efi_info param in boot_params (so called the zero page). We only need to provide a UEFI system table and an array of memory descriptors for Linux. However, there are two cases that are worth mentioning.

  1. We don't have to provide a runtime service table for Linux, but we should set an efi=noruntime param in Linux's boot command line to ban Linux from using runtime service, or there will be warnings during Linux's initialization.
  2. Although we have provided Linux with a memory descriptor array, which describes the guest memory layout. We still have to set up E820 memory map for guest Linux, because no matter in which way Linux might be booted, it would eventually use the E820 as its memory layout.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions