asinfo

Updated: April 19, 2023

Array of structures describing different sections of the system memory map (e.g., RAM, SRAM, flash, I/O ranges)

The asinfo (Address Space Information) section consists of an array of asinfo structures:
start
The first physical address of the range being described.
end
The last physical address of the range being described. Note that this is the actual last byte, not one beyond the end.
owner
An offset from the start of the section giving the owner of this entry (its “parent” in the tree). It's set to AS_NULL_OFF if the entry doesn't have an owner (it's at the “root” of the address space tree).
name
An offset from the start of the strings section of the system page giving the string name of this entry.
attr
A bitfield describing attributes of the address range (see attr below).
priority
Indicates the speed of the memory in the address range. A smaller number means slower memory. The macro AS_PRIORITY_DEFAULT is defined to use a default value for this field (currently defined as 100).
alloc_checker
Not currently used.

Each array entry describes the attributes of one address space section on the machine. The memory map has a tree format; that is, an address range can have a parent. The information in the asinfo structures can be hard-coded from the system memory map, or read in from the memory controller.

When procnto is managing virtual memory for process address spaces, it uses the information in asinfo to know from where in RAM it can allocate memory.

attr

The attr field can have the following bits:
AS_ATTR_READABLE 0x0001
Address range is readable.
AS_ATTR_WRITABLE 0x0002
Address range is writable.
AS_ATTR_CACHABLE 0x0004
Address range can be cached (this bit should be off if you're using device memory).
AS_ATTR_VISIBLE 0x0008
Other entries can know this entry exists, but not read its contents.
AS_ATTR_KIDS 0x0010
Other entries use this entry as their owner.
The library turns on this bit automatically; you shouldn't specify it when creating the section.
AS_ATTR_CONTINUED 0x0020
Multiple entries are used to describe one “logical” address range. This bit will be on in all but the last entry.
The library turns on this bit and uses it internally; you shouldn't specify it when creating the section.

Address space trees

The asinfo section contains trees describing address spaces (where RAM, ROM, flash, etc. are located).

The general hierarchy for address spaces is:
/memory/memclass/...
or:
/io/memclass/...
or:
/memory/io/memclass/...

The memory or io indicates if this entry describes something in the memory or the I/O address space. The third form (/memory/io/memclass/...) is used on machines without separate in/out instructions and where everything is memory-mapped.

The memclass is something like ram, rom, flash, etc. Below memclass are further classifications, allowing the process manager to provide typed memory support.

Understanding pidin asinfo output

A brief examination of the following sample output from pidin syspage=asinfo (see pidin) may help you understand better the information stored in the in the syspage asinfo array of structures:

Header size=0x00000108, Total Size=0x00000eb8, #Cpu=16, Type=256
Section:asinfo offset:0x00000818 size:0x00000420 elsize:0x00000020
0000) 0000000000000000-000000000000ffff o:ffff a:0000 p:100 c:0 n:/io
0020) 0000000000000000-000fffffffffffff o:ffff a:0010 p:100 c:0 n:/memory
0040) 0000000000000000-00000000ffffffff o:0020 a:0010 p:100 c:0 n:/memory/below4G
0060) 0000000000000000-0000000000ffffff o:0020 a:0010 p:100 c:0 n:/memory/isa
0080) 0000000006000000-00000000ffefffff o:0020 a:0013 p:100 c:0 n:/memory/device
00a0) 00000000fff00000-00000000ffffffff o:0020 a:0005 p:100 c:0 n:/memory/rom
00c0) 0000000000000000-000000000009ffff o:0060 a:0017 p:100 c:0 n:/memory/isa/ram
00e0) 0000000000100000-0000000000ffffff o:0060 a:0037 p:100 c:0 n:/memory/isa/ram
0100) 0000000001000000-0000000005ffffff o:0040 a:0037 p:100 c:0 n:/memory/below4G/ram
0120) 0000000006000000-00000000772cafff o:0080 a:0017 p:100 c:0 n:/memory/device/ram
0140) 00000000772db000-000000007d5e4fff o:0080 a:0017 p:100 c:0 n:/memory/device/ram
0160) 000000007e0c2000-000000007f7fffff o:0080 a:0017 p:100 c:0 n:/memory/device/ram
0180) 0000000100000000-000000027fffffff o:0020 a:0017 p:100 c:0 n:/memory/ram
01a0) 000000007e0f8000-000000007e0f8023 o:0020 a:0007 p:100 c:0 n:/memory/acpi_rsdp
01c0) 00000000fee00000-00000000fee003ef o:0020 a:0003 p:100 c:0 n:/memory/lapic
01e0) 000000000142b308-0000000002c1caaf o:0020 a:0005 p:100 c:0 n:/memory/imagefs
0200) 0000000001400200-000000000142b307 o:0020 a:0007 p:100 c:0 n:/memory/startup
0220) 000000000142b308-0000000002c1caaf o:0020 a:0007 p:100 c:0 n:/memory/bootram
0240) 0000000000000000-00000000ffffffff o:ffff a:0010 p:100 c:0 n:/virtual
0260) ffff800000002000-ffff8000000f3590 o:0240 a:0000 p:100 c:0 n:/virtual/vboot
0280) 0000000000001000-000000000003efff o:00c0 a:0007 p:100 c:0 n:/memory/isa/ram/sysram
02a0) 0000000000040000-000000000009ffff o:00c0 a:0007 p:100 c:0 n:/memory/isa/ram/sysram
02c0) 0000000000100000-0000000000107fff o:00e0 a:0007 p:100 c:0 n:/memory/isa/ram/sysram
02e0) 000000000010e000-0000000000112fff o:00e0 a:0007 p:100 c:0 n:/memory/isa/ram/sysram
0300) 0000000000119000-0000000000243fff o:00e0 a:0007 p:100 c:0 n:/memory/isa/ram/sysram
0320) 0000000000245000-0000000000ffffff o:00e0 a:0027 p:100 c:0 n:/memory/isa/ram/sysram
0340) 0000000001000000-000000000142afff o:0100 a:0007 p:100 c:0 n:/memory/below4G/ram/sysram
0360) 0000000002c1d000-0000000005ffffff o:0100 a:0027 p:100 c:0 n:/memory/below4G/ram/sysram
0380) 0000000006000000-00000000772cafff o:0120 a:0007 p:100 c:0 n:/memory/device/ram/sysram
03a0) 00000000772db000-000000007d5e4fff o:0140 a:0007 p:100 c:0 n:/memory/device/ram/sysram
03c0) 000000007e0c2000-000000007e0f7fff o:0160 a:0007 p:100 c:0 n:/memory/device/ram/sysram
03e0) 000000007f240000-000000007f7fffff o:0160 a:0007 p:100 c:0 n:/memory/device/ram/sysram
0400) 0000000100000000-0000000279fc3fff o:0180 a:0007 p:100 c:0 n:/memory/ram/sysram

