Hello,
I'm new tofreebsdFreeBSD kernel programming. I'm currently trying to allocate kernel RWX pages, but without any success.
I did this:
vm_map_find returns 0, addr is also valid, but when i tried to access the page, with a read for example, it causes a page_fault (that's normal since the page has never been accessed before)
But then in vm_fault, a new page fault occurs and crashes the system.
Did I miss something here?
Does anyone have another way to allocate a kernel RWX page ?
Thanks
I'm new to
I did this:
Code:
void* addr = 0;
u32 size = PAGE_SIZE;
u32 maxprot = PROT_WRITE | PROT_READ | PROT_EXEC;
u32 prot = maxprot;
int docow = 0;
int fspace = VMFS_ANY_SPACE;
int ret = vm_map_find(kernel_map, 0, 0, &addr, size, fspace, prot, maxprot, docow);
vm_map_find returns 0, addr is also valid, but when i tried to access the page, with a read for example, it causes a page_fault (that's normal since the page has never been accessed before)
But then in vm_fault, a new page fault occurs and crashes the system.
Did I miss something here?
Does anyone have another way to allocate a kernel RWX page ?
Thanks