Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Execute a 32-bit EFI with coreboot/u-boot
drac98@Fossa-Aspire-E5-576G:~/workspace/coreboot$ qemu-system-x86_64 -cpu qemu64 -bios build/coreboot.rom -serial stdio -hda fat:rw:/tmp/efi/
WARNING: Image format was not specified for 'json:{"fat-type": 0, "backing": {"driver": "vvfat_write_target"}, "dir": "/tmp/efi/", "driver": "vvfat", "floppy": false, "rw": true, "write-target": {"driver": "qcow", "file": {"driver": "file", "filename": "/var/tmp/vl.zdK3EM"}}}' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
coreboot-4.15-191-gb2e8bd8364 Sat Nov 20 17:49:25 UTC 2021 bootblock starting (log level: 7)...
FMAP: Found "FLASH" version 1.1 at 0x0.
FMAP: base = 0xfc000000 size = 0x4000000 #areas = 3
FMAP: area COREBOOT found @ 200 (67108352 bytes)
CBFS: mcache @0x00014e00 built for 11 files, used 0x270 of 0x4000 bytes
CBFS: Found 'fallback/romstage' @0x280 size 0x4150 in mcache @0x00014e4c
BS: bootblock times (exec / console): total (unknown) / 3 ms
coreboot-4.15-191-gb2e8bd8364 Sat Nov 20 17:49:25 UTC 2021 romstage starting (log level: 7)...
QEMU: firmware config interface detected
Firmware config version id: 3
QEMU: firmware config: Found 'etc/e820'
CBMEM:
IMD: root @ 0x07fff000 254 entries.
IMD: root @ 0x07ffec00 62 entries.
FMAP: area COREBOOT found @ 200 (67108352 bytes)
CBFS: Found 'fallback/postcar' @0x12f00 size 0x458c in mcache @0x00014fbc
Loading module at 0x07fd3000 with entry 0x07fd3031. filesize: 0x42a8 memsize: 0x85b0
Processing 169 relocs. Offset value of 0x05fd3000
BS: romstage times (exec / console): total (unknown) / 1 ms
coreboot-4.15-191-gb2e8bd8364 Sat Nov 20 17:49:25 UTC 2021 postcar starting (log level: 7)...
FMAP: area COREBOOT found @ 200 (67108352 bytes)
CBFS: Found 'fallback/ramstage' @0x4480 size 0xd393 in mcache @0x07ffea4c
Loading module at 0x07fa5000 with entry 0x07fa5000. filesize: 0x1a898 memsize: 0x2c648
Processing 1688 relocs. Offset value of 0x071a5000
BS: postcar times (exec / console): total (unknown) / 3 ms
coreboot-4.15-191-gb2e8bd8364 Sat Nov 20 17:49:25 UTC 2021 ramstage starting (log level: 7)...
Enumerating buses...
Root Device scanning...
CPU_CLUSTER: 0 enabled
DOMAIN: 0000 enabled
CPU_CLUSTER: 0 scanning...
QEMU: firmware config interface detected
Firmware config version id: 3
QEMU: max_cpus is 1
CPU: APIC: 00 enabled
scan_bus: bus CPU_CLUSTER: 0 finished in 4 msecs
DOMAIN: 0000 scanning...
PCI: pci_scan_bus for bus 00
PCI: 00:00.0 [8086/1237] enabled
PCI: 00:01.0 [8086/7000] enabled
PCI: 00:01.1 [8086/7010] enabled
PCI: 00:01.3 [8086/7113] enabled
PCI: 00:02.0 [1234/1111] enabled
PCI: 00:03.0 [8086/100e] enabled
PCI: 00:01.0 scanning...
scan_bus: bus PCI: 00:01.0 finished in 0 msecs
PCI: 00:01.3 scanning...
scan_bus: bus PCI: 00:01.3 finished in 0 msecs
scan_bus: bus DOMAIN: 0000 finished in 4 msecs
scan_bus: bus Root Device finished in 10 msecs
done
BS: BS_DEV_ENUMERATE run times (exec / console): 4 / 7 ms
found VGA at PCI: 00:02.0
Setting up VGA for PCI: 00:02.0
Setting PCI_BRIDGE_CTL_VGA for bridge DOMAIN: 0000
Setting PCI_BRIDGE_CTL_VGA for bridge Root Device
Allocating resources...
Reading resources...
QEMU: firmware config: Found 'etc/e820'
QEMU: e820/ram: 0x00000000 + 0x08000000
QEMU: reserve ioports 0x0510-0x0511 [firmware-config]
QEMU: reserve ioports 0x5658-0x5658 [vmware-port]
QEMU: reserve ioports 0xae00-0xae0f [pci-hotplug]
QEMU: reserve ioports 0xaf00-0xaf1f [cpu-hotplug]
QEMU: reserve ioports 0xafe0-0xafe3 [piix4-gpe0]
Done reading resources.
=== Resource allocator: DOMAIN: 0000 - Pass 1 (gathering requirements) ===
=== Resource allocator: DOMAIN: 0000 - Pass 2 (allocating resources) ===
DOMAIN: 0000 io: base: 0 size: 0 align: 0 gran: 0 limit: ffff
update_constraints: DOMAIN: 0000 0c base 00000510 limit 00000511 io (fixed)
update_constraints: DOMAIN: 0000 0d base 00005658 limit 00005658 io (fixed)
update_constraints: DOMAIN: 0000 0e base 0000ae00 limit 0000ae0f io (fixed)
update_constraints: DOMAIN: 0000 0f base 0000af00 limit 0000af1f io (fixed)
update_constraints: DOMAIN: 0000 10 base 0000afe0 limit 0000afe3 io (fixed)
update_constraints: PCI: 00:01.0 01 base 00000000 limit 00000fff io (fixed)
update_constraints: PCI: 00:01.3 01 base 0000e400 limit 0000e43f io (fixed)
update_constraints: PCI: 00:01.3 02 base 00000f00 limit 00000f0f io (fixed)
DOMAIN: 0000: Resource ranges:
* Base: 1000, Size: 4658, Tag: 100
* Base: 5659, Size: 57a7, Tag: 100
* Base: ae10, Size: f0, Tag: 100
* Base: af20, Size: c0, Tag: 100
* Base: afe4, Size: 341c, Tag: 100
* Base: e440, Size: 1bc0, Tag: 100
PCI: 00:03.0 14 * [0x1000 - 0x103f] limit: 103f io
PCI: 00:01.1 20 * [0x1040 - 0x104f] limit: 104f io
DOMAIN: 0000 io: base: 0 size: 0 align: 0 gran: 0 limit: ffff done
DOMAIN: 0000 mem: base: 0 size: 0 align: 0 gran: 0 limit: ffffffffff
update_constraints: DOMAIN: 0000 0a base 00000000 limit 0009ffff mem (fixed)
update_constraints: DOMAIN: 0000 0b base 000c0000 limit 07ffffff mem (fixed)
update_constraints: DOMAIN: 0000 11 base 000a0000 limit 000bffff mem (fixed)
update_constraints: DOMAIN: 0000 12 base 000c0000 limit 000fffff mem (fixed)
update_constraints: DOMAIN: 0000 02 base fec00000 limit fecfffff mem (fixed)
update_constraints: DOMAIN: 0000 03 base fee00000 limit fee0ffff mem (fixed)
update_constraints: PCI: 00:01.0 02 base ff800000 limit ffffffff mem (fixed)
update_constraints: PCI: 00:01.0 03 base fec00000 limit fec00fff mem (fixed)
DOMAIN: 0000: Resource ranges:
* Base: 8000000, Size: f6c00000, Tag: 200
* Base: fed00000, Size: 100000, Tag: 200
* Base: fee10000, Size: 9f0000, Tag: 200
* Base: 100000000, Size: ff00000000, Tag: 100200
PCI: 00:02.0 10 * [0x8000000 - 0x8ffffff] limit: 8ffffff prefmem
PCI: 00:03.0 30 * [0x9000000 - 0x907ffff] limit: 907ffff mem
PCI: 00:03.0 10 * [0x9080000 - 0x909ffff] limit: 909ffff mem
PCI: 00:02.0 30 * [0x90a0000 - 0x90affff] limit: 90affff mem
PCI: 00:02.0 18 * [0x90b0000 - 0x90b0fff] limit: 90b0fff mem
DOMAIN: 0000 mem: base: 0 size: 0 align: 0 gran: 0 limit: ffffffffff done
=== Resource allocator: DOMAIN: 0000 - resource allocation complete ===
PCI: 00:01.1 20 <- [0x0000001040 - 0x000000104f] size 0x00000010 gran 0x04 io
PCI: 00:02.0 10 <- [0x0008000000 - 0x0008ffffff] size 0x01000000 gran 0x18 prefmem
PCI: 00:02.0 18 <- [0x00090b0000 - 0x00090b0fff] size 0x00001000 gran 0x0c mem
PCI: 00:02.0 30 <- [0x00090a0000 - 0x00090affff] size 0x00010000 gran 0x10 romem
PCI: 00:03.0 10 <- [0x0009080000 - 0x000909ffff] size 0x00020000 gran 0x11 mem
PCI: 00:03.0 14 <- [0x0000001000 - 0x000000103f] size 0x00000040 gran 0x06 io
PCI: 00:03.0 30 <- [0x0009000000 - 0x000907ffff] size 0x00080000 gran 0x13 romem
Done setting resources.
Done allocating resources.
BS: BS_DEV_RESOURCES run times (exec / console): 7 / 16 ms
Enabling resources...
PCI: 00:00.0 cmd <- 00
PCI: 00:01.0 cmd <- 00
PCI: 00:01.1 cmd <- 01
PCI: 00:01.3 cmd <- 00
PCI: 00:02.0 cmd <- 03
PCI: 00:03.0 cmd <- 03
done.
BS: BS_DEV_ENABLE run times (exec / console): 1 / 1 ms
Initializing devices...
CPU_CLUSTER: 0 init
Setting up local APIC 0x0
start_eip=0x00001000, code_size=0x00000031
Initializing CPU #0
CPU: vendor AMD device 663
CPU: family 06, model 06, stepping 03
Setting up local APIC 0x0
CPU #0 initialized
All AP CPUs stopped (0 loops)
CPU_CLUSTER: 0 init finished in 2 msecs
PCI: 00:00.0 init
Assigning IRQ 10 to PCI: 00:01.3
Assigning IRQ 11 to PCI: 00:03.0
PCI: 00:00.0 init finished in 3 msecs
PCI: 00:01.0 init
RTC Init
IOAPIC: Initializing IOAPIC at 0xfec00000
IOAPIC: ID = 0x02
IOAPIC: 24 interrupts
IOAPIC: Clearing IOAPIC at 0xfec00000
IOAPIC: Bootstrap Processor Local APIC = 0x00
PCI: 00:01.0 init finished in 1 msecs
PCI: 00:01.1 init
IDE: Primary IDE interface: on
IDE: Secondary IDE interface: on
IDE: Access to legacy IDE ports: off
PCI: 00:01.1 init finished in 0 msecs
PCI: 00:02.0 init
PCI: 00:02.0 init finished in 4 msecs
PCI: 00:03.0 init
PCI: 00:03.0 init finished in 0 msecs
Devices initialized
BS: BS_DEV_INIT run times (exec / console): 11 / 4 ms
Finalize devices...
Devices finalized
Copying Interrupt Routing Table to 0x000f0000... done.
Copying Interrupt Routing Table to 0x07f9b000... done.
PIRQ table: 128 bytes.
QEMU: firmware config: Found 'etc/table-loader'
QEMU: found ACPI tables in fw_cfg.
QEMU: firmware config: Found 'etc/acpi/rsdp'
QEMU: loading "etc/acpi/rsdp" to 0x7f77000 (len 20)
QEMU: firmware config: Found 'etc/acpi/tables'
QEMU: loading "etc/acpi/tables" to 0x7f77040 (len 131072)
QEMU: loaded ACPI tables from fw_cfg.
Looking on 0x07f77000 for valid checksum
Checksum 1 passed
Checksum 2 passed all OK
ACPI: * SSDT
Found 1 CPU(s).
ACPI: added table 4/32, length now 52
ACPI tables: 131136 bytes.
smbios_write_tables: 07f76000
SMBIOS firmware version is set to coreboot_version: '4.15-191-gb2e8bd8364'
SMBIOS: Unknown CPU or CPU doesn't support Deterministic Cache CPUID leaf
DOMAIN: 0000 (QEMU Northbridge i440fx)
QEMU: firmware config: Found 'etc/smbios/smbios-tables'
QEMU: found smbios tables in fw_cfg (len 327).
QEMU: coreboot type0 table found at 0x7f76040.
QEMU: loading smbios tables to 0x7f76084
SMBIOS tables: 459 bytes.
Writing table forward entry at 0x00000500
Wrote coreboot table at: 0x00000500, 0x10 bytes, checksum 37e5
Writing coreboot table at 0x07f9c000
0. 0000000000000000-0000000000000fff: CONFIGURATION TABLES
1. 0000000000001000-000000000009ffff: RAM
2. 00000000000a0000-00000000000fffff: RESERVED
3. 0000000000100000-0000000007f75fff: RAM
4. 0000000007f76000-0000000007fa4fff: CONFIGURATION TABLES
5. 0000000007fa5000-0000000007fd1fff: RAMSTAGE
6. 0000000007fd2000-0000000007ffffff: CONFIGURATION TABLES
7. 00000000fec00000-00000000fec00fff: RESERVED
8. 00000000ff800000-00000000ffffffff: RESERVED
FMAP: area COREBOOT found @ 200 (67108352 bytes)
Wrote coreboot table at: 0x07f9c000, 0x2e8 bytes, checksum f33f
coreboot table: 768 bytes.
IMD ROOT 0. 0x07fff000 0x00001000
IMD SMALL 1. 0x07ffe000 0x00001000
CONSOLE 2. 0x07fde000 0x00020000
TIME STAMP 3. 0x07fdd000 0x00000910
ROMSTG STCK 4. 0x07fdc000 0x00001000
AFTER CAR 5. 0x07fd2000 0x0000a000
RAMSTAGE 6. 0x07fa4000 0x0002e000
COREBOOT 7. 0x07f9c000 0x00008000
IRQ TABLE 8. 0x07f9b000 0x00001000
ACPI 9. 0x07f77000 0x00024000
SMBIOS 10. 0x07f76000 0x00001000
IMD small region:
IMD ROOT 0. 0x07ffec00 0x00000400
RO MCACHE 1. 0x07ffe980 0x00000270
FMAP 2. 0x07ffe8c0 0x000000b6
BS: BS_WRITE_TABLES run times (exec / console): 10 / 7 ms
CBFS: Found 'fallback/payload' @0x17500 size 0x36c32 in mcache @0x07ffeb80
Checking segment from ROM address 0xfc01772c
Checking segment from ROM address 0xfc017748
Loading segment from ROM address 0xfc01772c
code (compression=1)
New segment dstaddr 0x01110000 memsize 0x7fb83 srcaddr 0xfc017764 filesize 0x36bfa
Loading Segment: addr: 0x01110000 memsz: 0x000000000007fb83 filesz: 0x0000000000036bfa
using LZMA
Loading segment from ROM address 0xfc017748
Entry Point 0x01110015
BS: BS_PAYLOAD_LOAD run times (exec / console): 113 / 2 ms
Jumping to boot code at 0x01110015(0x07f9c000)
U-Boot 2019.04 (Nov 20 2021 - 17:49:25 +0000)
CPU: x86_64, vendor AMD, device 663h
DRAM: 127.1 MiB
MMC:
Video: No video mode configured in coreboot!
Video: No video mode configured in coreboot!
Model: coreboot x86 payload
Net: e1000: 52:54:00:12:34:56
Warning: e1000#0 using MAC address from ROM
eth0: e1000#0
No controllers found
Finalizing coreboot
Hit any key to stop autoboot: 0
Error: Invalid Boot Flag (found 0x0000, expected 0xaa55)
## Kernel loading failed ...
zboot - Boot bzImage
Usage:
zboot [addr] [size] [initrd addr] [initrd size]
addr - The optional starting address of the bzimage.
If not set it defaults to the environment
variable "fileaddr".
size - The optional size of the bzimage. Defaults to
zero.
initrd addr - The address of the initrd image to use, if any.
initrd size - The size of the initrd image to use, if any.
=> ide info
=> ide reset
Reset IDE: Bus 0: OK Bus 1: OK
Device 0: Model: QEMU HARDDISK Firm: 2.5+ Ser#: QM00001
Type: Hard Disk
Supports 48-bit addressing
Capacity: 504.0 MB = 0.4 GB (1032192 x 512)
Device 1: not available
Device 2: Model: QEMU Firm: 2.5+ Ser#: QEMU DVD-ROM
Type: Removable CD ROM
Capacity: not available
Device 3: not available
=> ide info
Device 0: Model: QEMU HARDDISK Firm: 2.5+ Ser#: QM00001
Type: Hard Disk
Capacity: 258048.0 MB = 252.0 GB (528482304 x 512)
=> fatls ide 0
43363 main.efi
6570 u-boot.dtb
494080 u-boot-payload.efi
10687 NvVars
549376 u-boot-app.efi
5 file(s), 0 dir(s)
=> fatload ide 0:1 0x01000000 main.efi
43363 bytes read in 20 ms (2.1 MiB/s)
=> bootefi 0x01000000
Scanning disk ide.blk#0...
Found 2 disks
Video: No video mode configured in coreboot!
WARNING: booting without device tree
## Starting EFI application at 01000000 ...
WARNING: using memory device/image path, this may confuse some payloads!
Hello, world!
## Application terminated, r = 0
=>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment