Page MenuHomeFreeBSD

Add a sysctl to export the EFI memory map.
ClosedPublic

Authored by jhb on Sep 12 2014, 9:03 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 27, 11:02 AM
Unknown Object (File)
Jan 13 2024, 12:25 PM
Unknown Object (File)
Oct 29 2023, 3:11 AM
Unknown Object (File)
Sep 3 2023, 10:54 PM
Unknown Object (File)
Jul 15 2023, 11:13 AM
Unknown Object (File)
Jul 7 2023, 7:13 PM
Unknown Object (File)
Jul 2 2023, 7:57 AM
Unknown Object (File)
Jul 2 2023, 7:57 AM
Subscribers
None

Details

Summary

Add a sysctl to export the EFI memory map along with a handler in the
sysctl(8) binary to format it.

Test Plan

I don't have an EFI-booting machine handy to test this, so I'm hoping
to cajole someone else into testing this for me.

Diff Detail

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

Event Timeline

jhb retitled this revision from to Add a sysctl to export the EFI memory map..
jhb updated this object.
jhb edited the test plan for this revision. (Show Details)
jhb added a reviewer: emaste.
sbin/sysctl/sysctl.c
913 ↗(On Diff #1600)

Bah, your other commit hasn't trickled into my git repo yet:

/tank/emaste/src/freebsd/sbin/sysctl/sysctl.c:913:9: error: incompatible pointer types assigning to 'int (*)(int, void *)' from 'int (size_t, void *)' [-Werror,-Wincompatible-pointer-types]
                        func = S_efi_map;                                       
                             ^ ~~~~~~~~~
emaste edited edge metadata.

Looks fine to me and produces reasonable output.

Virtual column could be omitted perhaps since it's all 0x0, although it may be useful to see if something else does get reported there for some reason.

sys/amd64/amd64/machdep.c
2141 ↗(On Diff #1600)

Perhaps this warrants a comment.

This revision is now accepted and ready to land.Sep 13 2014, 1:26 AM

Can you reply to the commit with some sample output? I'm curious to see what it looks like.

sys/amd64/amd64/machdep.c
2141 ↗(On Diff #1600)

This is actually true of all the metadata passed from the loader to the kernel. There is a uint32_t preceding the pointer of each blob that contains the length of the blob.

jhb updated this revision to Diff 1608.

Closed by commit rS271495 (authored by @jhb).