core: Reserve physical page 0
In the kernel's early stages we access physical memory identity-mapped, so it's not very good for us to allocate that frame and then try to use it.
This commit is contained in:
parent
8bfc8a5781
commit
090e4148b8
@ -99,5 +99,8 @@ pub fn initializeFrameAllocator(tag: *easyboot.multiboot_tag_mmap_t) !FrameAlloc
|
|||||||
const frames_to_lock = try std.math.divCeil(usize, bitmap_size, platform.PAGE_SIZE);
|
const frames_to_lock = try std.math.divCeil(usize, bitmap_size, platform.PAGE_SIZE);
|
||||||
try lockFrames(&allocator, @intFromPtr(bitmap_base_address), frames_to_lock);
|
try lockFrames(&allocator, @intFromPtr(bitmap_base_address), frames_to_lock);
|
||||||
|
|
||||||
|
// Avoid causing trouble.
|
||||||
|
try lockFrame(&allocator, 0);
|
||||||
|
|
||||||
return allocator;
|
return allocator;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user