62 auto operator=(const
phys &other) ->
phys & = delete;
static void markUsed(const phys_t start, const phys_t end) noexcept
Mark physical memory range [start, end) as used (every touched page).
static void free(const phys_t page) noexcept
Free physical page.
static constexpr auto MEMORY_LIMIT
Physical memory tracked by allocator (bitmap of 128 KB).
phys(const phys &other)=delete
Copy c-tor.
static auto freePages() noexcept -> igros_usize_t
Number of free pages.
static auto alloc(const phys_t limit=MEMORY_LIMIT) noexcept -> phys_t
Allocate physical page below limit (0 if no memory left).
static void init(const multiboot::info_t &info) noexcept
Initialize from bootloader memory map (reserves kernel and boot data).
~phys() noexcept=default
D-tor.
static auto top() noexcept -> phys_t
End of highest memory ever marked free (top of usable RAM, clamped to MEMORY_LIMIT).
static void markFree(const phys_t start, const phys_t end) noexcept
Mark physical memory range [start, end) as free (only whole pages).
std::size_t igros_usize_t
Unsigned size.
std::uint64_t igros_quad_t
64-bit unsigned integer
Memory management: physical page allocator, direct map, virtual addresses.
constexpr auto PAGE_SHIFT
Page size bits.
constexpr auto LOW_MEMORY_RESERVED
Physical memory never given out (BIOS, video memory, ROMs).
constexpr auto LOW_MEMORY_LIMIT
Physical memory mapped by boot code at kernel virtual offset (see boot.s).
igros_quad_t phys_t
Physical address (64-bit: physical memory may lie above 4 GB).
constexpr auto PAGE_SIZE
Page size in bytes.
Multiboot 1 information passed by the bootloader.
Multiboot 1 information from bootloader.
Common C++ types redefinition.