History log of /haiku/src/system/boot/platform/efi/devices.cpp
Revision Date Author Comments
# 6e28efbb 01-Dec-2021 David Karoly <karolyd577@gmail.com>

platform/efi/devices: fix build when TRACE is enabled

Change-Id: If9ea3212b7908aaa6c9c6774cb68a6dbf635a5ac
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4761
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# e82b4578 30-Nov-2021 David Karoly <karolyd577@gmail.com>

boot/efi/devices: fix warning for comparison signedness

Change-Id: I2a329c91d229a8672536ccdaa2c94db109390308
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4752
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>


# 2123a7cc 06-Jul-2021 Jessica Hamilton <jessica.l.hamilton@gmail.com>

efi: fix searching for additional Haiku installations

* platform_add_block_devices() is a no-op, as efi already
provides all devices to the generic loader code.
* remove iterator.Remove() in platform_get_boot_partitions()
as the simplified devices scan no longer duplicates
partition entries.

Fixes #17051

Change-Id: I38789b069e1be9b18312e2455bc91e6195114599
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4160
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>


# 62f80a2a 04-Jul-2021 Jessica Hamilton <jessica.l.hamilton@gmail.com>

loader: fetch all potential boot partitions for device

This also keeps the functionality of hrev53848, which simplifies the
list of disks searched for bootable partitions; however, it maintains
the previous behaviour of platform_get_boot_partitions that continues
to iterate over a list of possible boot partitions, which should
allow finding a bootable BFS partition better in more circumstances.

Particularly, there are numerous reports of the UEFI loader entering
the boot menu despite it finding a bootable partition, which this
should address.

EFI's device_contains_partition is also structured such that it
compares the disk GPT table of the partition the loader is
querying of the EFI disk's GPT table, in the case that there are
multiple disks, as the most reliable method of comparison, with
a generic fallback for non-GPT disks, which will be less reliable.

This reverts commit 0d932a49ada8af6314cd3f20c3f597143f1f555d.

Change-Id: I5fac8608035d56b8bb4dc6c3d495ec6db42fa9b7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4149
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>


# 552e0ac0 23-Mar-2021 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

UEFI: remove .._BOOTED_FROM_IMAGE, alwasy use ..HARD_DISK

BOOT_VOLUME_BOOTED_FROM_IMAGE is for booting from floppy images
(or CD equivalent) where you can't provide all details.
BOOT_METHOD_CD is also for when all you know that it is a "disc".

UEFI can always give partition offset and checksum, so we can
use BOOT_METHOD_HARD_DISK directly.

Change-Id: Iede9beef2f00eadd7883be0a739caf4eb11969c1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3820
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 3cd3b702 23-Jan-2021 Alexander von Gluck IV <kallisti5@unixzen.com>

boot/efi/devices: Use aligned readBuffer for blockio access

* Media->IoAlign dictates a memory alignment for block device
read buffers. If this alignment fails, sanity checks within
EFI bioses can prevent us from properly parsing filesystems
via failed BlockIO ReadBlocks calls.
* Use a static alignment of a sane 2048 which should meet most
alignment requirements
* Resolves RISCV64 not finding boot partitions. (and likely
fixes a similar issue on ARM)

Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Change-Id: I718511e8630a109414d90d0bae1470cc861a614f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3676
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>


# a704a197 20-Jul-2020 Alexander von Gluck IV <kallisti5@unixzen.com>

efi/devices: Skip qemu flash device for now due to crash

* An upstream bug exists which results in the tianocore
bios crashing when attempting to read from qemu's
(unconfigured, but present) flash device.

Change-Id: Ie9f02a290abc29cce3a5e279382750c0b14164dc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3049
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# b0f530ba 05-Jul-2020 Alexander von Gluck IV <kallisti5@unixzen.com>

efi/devices: Improve tracing, no functional change

Change-Id: Iefb4da99d148f9328a3bbfdf1bbeaec8cf97648a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2993
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 3a63d1ef 08-Feb-2020 Augustin Cavalier <waddlesplash@gmail.com>

EFI: Restore the previous logic for BOOT_VOLUME_BOOTED_FROM_IMAGE.

Fixes booting from USB drives on my machine after previous changes.


# bc8cfa3a 08-Feb-2020 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

EFI: Use BlockIO to find bootable disks

There is one efi_block_io_protocol per disk and one per partition.
All we need to do is find the disk ones and let Haiku find
bootable partitions.

