rusty_mos::process

Module envs

Source
Expand description

Core methods for the env module.

Structs§

  • The PCB struct. Compatible with the C-Like memory structure and the MOS.
  • Wrapper to make it aligned to a page.
  • The IPC data collected together. Compatible with the C-Like memory structure.

Enums§

  • The env status enum. Compatible with the C-Like memory structure.

Constants§

Statics§

Functions§

  • asid_alloc 🔒
    Alloc a new asid. Return an error if there is no asid remained.
  • asid_free 🔒
    Free an asid.
  • Alloc an env and setup its vm and PCB.
  • Create an env and load the icode, set the priority. For tests mainly.
  • Destory an env and free it. Re-schedule will be performed.
  • Free an env, and remove all its pages. The TLB will be flushed after the deletion of pages.
  • Init the env environment. Put the envs into the free list, and map the PAGES and ENVS to base_pgdir’s UPAGES and UENVS accordingly.
  • Recover from exception, load the specified TrapFrame.
  • Run the env. Save the current env’s trapframe if it exists.
  • Setup the virtual memory of the new-born env.
  • Get the env’s PCB by its id. If checkperm is set, the method will check whether the env just is the current env or the child of it. If not, KError::BadEnv will be returned with a Err wrapper.
  • load_icode 🔒
    Load the icode for the e.
  • Map the [va, va + size) in virtual address space to the [pa, pa + size) in physical address space if pgdir. This method will validate the entry perm.
  • mkenvid 🔒
    Get the envid with the env node.