Difference between revisions of "GeneveOS Memory Management Functions"

From Ninerpedia
Jump to navigation Jump to search
(Created page with "Memory management in MDOS is available via XOP 7. == General purpose XOPs == opcode #0, return number of free pages in system after return: r0=ERROR CODE (always zero) ...")
 
Line 2: Line 2:


== General purpose XOPs ==
== General purpose XOPs ==
=== Return number of free pages in system ===


  opcode #0, return number of free pages in system
  opcode #0, return number of free pages in system
Line 8: Line 10:
                     r2=number of fast free pages  
                     r2=number of fast free pages  
   
   
=== Claim pages into local map from free pages ===


  opcode #1, claim pages into local map from free pages
  opcode #1, claim pages into local map from free pages
Line 17: Line 20:
                             to complete map as required
                             to complete map as required
                         r2=number of fast pages fetched
                         r2=number of fast pages fetched
=== Return pages into free pool from local map ===


  opcode #2, return pages into free pool from local map
  opcode #2, return pages into free pool from local map
Line 22: Line 27:
                         r2=local page address
                         r2=local page address
       return:          r0=error code
       return:          r0=error code
=== Map local page at excution page ===


  opcode #3, map local page at excution page
  opcode #3, map local page at excution page
Line 27: Line 34:
                         r2=execution page number
                         r2=execution page number
       return:          r0=error code
       return:          r0=error code
=== Get address map ===


  opcode #4, get address map
  opcode #4, get address map
Line 33: Line 42:
       return:          r0=error code
       return:          r0=error code
                         r1=count of pages reported
                         r1=count of pages reported
=== Declare shared pages ===


  opcode #5, declare shared pages
  opcode #5, declare shared pages
Line 39: Line 50:
                         r3=type to be assigned to shared pages
                         r3=type to be assigned to shared pages
       return:          r0=error code
       return:          r0=error code
=== Release shared pages (type) ===


  opcode #6, release shared pages (type)
  opcode #6, release shared pages (type)
Line 44: Line 57:
       return:          r0=error code
       return:          r0=error code
       also have to check their current execution map
       also have to check their current execution map
=== Get shared pages ===


  opcode #7, get shared pages
  opcode #7, get shared pages
Line 49: Line 64:
                         r2=local page number for start of shared area
                         r2=local page number for start of shared area
       return:          r0=error code
       return:          r0=error code
=== Return size of shared page group ===


  opcode #8, return size of shared page group
  opcode #8, return size of shared page group
Line 56: Line 73:


== Privileged XOPs (only available for operating system) ==
== Privileged XOPs (only available for operating system) ==
=== Release task ===


  opcode #9 : release task    in: nil        (task header at >8000)
  opcode #9 : release task    in: nil        (task header at >8000)
                             out: nil
                             out: nil
=== Page get ===


  opcode #A :  page get  in:  r0=>000A
  opcode #A :  page get  in:  r0=>000A
Line 67: Line 88:
                             r1=pointer to node
                             r1=pointer to node
                             r2=page number from node
                             r2=page number from node
=== Add page to free pages in system ===


  opcode #B : add page to free pages in system
  opcode #B : add page to free pages in system
Line 72: Line 95:
                         r1=page number
                         r1=page number
               out:      r0= error if no free nodes available
               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
  opcode #C : add a node to the list of free nodes
Line 77: Line 102:
                         r1=pointer to node
                         r1=pointer to node
               out:  no errors
               out:  no errors
=== Link a node to the specified node ===


  opcode #D : link a node to the specified node
  opcode #D : link a node to the specified node
Line 83: Line 110:
                         r2=pointer to node to link to
                         r2=pointer to node to link to
               out:  no errors
               out:  no errors
=== Get address map  (system) ===


  opcode #E, get address map  (system)
  opcode #E, get address map  (system)
       return:          R0= count of valid pages
       return:          R0= count of valid pages

Revision as of 12:54, 11 November 2011

Memory management in MDOS is available via XOP 7.

General purpose XOPs

Return number of free pages in system

opcode #0, return number of free pages in system
     after return: r0=ERROR CODE (always zero)
                   r1=number of free pages
                   r2=number of fast free pages 

Claim pages into local map from free pages

opcode #1, claim pages into local map from free pages
     pass:             r1=number of pages
                       r2=local page address
                       r3=speed flag <>0 means FAST
     return:           r0=error code
                       r1=number of pages actually fetched
                            to complete map as required
                       r2=number of fast pages fetched

Return pages into free pool from local map

opcode #2, return pages into free pool from local map
     pass:             r1=number of pages
                       r2=local page address
     return:           r0=error code

Map local page at excution page

opcode #3, map local page at excution page
     pass:             r1=local page number
                       r2=execution page number
     return:           r0=error code

Get address map

opcode #4, get address map
     pass:             r1=execution address
                       r2=size of area for map
     return:           r0=error code
                       r1=count of pages reported

Declare shared pages

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

Release shared pages (type)

opcode #6, release shared pages (type)
     pass:             r1=type
     return:           r0=error code
     also have to check their current execution map

Get shared pages

opcode #7, get shared pages
     pass:             r1=type
                       r2=local page number for start of shared area
     return:           r0=error code

Return size of shared page group

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