I receive the following failure
vm fault on data at address 0x203800 with status 0x92000010
in thread 0x807ff49400 "rootserver" at address 0x253504
With stack:
0x2a29f0: 0x2a2960
It happens when I call
ptr::read_volatile((mapped_address + 0x000) as *const u32);
I would understand it, when it happens with the first call, but it happens with the 5th call.
The memory mapping happens via the following code:
// Take a CSpace slot
let device_frame_slot = empty_slots
.pop()
.unwrap()
.downcast::<sel4::cap_type::Granule>();
// Retype the untyped memory and put it into the CSpace slot
let cap_status = device_ut_cap
.untyped_retype(
&sel4::cap_type::Granule::object_blueprint(),
&sel4::init_thread::slot::CNODE.cap().relative_self(),
device_frame_slot.index(),
1,
);
if cap_status.is_err() {
return 0;
}
cap_status.unwrap();
// Take the capability out of the slot
let device_frame_cap = device_frame_slot.cap();
// Map the physical address to a page table entry
let mut device_page_addr_ptr: usize = init_free_page_addr(bootinfo) as usize; // TODO
let cap_status = device_frame_cap
.frame_map(
sel4::init_thread::slot::VSPACE.cap(),
device_page_addr_ptr,
sel4::CapRights::read_write(),
sel4::VmAttributes::default(),
);
if cap_status.is_err() {
return 0;
}
cap_status.unwrap();
return device_page_addr_ptr as usize + device_addr_offset;
The return value is the variable mapped_address
the code snipped before.