History log of /haiku/src/system/boot/platform/efi/start.cpp
Revision Date Author Comments
# b965b55d 12-Mar-2023 Alexander von Gluck IV <kallisti5@unixzen.com>

efi/serial: re-init serial after efi detatchment

* This prevents haiku from "messing" with the gUART until
EFI boot services are exiting.
* The previous design meant that our loader started fiddling
with the gUART while EFI BIOS services were still being
used. On the SiFive, this broke serial output.
* Now, we guard on serial_init if EFI is unavailable, and
only fallback to direct UART usage when EFI is no longer
available.
* tldr; we're more closely managing serial across architectures
* serial_init use EFI and init it
* kernel_serial_handoff, stop using EFI
* serial_init, oh no EFI. Use gUART and Init it
* one gap is likely if no serial is available in EFI, but I
haven't seen that yet.

Change-Id: I644b51e4912272110435d288a95517d43a76740d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6200
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>


# 81a892ed 04-Jan-2023 Alexander von Gluck IV <kallisti5@unixzen.com>

efi/serial: Refactor EFI bios serial services

* Convert x86 direct port I/O to our standard gUART.
* sSerial is plainly EFI Serial or EFI Stdout
* gUART is plainly hardware serial now

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


# 18e885db 13-Dec-2021 David Karoly <karolyd577@gmail.com>

boot/efi: implement convert_kernel_args for 32-bit

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


# af90bfd3 15-Dec-2021 David Karoly <karolyd577@gmail.com>

boot/efi: introduce arch_convert_kernel_args

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


# a8577583 14-Dec-2021 David Karoly <karolyd577@gmail.com>

boot/efi/x86: fix address for arch args

Change-Id: If9a3bb32cb8d290f97cee2e8e821dcbf8b8852a8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4789
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>


# 4d1c5907 17-Sep-2021 Augustin Cavalier <waddlesplash@gmail.com>

EFI: Hand off bootloader log to the kernel.

Eventually, EFI should get support for the debug log ring_buffer
like bios_ia32 has for transparent handoffs, but this preserves
everything except for the pre-start MMU dump, which is an improvement.

Fixes #15455.


# f1fa58bf 25-Jul-2021 X512 <danger_mail@list.ru>

haiku_loader.efi: update for riscv64

* Added MMU page table generation.
* Added optional FDT device detection and passing to kernel.
* Add platform address translation stubs to bios_ia32
to drop EFI ifdefs

Change-Id: I89257c93c84404fd988f621b29f927ed0df3c3b1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4304
Reviewed-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# cd9b0eed 14-May-2021 Han Pengfei <pengphei@qq.com>

efi/dtb: Fix dtb malloc failed for kernel args

kernel_args_malloc should be used after heap_init, or it will failed
when we new some region instance.

Change-Id: I457057b1e0ff6d4def9e101485e38fec1848d8de
Signed-off-by: Han Pengfei <pengphei@qq.com>
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3912
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 6df09499 08-Feb-2021 beaglejoe <beaglejoe13@gmail.com>

Implement reboot for x86_64 efi menu

Fixes #15050

Change-Id: I9b0d8dab9cc0eba85f6d242e946d0291c59580eb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3740
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>


# 569564c0 21-Dec-2020 Alexander von Gluck IV <kallisti5@unixzen.com>

efi/dtb: Find potential FDT on UEFI

* Makes our UEFI bootloader somewhat FDT/DTB aware on all
architectures.
* Will report when an FDT is found, and provide it to kernels
that want it.

Change-Id: I90324fc0579a9c835e60568fa9b654c2df0aba27
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3543
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 05586741 11-Sep-2020 Alexander von Gluck IV <kallisti5@unixzen.com>

efi: fix pointer width on non-64-bit platforms

Change-Id: I041238af87df3e1e3a967216685413801fd49877
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2450
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>


# 312ace56 29-Jul-2020 Alexander von Gluck IV <kallisti5@unixzen.com>

bootloader/efi: Support 32-bit kernels

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


# 11f8b65a 20-Feb-2020 Jérôme Duval <jerome.duval@gmail.com>

boot_loader: load intel microcode update data file

Previous version of the patch was broken by the EFI refactoring.

Change-Id: I6dd125100b22b2461c531bfd8f81b3dd28e2b751
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2409
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>


# 6f857fa9 23-Mar-2020 waddlesplash <waddlesplash@gmail.com>

Revert "boot_loader: load intel microcode update data file"

This reverts commit a7320593242cc0863fc909c1a32dbd255384d7dd.

It broke the build on most boot platforms (including EFI.)


# a7320593 20-Feb-2020 Jérôme Duval <jerome.duval@gmail.com>

boot_loader: load intel microcode update data file

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


# 9775b1fb 09-Mar-2020 Alexander von Gluck IV <kallisti5@unixzen.com>

boot/efi: Revert gFDT portion of hrev53960

Change-Id: I6337aea8054840f36d41ac51cf8856eb04c0e6ba


# 9b91a310 09-Mar-2020 Alexander von Gluck IV <kallisti5@unixzen.com>

system/boot/efi: Tweaks to get arm efi further

* Store gFDT as a global in efi to appease non-x86
* gFDT might need refactored out of fdt bus_manager?

Change-Id: I3fb1be04ceb696677aa5476381786c36adc6fc0a


# 71680f7b 22-Feb-2020 Alexander von Gluck IV <kallisti5@unixzen.com>

efi: Cleanup arch_mmu, drop extra arch_timer.h

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


# d2986cb6 21-Feb-2020 Alexander von Gluck IV <kallisti5@unixzen.com>

