Difference between revisions of "Meminfo.c32"

From Syslinux Wiki
Jump to: navigation, search
(Add Category "Examples". Wiki formatting. Minor modifications to the text.)
m (Wiki formatting.)
Line 36: Line 36:
 
--><!-- |
 
--><!-- |
 
--><!--  boot: meminfo.c32
 
--><!--  boot: meminfo.c32
--><!--  [[#INT 15h|INT 15h]] = f000:f859  [[#DOS RAM|DOS RAM]]: 639K (0x9fc00)  [[#INT 12h|INT 12h]]: 639K (0x9fc00)
+
--><!--  [[#INT_15h|INT 15h]] = f000:f859  [[#DOS_RAM|DOS RAM]]: 639K (0x9fc00)  [[#INT_12h|INT 12h]]: 639K (0x9fc00)
--><!--  [[#INT 15h 88|INT 15 88]]: 0xfc00 (64512K)  [[#INT 15h e801|INT 15 E801]]: 0x3c00 (15360K) 0x0300 (49152K)
+
--><!--  [[#INT_15h_88|INT 15 88]]: 0xfc00 (64512K)  [[#INT_15h_e801|INT 15 E801]]: 0x3c00 (15360K) 0x0300 (49152K)
 
--><!--  <span style="background-color: yellow; color: blue; ">      0</span> <span style="background-color: lime; color: fuchsia; ">0000000000000000</span> <span style="background-color: aqua; color: red; ">000000000009f000</span> <span style="background-color: blue; color: yellow; ">000000000009f000</span> <span style="background-color: olive; color: white; ">1 [-]</span> <span style="background-color: black; color: white; ">usable</span>
 
--><!--  <span style="background-color: yellow; color: blue; ">      0</span> <span style="background-color: lime; color: fuchsia; ">0000000000000000</span> <span style="background-color: aqua; color: red; ">000000000009f000</span> <span style="background-color: blue; color: yellow; ">000000000009f000</span> <span style="background-color: olive; color: white; ">1 [-]</span> <span style="background-color: black; color: white; ">usable</span>
 
--><!--  <span style="background-color: yellow; color: blue; ">      1</span> <span style="background-color: lime; color: fuchsia; ">000000000009f000</span> <span style="background-color: aqua; color: red; ">0000000000001000</span> <span style="background-color: blue; color: yellow; ">00000000000a0000</span> <span style="background-color: olive; color: white; ">2 [-]</span> <span style="background-color: black; color: white; ">reserved</span>
 
--><!--  <span style="background-color: yellow; color: blue; ">      1</span> <span style="background-color: lime; color: fuchsia; ">000000000009f000</span> <span style="background-color: aqua; color: red; ">0000000000001000</span> <span style="background-color: blue; color: yellow; ">00000000000a0000</span> <span style="background-color: olive; color: white; ">2 [-]</span> <span style="background-color: black; color: white; ">reserved</span>
Line 52: Line 52:
 
| colspan="6" | boot: meminfo.c32
 
| colspan="6" | boot: meminfo.c32
 
|-
 
|-
| colspan="6" | [[#INT 15h|INT 15h]] = f000:f859  [[#DOS RAM|DOS RAM]]: 639K (0x9fc00)  [[#INT 12h|INT 12h]]: 639K (0x9fc00)
+
| colspan="6" | [[#INT_15h|INT 15h]] = f000:f859  [[#DOS_RAM|DOS RAM]]: 639K (0x9fc00)  [[#INT_12h|INT 12h]]: 639K (0x9fc00)
 
|-
 
|-
| colspan="6" | [[#INT 15h 88|INT 15 88]]: 0xfc00 (64512K)  [[#INT 15h e801|INT 15 E801]]: 0x3c00 (15360K) 0x0300 (49152K)
+
| colspan="6" | [[#INT_15h_88|INT 15 88]]: 0xfc00 (64512K)  [[#INT_15h_e801|INT 15 E801]]: 0x3c00 (15360K) 0x0300 (49152K)
 
|- style="text-align: right; "
 
|- style="text-align: right; "
 
| style="background-color: yellow; color: blue; " | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 <br />1 <br />2 <br />3 <br />4 <br />5  
 
| style="background-color: yellow; color: blue; " | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0 <br />1 <br />2 <br />3 <br />4 <br />5  
Line 71: Line 71:
 
The information is displayed as the last few lines of the output  
 
The information is displayed as the last few lines of the output  
 
(in this instance, 6) starting (in the example) with:  
 
(in this instance, 6) starting (in the example) with:  
{|
+
{| style="text-align: left; white-space: nowrap; border: 1px dashed darkgray; font-family: monospace; " cellpadding="0" cellspacing="0" bgcolor="#f9f9f9"
|
+
|- style="text-align: right; "
        0 0000000000000000 000000000009f000 000000000009f000 1 [-] usable
+
| style="background-color: yellow; color: blue; " | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0  
 +
| style="background-color: lime; color: fuchsia; " | &nbsp;0000000000000000  
 +
| style="background-color: aqua; color: red; " | &nbsp;000000000009f000  
 +
| style="background-color: blue; color: yellow; " | &nbsp;000000000009f000  
 +
| style="background-color: olive; color: white; " | &nbsp;1 [-]  
 +
| style="background-color: black; color: white; text-align: left; " | &nbsp;usable
 
|}
 
|}
  
Line 112: Line 117:
 
* 5: unusable
 
* 5: unusable
  
 +
<br />
 
=== INT 15h ===
 
=== INT 15h ===
 
{|
 
{|
 
|
 
|
  [[#INT 15h|INT 15h]] = f000:f859  [[#DOS RAM|DOS RAM]]: 639K (0x9fc00)  [[#INT 12h|INT 12h]]: 639K (0x9fc00)
+
  [[#INT_15h|INT 15h]] = f000:f859  [[#DOS_RAM|DOS RAM]]: 639K (0x9fc00)  [[#INT_12h|INT 12h]]: 639K (0x9fc00)
 
|}
 
|}
 
List the segment and offset of the <code>INT 15h</code> handler,  
 
List the segment and offset of the <code>INT 15h</code> handler,  
 
as read from the interrupt vector table.
 
as read from the interrupt vector table.
  
 +
<br />
 
=== DOS RAM ===
 
=== DOS RAM ===
 
{|
 
{|
 
|
 
|
  [[#INT 15h|INT 15h]] = f000:f859  [[#DOS RAM|DOS RAM]]: 639K (0x9fc00)  [[#INT 12h|INT 12h]]: 639K (0x9fc00)
+
  [[#INT_15h|INT 15h]] = f000:f859  [[#DOS_RAM|DOS RAM]]: 639K (0x9fc00)  [[#INT_12h|INT 12h]]: 639K (0x9fc00)
 
|}
 
|}
 
It appears that this reads a value directly from memory.
 
It appears that this reads a value directly from memory.
  
 +
<br />
 
=== INT 12h ===
 
=== INT 12h ===
 
{|
 
{|
 
|
 
|
  [[#INT 15h|INT 15h]] = f000:f859  [[#DOS RAM|DOS RAM]]: 639K (0x9fc00)  [[#INT 12h|INT 12h]]: 639K (0x9fc00)
+
  [[#INT_15h|INT 15h]] = f000:f859  [[#DOS_RAM|DOS RAM]]: 639K (0x9fc00)  [[#INT_12h|INT 12h]]: 639K (0x9fc00)
 
|}
 
|}
 
The results from calling <code>INT 12h</code>.  
 
The results from calling <code>INT 12h</code>.  
 
List the available low memory (under 640k).
 
List the available low memory (under 640k).
  
 +
<br />
 
=== INT 15h 88 ===
 
=== INT 15h 88 ===
 
{|
 
{|
 
|
 
|
  [[#INT 15h 88|INT 15 88]]: 0xfc00 (64512K)  [[#INT 15h e801|INT 15 E801]]: 0x3c00 (15360K) 0x0300 (49152K)
+
  [[#INT_15h_88|INT 15 88]]: 0xfc00 (64512K)  [[#INT_15h_e801|INT 15 E801]]: 0x3c00 (15360K) 0x0300 (49152K)
 
|}
 
|}
 
Results from <code>INT 15h, AH=88h</code>.  
 
Results from <code>INT 15h, AH=88h</code>.  
 
Return the size of extended memory (total RAM in KiB as a 16 bit quantity).
 
Return the size of extended memory (total RAM in KiB as a 16 bit quantity).
  
 +
<br />
 
=== INT 15h e801 ===
 
=== INT 15h e801 ===
 
{|
 
{|
 
|
 
|
  [[#INT 15h 88|INT 15 88]]: 0xfc00 (64512K)  [[#INT 15h e801|INT 15 E801]]: 0x3c00 (15360K) 0x0300 (49152K)
+
  [[#INT_15h_88|INT 15 88]]: 0xfc00 (64512K)  [[#INT_15h_e801|INT 15 E801]]: 0x3c00 (15360K) 0x0300 (49152K)
 
|}
 
|}
 
Results from <code>INT 15h AX=e801h</code>.  
 
Results from <code>INT 15h AX=e801h</code>.  

Revision as of 09:34, 2 August 2019

Meminfo.c32 displays the range/size of various memory functions.

Example

Here's an example (with some extra formatting for clarity) from within bochs with 64 MiB of RAM.

boot: meminfo.c32
INT 15h = f000:f859 DOS RAM: 639K (0x9fc00) INT 12h: 639K (0x9fc00)
INT 15 88: 0xfc00 (64512K) INT 15 E801: 0x3c00 (15360K) 0x0300 (49152K)
       0
1
2
3
4
5
 0000000000000000
000000000009f000
00000000000e8000
0000000000100000
0000000003ff0000
00000000fffc0000
 000000000009f000
0000000000001000
0000000000018000
0000000003ef0000
0000000000010000
0000000000040000
 000000000009f000
00000000000a0000
0000000000100000
0000000003ff0000
0000000004000000
0000000100000000
 1 [-]
2 [-]
2 [-]
1 [-]
3 [-]
2 [-]
 usable
 reserved
 reserved
 usable
 ACPI reclaim
 reserved

Meaning

INT 15h e820

Results from INT 15h AX=e820h. This is, for the most part, the most important of all of the memory functions, as it provides a map of available memory. The information is displayed as the last few lines of the output (in this instance, 6) starting (in the example) with:

       0  0000000000000000  000000000009f000  000000000009f000  1 [-]  usable

Line numbers are printed in hex as 8 characters wide with a space prefix. Each line represents the purpose/availability, address and length/size of a block of memory.

The first 64 bit hex quantity is the start address. The second is the length/size. The third is the end address (excluding the listed byte; calculated as start plus length). The next number is decimal for the type of memory. The next column is bracketed, either a single hyphen or a hex number representing the extended attributes.

The last column is the string representation of the type:

  • 1: usable
  • 2: reserved
  • 3: ACPI reclaim
  • 4: ACPI NVS
  • 5: unusable


INT 15h

INT 15h = f000:f859  DOS RAM: 639K (0x9fc00)  INT 12h: 639K (0x9fc00)

List the segment and offset of the INT 15h handler, as read from the interrupt vector table.


DOS RAM

INT 15h = f000:f859  DOS RAM: 639K (0x9fc00)  INT 12h: 639K (0x9fc00)

It appears that this reads a value directly from memory.


INT 12h

INT 15h = f000:f859  DOS RAM: 639K (0x9fc00)  INT 12h: 639K (0x9fc00)

The results from calling INT 12h. List the available low memory (under 640k).


INT 15h 88

INT 15 88: 0xfc00 (64512K)  INT 15 E801: 0x3c00 (15360K) 0x0300 (49152K)

Results from INT 15h, AH=88h. Return the size of extended memory (total RAM in KiB as a 16 bit quantity).


INT 15h e801

INT 15 88: 0xfc00 (64512K)  INT 15 E801: 0x3c00 (15360K) 0x0300 (49152K)

Results from INT 15h AX=e801h. Extended memory size with a larger limit (superseding AH=88h). The first pair of values is the return (in CX) and size of memory between 1 MiB and 16 MiB. The second pair of values is the return (in DX) and size of memory above 16 MiB in 64 KiB pages.

References