Crate memory_structs

source ·
Expand description

This crate contains basic types used for memory management.

The types of interest are divided into three categories:

  1. addresses: VirtualAddress and PhysicalAddress.
  2. “chunk” types: Page and Frame.
  3. ranges of chunks: PageRange and FrameRange.

Structs

  • A Frame is a chunk of physical memory aligned to a page boundary (default 4KiB) given by the P parameter.
  • A range of Frames that are contiguous in physical memory.
  • A Page is a chunk of virtual memory aligned to a page boundary (default 4KiB) given by the P parameter.
  • Marker struct used to indicate a page size of 1GiB.
  • Marker struct used to indicate a page size of 2MiB.
  • Marker struct used to indicate the default page size of 4KiB.
  • A range of Pages that are contiguous in virtual memory.
  • A physical memory address, which is a usize under the hood.
  • A virtual memory address, which is a usize under the hood.

Enums

  • Enum used to indicate the size of a page or frame.
  • The possible states that a range of exclusively-owned pages or frames can be in.

Traits

  • Trait that represents the size of a page or frame, i.e., for normal or huge pages.