There is a special case for a device with one fixed partition
which does not have one for disk, but it is unlikely we will
ever want to boot from such a device.

Fixes #15587.

Change-Id: I915870d6d3b19947bc58b32a969f9f89d2d2245d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2232
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 0d932a49 08-Feb-2020 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

Revert "loader: fetch all potential boot partitions for boot device."

This reverts commit e888217124fa9fb214ffa790e6a66dca3917f25e.

Change-Id: I06be82ac863f615796d9edc86f5ef903b8123a9d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2231
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 51429f04 20-Dec-2019 Jessica Hamilton <jessica.l.hamilton@gmail.com>

kernel/efi: Drop device_set_path_end. Fixes booting Haiku with EFI under qemu

Change-Id: Iafa6cf064675d5f2beb134a6c6a906d137c70dc5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2040
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>


# 485b5cf8 13-Dec-2019 Alexander von Gluck IV <kallisti5@unixzen.com>

efi: Refactor our EFI code to use fuchsia's cleaner EFI headers.

* Drop gnu-efi

Change-Id: Ib601fc8ced49b18281b6b98cf861a5aef1b9c065
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2026
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# ed7204fa 13-Dec-2019 Alexander von Gluck IV <kallisti5@unixzen.com>

gpt: Correct naming. efi_* also conflicts with some efi headers

Change-Id: I19b5b2c4609da8474b26588ae8d7d4caf72a826b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2018
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>


# e1b41d44 13-Jun-2010 Andreas Faerber <andreas.faerber@web.de>

boot loader: Wire up net_stack_cleanup()

Add a platform cleanup hook before starting the kernel. The openfirmware
and PXE loaders clean up their network stack there, while the other
loaders currently do nothing.

This closes ticket #6166

Change-Id: I34765892dfd9b2310c6af97c9ff7d414afae49e5
Reviewed-on: https://review.haiku-os.org/c/50
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# f5997212 04-May-2018 Jessica Hamilton <jessica.l.hamilton@gmail.com>

bootloader/efi: remove partition before adding to new list.

* A Node/Partition cannot be member of two lists at once. This
resolves an issue where a partition cannot be found later
due to corruption of a NodeList.


# e8882171 13-May-2017 Jessica Hamilton <jessica.l.hamilton@gmail.com>

loader: fetch all potential boot partitions for boot device.

This allows the loader to skip BFS partitions that don't contain
a bootable system. Useful when you have a BFS data partition that
comes before the system partition when iterated over.

Currently, only the UEFI loader actually returns more than one
possible partition.


# 6b4cbec0 06-Jan-2017 Jessica Hamilton <jessica.l.hamilton@gmail.com>

UEFI: identify the boot partition to check that it's valid.

* Also modified EFI::Header to return the efi_table_header so
that we can compare it to boot device partition table.


# 42e718f0 06-Jan-2017 Jessica Hamilton <jessica.l.hamilton@gmail.com>

UEFI: improve boot support in devices.cpp

* Maintain a list of all MESSAGING_DEVICE_PATH and
MEDIA_DEVICE_PATH handles, so we can avoid adding devices
multiple times.
* Split up platform_add_boot_device() into separate functions
for better readability (add_cd_devices, add_boot_device_for_image,
etc.).


# 1d830665 06-Jan-2017 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

Rewrote device handling in EFI boot-loader

This allows me to find and boot disks and cds(*)
platform_add_boot_device tries to find the disk of the EFI partition
As on other platforms if boot disk isn't found platform_add_block_devices
will be called.
platform_add_block_devices will find all block devices that arn't partitions as
they are handled by Haiku already.
Currently first found suitable partition will be selected.

TODO:
* pass in partition UUID's as boot-loader arg to setup boot for
any partition.
* Better cd detection
* Better disk_identifier

*) vfs_boot.cpp is very restrictive when it comes to booting cds.
It either do very Anyboot check where boot partition should be at offset 0,
which isn't true for EFI. In my case it's not even on that disk.
Or it only allow data session partition types.
This is currently failing as the Anyboot partition type is BFS.


# 2da1cb75 30-Aug-2016 Jessica Hamilton <jessica.l.hamilton@gmail.com>

EFI: device support for anyboot CDs.

I have tried to get normal ISOs working, but the bootloader doesn't
seem to detect any bootable partitions.


# e2e1558a 20-Apr-2016 Jessica Hamilton <jessica.l.hamilton@gmail.com>

EFI: stub functions so we can call loader's main() function.