The following is information about the system page entry:

Header size=0x00000108, Total Size=0x00000eb8, #Cpu=16, Type=256
Section:asinfo offset:0x00000818 size:0x00000420 elsize:0x00000020

where the first line describes the system page (see size, total_size, num_cpu, and type under System Page); and the second line describes the asinfo structure array:

offset:0x00000818
The offset, in bytes, of the asinfo structure array in the system page.
size:0x00000420
The size, in bytes, of the asinfo structure array.
elsize:0x00000020
The size, in bytes, of each element in the asinfo structure array.

The above information is followed by a list of the asinfo elements, each one describing a section of memory on the system. Notice that the number in the first column increments by the size of the element (0x20).

If we parse this line and refer to the description of asinfo above:

0360) 0000000002c1d000-0000000005ffffff o:0100 a:0027 p:100 c:0 n:/memory/below4G/ram/sysram

we learn the following:

0360)
This entry's offset (displayed as a hexadecimal value) within the asinfo structure array.
0000000002c1d000
The memory region's offset in memory (start).
0000000005ffffff
The offset in memory of the last byte of this memory region (end).
o:0100
The owner of the memory region, displayed as the hexadecimal offset of the parent region.
a:0027
This memory region's attributes; this value is a bitmap, displayed as a hexadecimal value (attr)
p:100
The memory region's priority, displayed as a decimal value (priority).
c:0
Not currently used (alloc_checker).
n:/memory/below4G/ram/sysram
The memory region's descriptive name. Note that this name uses a tree to describe the memory region (name; see Address space trees above).

For more information about: