[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH v2 12/12] pc: skip firmware
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [RFC PATCH v2 12/12] pc: skip firmware |
Date: |
Mon, 29 Aug 2016 19:08:14 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
On 25/08/2016 12:15, Chao Peng wrote:
> -static void load_linux(PCMachineState *pcms,
> - FWCfgState *fw_cfg)
> +static void load_linux_efi(PCMachineState *pcms)
ELF, not EFI.
Paolo
> +{
> + unsigned char class;
> + MachineState *machine = MACHINE(pcms);
> + FILE *file = fopen(machine->kernel_filename, "rb");
> +
> + if (!file) {
> + goto err;
> + }
> +
> + if (fseek(file, EI_CLASS, 0) || fread(&class, 1, 1, file) != 1) {
> + fclose(file);
> + goto err;
> + }
> + fclose(file);
> +
> + if (load_elf(machine->kernel_filename, NULL, NULL, &boot_info.entry,
> + NULL, NULL, 0, EM_X86_64, 0, 0) < 0) {
> + goto err;
> + }
> +
> + if (class == ELFCLASS64) {
> + boot_info.long_mode = true;
> + } else if (class != ELFCLASS32) {
> + goto err;
> + }
> +
> + boot_info.protected_mode = true;
> + return;
> +
> +err:
> + fprintf(stderr, "qemu: could not load kernel '%s'\n",
> + machine->kernel_filename);
> + exit(1);
> +}
- [Qemu-devel] [RFC PATCH v2 05/12] acpi: build static _PRT, (continued)
- [Qemu-devel] [RFC PATCH v2 05/12] acpi: build static _PRT, Chao Peng, 2016/08/25
- [Qemu-devel] [RFC PATCH v2 04/12] pc: make pit configurable, Chao Peng, 2016/08/25
- [Qemu-devel] [RFC PATCH v2 06/12] acpi: expose data structurs and functions of BIOS linker loader, Chao Peng, 2016/08/25
- [Qemu-devel] [RFC PATCH v2 07/12] acpi: expose acpi_checksum(), Chao Peng, 2016/08/25
- [Qemu-devel] [RFC PATCH v2 10/12] q35: initialize MMCFG base when there is no firmware, Chao Peng, 2016/08/25
- [Qemu-devel] [RFC PATCH v2 08/12] acpi: patch guest ACPI when there is no firmware, Chao Peng, 2016/08/25
- [Qemu-devel] [RFC PATCH v2 09/12] ich9: enable pm registers when there is no firmware, Chao Peng, 2016/08/25
- [Qemu-devel] [RFC PATCH v2 11/12] pc: support direct loading protected/long mode kernel, Chao Peng, 2016/08/25
- [Qemu-devel] [RFC PATCH v2 12/12] pc: skip firmware, Chao Peng, 2016/08/25
- Re: [Qemu-devel] [RFC PATCH v2 12/12] pc: skip firmware,
Paolo Bonzini <=