Page MenuHomeFreeBSD

Add support for ARM to the efi boot1 and loader
ClosedPublic

Authored by andrew on Apr 6 2015, 1:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 28 2024, 2:40 AM
Unknown Object (File)
Mar 28 2024, 2:40 AM
Unknown Object (File)
Feb 5 2024, 11:23 AM
Unknown Object (File)
Dec 25 2023, 5:06 PM
Unknown Object (File)
Dec 25 2023, 7:02 AM
Unknown Object (File)
Dec 13 2023, 4:00 AM
Unknown Object (File)
Nov 20 2023, 8:55 PM
Unknown Object (File)
Nov 6 2023, 4:10 AM
Subscribers

Details

Summary

This adds support to boot ARM with the efi loader. The kernel side
is still missing.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

andrew retitled this revision from to Add support for ARM to the efi boot1 and loader.
andrew updated this object.
andrew edited the test plan for this revision. (Show Details)
andrew added reviewers: emaste, imp.
emaste edited edge metadata.

overall looks fine to me

sys/arm/include/metadata.h
37–38 ↗(On Diff #4697)

What do you think about making these uint64_ts with the intent that the same metatada could be used everywhere?

sys/boot/efi/boot1/Makefile
40 ↗(On Diff #4697)

Out of curiosity why does only arm boot1 need it?

sys/boot/efi/include/arm/efibind.h
1–3 ↗(On Diff #4697)

can we share a common efibind.h?

This revision is now accepted and ready to land.Apr 6 2015, 2:30 PM
sys/boot/efi/boot1/Makefile
40 ↗(On Diff #4697)

Also, this should be LDADD+= ${LIBSTAND}, no?

sys/arm/include/metadata.h
37–38 ↗(On Diff #4697)

They probably should be, we could have > 4GiB of ram with LPAE.

sys/boot/efi/boot1/Makefile
40 ↗(On Diff #4697)

It's for the runtime functions the compiler assumes are available. As an alternative may be able to use compiler-rt. I'll add a comment explaining this.

I think this is correct, it should have DPADD+= ${LIBSTAND}. LIBSTAND is only correct when DESTDIR is set so may not be in buildenv.

sys/boot/efi/include/arm/efibind.h
1–3 ↗(On Diff #4697)

I think we could share large chunks, but would need to investigate further.

sys/boot/efi/boot1/Makefile
40 ↗(On Diff #4697)

It turns out we also need it for i386. Perhaps it makes sense to just include it unconditionally, and let the linker use it if needed or not.

sys/boot/efi/include/arm/efibind.h
1–3 ↗(On Diff #4697)

Yeah, perhaps with a few #ifdefs in it.

sys/boot/efi/loader/arch/arm/reloc.c
38 ↗(On Diff #4697)

ElfW_Dyn instead?

71–76 ↗(On Diff #4697)

I think we should use a common reloc.c with a bit of #ifdefery instead, actually - the i386/amd64/arm/arm64 implementations of this file are going to be >80% common, without more divergence over time I think.

#if defined(__arm__)
case R_ARM_RELATIVE:
#elif defined(__i386__)
case R_386_RELATIVE:
#endif
    /* Address relative to the base address. */
    newaddr = (unsigned long *)(ImageBase + rel->r_offset);
    *newaddr += ImageBase;
    break;
andrew updated this revision to Diff 4699.

Closed by commit rS281156 (authored by @andrew).