system/boot: More cleanup and shuffling

* arm efi additions
* cleanup some cpu headers which were oddly
split between efi and bios_ia32
* Move calculate_cpu_conversion_factor over to
arch_timer since it is timerish, and x86 only
* Drop some duplicated code from efi start. Move
hpet init code into efi timer/hpet code

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


# 04f1baa7 05-Feb-2020 Alexander von Gluck IV <kallisti5@unixzen.com>

EFI: Make our haiku_loader architecture agnostic

* This is the bulk of the work. Anything else should be
minor cleanups and tweaking.
* riscv64 isn't a viable EFI platform yet.. just acting
as a stand-in to test a non-x86 EFI haiku_loader

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


# d38ba84d 11-Feb-2020 Alexander von Gluck IV <kallisti5@unixzen.com>

efi: Add quirks for some unicorn Apple EFI protocols

* grub and linux do the same thing.
* Based on MIT code here:
https://github.com/0xbb/apple_set_os.efi/blob/master/apple_set_os.c

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


# 7b4d924f 04-Dec-2019 Andrej Antunovikj <tunas@cryptolab.net>

cpu: Extract shared x86 code from efi & bios_ia32

This issue was initially detected by PVS Studio (issue number V547) and fixed
as part of Google Code-in 2019.

The initial problem was the calculate_cpu_conversion_factor function
which had been copied in the BIOS and EFI versions of the boot code.
Further investigation led to more duplicated or very similar functions
being identified.

Introduce an arch_cpu.h for the x86 boot platform to group these things
in a single place, and adjust the BIOS and EFI code to call into that.
Note that the BIOS and EFI code is still a little platform specific,
ideally there should be a boot_arch_cpu_init() function for each
architecture as already done for openfirmware and u-boot.

Also remove some irrelevant comments from copypasted files for other
architectures, as that was filling my git grep with useless noise.

Change-Id: I16d815f0bf015cec0b4e03cc14f3cc447c7164c5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1985
Reviewed-by: Adrien Destugues <pulkomandy@gmail.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>


# b482adb1 01-Nov-2019 Alexander von Gluck IV <kallisti5@unixzen.com>

kernel/boot/efi: Continue breaking apart arch-specific code; hpet

* Move x86 hpet behind timer interface.
* Add a few if x86,x86_64 macros to start.cpp.

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


# 7c32619c 02-Oct-2019 Alexander von Gluck IV <kallisti5@unixzen.com>

boot/platform: Break x86 code away from core EFI code

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


# 47a21c5c 30-Aug-2019 Augustin Cavalier <waddlesplash@gmail.com>

s/Haiku License/MIT License/g.

They are the same thing.


# a287df1c 11-Jun-2018 Augustin Cavalier <waddlesplash@gmail.com>

efi: Fix bad mode changes from previous commit.


# 86b12d85 10-Jun-2018 Jessica Hamilton <jessica.l.hamilton@gmail.com>

efi: move various init before call to main().

* With the previous commit, we can now move functions that require
calling mmu_map_physical_memory to where they should have been
originally. This also allows the SMP safe mode menu entries to
be properly generated, now that smp_init is called prior to
main().

Change-Id: I05ddca5273b11cb4846021664c1ea2cf8ba723b7


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

Revert "efi: force boot menu to show."

This reverts commit 3ceaa03c60fc54f9bbf3da2de1303bec6156d5ac.


# 3ceaa03c 07-Jan-2018 Jessica Hamilton <jessica.l.hamilton@gmail.com>

efi: force boot menu to show.


# 57b59d47 06-Jan-2017 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

memset was done twice


# 9e487d8d 15-Dec-2016 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

UEFI: serial debugging support.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>


# a99a0c00 02-May-2015 Nick Smallbone <nick.smallbone@gmail.com>

EFI: add support for SMP.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>


# ec239abc 25-Apr-2015 Jessica Hamilton <jessica.l.hamilton@gmail.com>

EFI: implement mmu_map_physical_memory & mmu_free.

Also move cpu, acpi, hpet init into platform_start_kernel, as we
need an initialised heap for alllocating memory for recording
the mapped regions.


# a7142a50 28-Apr-2015 Jessica Hamilton <jessica.l.hamilton@gmail.com>

EFI: add cpu.cpp from bios_ia32


# a1d0102e 25-Apr-2015 Jessica Hamilton <jessica.l.hamilton@gmail.com>

EFI: add support for HPET


# 6e6efaec 24-Apr-2014 Jessica Hamilton <jessica.l.hamilton@gmail.com>

EFI: add ACPI support

Also add support in the kernel to get the ACPI RSDP from the
bootloader, and pass onto the ACPI driver using get_boot_item.


# 82dcc316 22-Oct-2014 Henry Harrington <henry.harrington@gmail.com>

bootloader: Translate kernel args before adding them to kernel_args_range.

Chunks may be physically contiguous, but virtually disjoint. Adding
physical addresses may cause ranges to be merged incorrectly.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>


# 34a6dd67 21-Oct-2014 Henry Harrington <henry.harrington@gmail.com>

EFI: Initialize/load the GDT.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>


# b3215a62 21-Oct-2014 Henry Harrington <henry.harrington@gmail.com>

EFI: preliminary support for starting the kernel.

Enough to let the kernel to print hello, but not much beyond that.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>


# 96f4d68b 22-Jun-2016 Jessica Hamilton <jessica.l.hamilton@gmail.com>

EFI: check for boot keys

* Only supports spacebar for the boot menu, and escape for
enabling debug output. Shift keys will not work.


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

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


# 735f1dae 30-Nov-2013 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

EFI: Implement console code.