Difference between revisions of "GeneveOS Memory Management Functions"
Jump to navigation
Jump to search
Line 10: | Line 10: | ||
|- | |- | ||
| | | | ||
! Input | ! Input !! Output | ||
! Output | |||
|- | |- | ||
| R0 | | R0 | ||
| Opcode (0000) | | Opcode (0000) || Error code (always 0) | ||
| Error code (always 0) | |||
|- | |- | ||
| R1 | | R1 | ||
| | | || Number of free pages | ||
| Number of free pages | |||
|- | |- | ||
| R2 | | R2 | ||
| | | || Number of fast free pages | ||
| Number of fast free pages | |||
|- | |- | ||
|} | |} | ||
Line 29: | Line 25: | ||
=== Claim pages into local map from free pages === | === Claim pages into local map from free pages === | ||
'''Opcode: 1''' | |||
{| class="plaincr" | |||
|- | |||
| | |||
! Input !! Output | |||
|- | |||
| R0 | |||
| Opcode (0001) || Error code | |||
|- | |||
| R1 | |||
| Number of pages || Number of pages actually fetched to complete map as required | |||
|- | |||
| R2 | |||
| Local page address || Number of fast pages fetched | |||
|- | |||
| R3 | |||
| Speed flag (0 is slow, else fast) || | |||
|- | |||
|} | |||
=== Return pages into free pool from local map === | === Return pages into free pool from local map === | ||
'''Opcode: 2''' | |||
{| class="plaincr" | |||
|- | |||
| | |||
! Input !! Output | |||
|- | |||
| R0 | |||
| Opcode (0002) || Error code | |||
|- | |||
| R1 | |||
| Number of pages || | |||
|- | |||
| R2 | |||
| Local page address || | |||
|- | |||
|} | |||
=== Map local page at excution page === | === Map local page at excution page === | ||
'''Opcode: 3''' | |||
{| class="plaincr" | |||
|- | |||
| | |||
! Input !! Output | |||
|- | |||
| R0 | |||
| Opcode (0003) || Error code | |||
|- | |||
| R1 | |||
| Local page number || | |||
|- | |||
| R2 | |||
| Execution page number || | |||
|- | |||
|} | |||
=== Get address map === | === Get address map === | ||
'''Opcode: 4''' | |||
{| class="plaincr" | |||
|- | |||
| | |||
! Input !! Output | |||
|- | |||
| R0 | |||
| Opcode (0004) || Error code | |||
|- | |||
| R1 | |||
| Execution address || Count of pages reported | |||
|- | |||
| R2 | |||
| Size of area for map || | |||
|- | |||
|} | |||
=== Declare shared pages === | === Declare shared pages === |
Revision as of 14:16, 11 November 2011
Memory management in MDOS is available via XOP 7.
General purpose XOPs
Return number of free pages in system
Opcode: 0
Input | Output | |
---|---|---|
R0 | Opcode (0000) | Error code (always 0) |
R1 | Number of free pages | |
R2 | Number of fast free pages |
Claim pages into local map from free pages
Opcode: 1
Input | Output | |
---|---|---|
R0 | Opcode (0001) | Error code |
R1 | Number of pages | Number of pages actually fetched to complete map as required |
R2 | Local page address | Number of fast pages fetched |
R3 | Speed flag (0 is slow, else fast) |
Return pages into free pool from local map
Opcode: 2
Input | Output | |
---|---|---|
R0 | Opcode (0002) | Error code |
R1 | Number of pages | |
R2 | Local page address |
Map local page at excution page
Opcode: 3
Input | Output | |
---|---|---|
R0 | Opcode (0003) | Error code |
R1 | Local page number | |
R2 | Execution page number |
Get address map
Opcode: 4
Input | Output | |
---|---|---|
R0 | Opcode (0004) | Error code |
R1 | Execution address | Count of pages reported |
R2 | Size of area for map |
opcode #5, declare shared pages pass: r1=number of pages to declare as shared r2=local page address r3=type to be assigned to shared pages return: r0=error code
opcode #6, release shared pages (type) pass: r1=type return: r0=error code also have to check their current execution map
opcode #7, get shared pages pass: r1=type r2=local page number for start of shared area return: r0=error code
opcode #8, return size of shared page group pass: r1=type return: r0=error code r1=number of pages in shared group
Privileged XOPs (only available for operating system)
Release task
opcode #9 : release task in: nil (task header at >8000) out: nil
Page get
opcode #A : page get in: r0=>000A r1=page number to get, if r1h <> 0, get first available r2=speed flag <>0 means fast out: r0=error code r1=pointer to node r2=page number from node
Add page to free pages in system
opcode #B : add page to free pages in system in: r0=>000B r1=page number out: r0= error if no free nodes available
Add a node to the list of free nodes
opcode #C : add a node to the list of free nodes in: r0=>000C r1=pointer to node out: no errors
Link a node to the specified node
opcode #D : link a node to the specified node in: r0=>000D r1=pointer to node r2=pointer to node to link to out: no errors
Get address map (system)
opcode #E, get address map (system) return: R0= count of valid pages