Page MenuHomeFreeBSD

kboot: Update amd64 to use enumerate_memory_arch()

Authored by imp on Jan 29 2023, 3:14 PM.
Referenced Files
Sun, Jun 23, 9:07 PM
Unknown Object (File)
Sat, Jun 22, 7:07 PM
Unknown Object (File)
Sat, Jun 22, 10:28 AM
Unknown Object (File)
Fri, Jun 21, 11:14 PM
Unknown Object (File)
Fri, Jun 21, 11:12 PM
Unknown Object (File)
Fri, Jun 21, 10:35 PM
Unknown Object (File)
Sun, May 26, 12:19 AM
Unknown Object (File)
Sun, May 26, 12:19 AM



Move memory enumeration to the enumerate_memory_arch(), tweak the code a
bit to make that fit into that framework.

Also fix a bug in the name of the end location. The old code never found
memory (though amd64 doesn't yet work, this lead to using fallback
addresses that were good enough for QEMU...).

Sponsored by: Netflix

Diff Detail

rG FreeBSD src repository
Lint Not Applicable
Tests Not Applicable

Event Timeline

rebase / refactor / redo

kevans added inline comments.

Now that it's a static 16 upper bound, this should probably be converted to a for loop for readability.


A DPRINTF or something might be nice, but this is still early enough stage that I don't think we really care; presumably this won't live too much longer.

This revision is now accepted and ready to land.Feb 2 2023, 3:25 AM

fair point. This is a static array, but we need to do something akin to what I've done in the aarch64 case with the code that's now living in seg.c. I should just use the 'avail' interface I think here. The limits are arbitrary, though this is the only way to snag the table, so I may need to have aux data the table that avail builds won't need... So I need to think about this feedback... But maybe the real answer is I need a dynamic array of what will become the UEFI table we need to ship into the kernel... I don't plan on supporting kboot from anything other than a UEFI booted kernel...


Yea, perhaps you are right... Though I think the 'avail' interface might largely obsolete this code.

update per review...

Make this a for loop, expand the number, and drop a comment it should be dynamic

This revision now requires review to proceed.Feb 2 2023, 4:15 AM
This revision was not accepted when it landed; it landed in state Needs Review.Feb 3 2023, 3:52 PM
This revision was automatically updated to reflect the committed changes.