Re: FreeBSD EFI projects

From: Konstantin Belousov <kostikbel_at_gmail.com>
Date: Mon, 17 Sep 2018 23:09:35 +0300
On Mon, Sep 17, 2018 at 12:17:25PM -0600, Warner Losh wrote:
> On Sun, Sep 16, 2018 at 11:29 PM Rebecca Cran <rebecca_at_bluestop.org> wrote:
> I've had some interest on #bsdmips about booting a 64-bit FreeBSD on old
> > Apple systems that use 32-bit EFI: it sounds like it should be possible,
> > and is something I'd like to try and get working.
> >
> 
> That should be possible, but there's a number of issue dealing with the
> 32-bit EFI not having a direct map that we can use to generate the mapping
> tables we need for the loader early in our boot. It's why we can't call the
> EFI runtime on armv7, for example.

Having EFI RT working when 64bit kernel is booted from 32bit EFI
environment is very non-trivial. DMAP is not an issue at all, loaders do
not use or need it (in fact loaders run with the 1:1 mapping or disabled
paging).  RT requires calling into 32 bit mode from 64 bit.  This is hard
to do since kernel interrupt and fault handlers assume that kernel mode
means flat 64bit.  Interrupts would switch to 64 bit, but existing kernel
code cannot handle such switch.  Just do not provide RT for 32bit EFI.

That said, making only the loader->kernel transition from EFI 32bit to
64bit kernel should be not too hard, and even significantly simpler than
to make 32bit EFI load 32bit kernel. amd64 kernels already aware that
there might be no BIOS and they do not try to make vm86 calls into real
code, and only read memory map from the loader metadata etc.

Besides old Macs, this should also benefit newer Intel embedded-like
boards.
Received on Mon Sep 17 2018 - 18:09:55 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:18 UTC