Skip to content

Commit

Permalink
kern/pmm: Fix potential memory corruption issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mintsuki committed Apr 17, 2024
1 parent ff21e54 commit c59f7c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions kernel/modules/limine/limine.v
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ pub mut:
pub const (
limine_memmap_usable = 0
limine_memmap_bootloader_reclaimable = 5
limine_memmap_kernel_and_modules = 6
)

pub struct LimineMemmapEntry {
Expand Down
3 changes: 2 additions & 1 deletion kernel/modules/memory/physical.v
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ pub fn pmm_init() {
i, entries[i].base, entries[i].length, entries[i].@type)

if entries[i].@type != u32(limine.limine_memmap_usable)
&& entries[i].@type != u32(limine.limine_memmap_bootloader_reclaimable) {
&& entries[i].@type != u32(limine.limine_memmap_bootloader_reclaimable)
&& entries[i].@type != u32(limine.limine_memmap_kernel_and_modules) {
continue
}
top := entries[i].base + entries[i].length
Expand Down

0 comments on commit c59f7c5

Please sign in to comment.