What I'm looking for is how to display memory range information in FreeBSD.
In Linux there is an entry in the /proc filesystem called iomem which displays memory regions, reservation and usage, etc. As you know memory is not just a flat block of RAM, though it is presented that way to applications - the reality is that memory address space is partitioned into various regions, sometimes including a 384k hole, another one from 15-16Mb, shadow BIOS copy, the PCI and PCIe address space, AGP aperture, shared video ram, etc. An example of /proc/iomem looks something like this:
which clearly breaks down the address space into reservations and gives detail of which subsystem is holding which regions.
This post, "MMIO in FreeBSD", was made last year and asks a similar question - but the poster abandoned the question once they realized they were asking for "before POST" instead of "after boot". I have the second question now So far, the closest two options I've found have are:
* The freebsd-memory.sh script (available here: https://github.com/ocochard/myscripts/blob/master/FreeBSD/freebsd-memory.sh), which parses output from sysctl(8) to display some tables of RAM information... while it does show "reserved", "free" etc. it is not broken down by region.
* memcontrol(8), which allows the user to view and edit MTRR settings - this does allow manipulating memory regions, but it's for changing cache settings and stuff. Not really the same thing.
If no equivalent exists, but someone has tips on where the information might be stored in the kernel, I wouldn't mind getting my hands dirty to produce some kind of tool to provide a similar report.
In Linux there is an entry in the /proc filesystem called iomem which displays memory regions, reservation and usage, etc. As you know memory is not just a flat block of RAM, though it is presented that way to applications - the reality is that memory address space is partitioned into various regions, sometimes including a 384k hole, another one from 15-16Mb, shadow BIOS copy, the PCI and PCIe address space, AGP aperture, shared video ram, etc. An example of /proc/iomem looks something like this:
Code:
00000000-0009fbff : System RAM
0009fc00-0009ffff : reserved
000a0000-000bffff : Video RAM area
000c0000-000c7fff : Video ROM
000f0000-000fffff : System ROM
00100000-07ffffff : System RAM
00100000-00291ba8 : Kernel code
00291ba9-002e09cb : Kernel data
e0000000-e3ffffff : VIA Technologies, Inc. VT82C597 [Apollo VP3]
e4000000-e7ffffff : PCI Bus #01
e4000000-e4003fff : Matrox Graphics, Inc. MGA G200 AGP
e5000000-e57fffff : Matrox Graphics, Inc. MGA G200 AGP
e8000000-e8ffffff : PCI Bus #01
e8000000-e8ffffff : Matrox Graphics, Inc. MGA G200 AGP
ea000000-ea00007f : Digital Equipment Corporation DECchip 21140 [FasterNet]
ea000000-ea00007f : tulip
ffff0000-ffffffff : reserved
which clearly breaks down the address space into reservations and gives detail of which subsystem is holding which regions.
This post, "MMIO in FreeBSD", was made last year and asks a similar question - but the poster abandoned the question once they realized they were asking for "before POST" instead of "after boot". I have the second question now So far, the closest two options I've found have are:
* The freebsd-memory.sh script (available here: https://github.com/ocochard/myscripts/blob/master/FreeBSD/freebsd-memory.sh), which parses output from sysctl(8) to display some tables of RAM information... while it does show "reserved", "free" etc. it is not broken down by region.
* memcontrol(8), which allows the user to view and edit MTRR settings - this does allow manipulating memory regions, but it's for changing cache settings and stuff. Not really the same thing.
If no equivalent exists, but someone has tips on where the information might be stored in the kernel, I wouldn't mind getting my hands dirty to produce some kind of tool to provide a similar report.