Skip to content

Commit

Permalink
proberly check if a process is a kernel process
Browse files Browse the repository at this point in the history
  • Loading branch information
0x6D70 committed Jan 23, 2024
1 parent c284012 commit 738d881
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xernel/kernel/src/mem/mmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub fn handle_page_fault(addr: VirtAddr, error_code: PageFaultErrorCode) -> bool
let base_addr = addr.align_down(Size4KiB::SIZE);
let frame = FRAME_ALLOCATOR.lock().allocate_frame::<Size4KiB>().unwrap();

let pt_flags = ptflags_from_protflags(vm_entry.prot, true); // TODO: don't hardcode user_accessible
let pt_flags = ptflags_from_protflags(vm_entry.prot, process.page_table.is_some());
let mut pt = process.get_page_table().unwrap();

pt.map::<Size4KiB>(frame, Page::from_start_address(base_addr).unwrap(), pt_flags, true);
Expand Down

0 comments on commit 738d881

Please sign in to comment.