mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Add missing MemoryMap and MemoryRegionType imports
This commit is contained in:
@@ -852,6 +852,8 @@ In order to create new page tables, we need to create a proper frame allocator.
|
|||||||
```rust
|
```rust
|
||||||
// in src/memory.rs
|
// in src/memory.rs
|
||||||
|
|
||||||
|
use bootloader::bootinfo::MemoryMap;
|
||||||
|
|
||||||
/// A FrameAllocator that returns usable frames from the bootloader's memory map.
|
/// A FrameAllocator that returns usable frames from the bootloader's memory map.
|
||||||
pub struct BootInfoFrameAllocator {
|
pub struct BootInfoFrameAllocator {
|
||||||
memory_map: &'static MemoryMap,
|
memory_map: &'static MemoryMap,
|
||||||
@@ -886,6 +888,8 @@ Before we implement the `FrameAllocator` trait, we add an auxiliary method that
|
|||||||
```rust
|
```rust
|
||||||
// in src/memory.rs
|
// in src/memory.rs
|
||||||
|
|
||||||
|
use bootloader::bootinfo::MemoryRegionType;
|
||||||
|
|
||||||
impl BootInfoFrameAllocator {
|
impl BootInfoFrameAllocator {
|
||||||
/// Returns an iterator over the usable frames specified in the memory map.
|
/// Returns an iterator over the usable frames specified in the memory map.
|
||||||
fn usable_frames(&self) -> impl Iterator<Item = PhysFrame> {
|
fn usable_frames(&self) -> impl Iterator<Item = PhysFrame> {
|
||||||
|
|||||||
Reference in New Issue
Block a user