Creating a "new" virtual address space for a process

Joe Damato jdamato at andrew.cmu.edu
Mon Jan 22 03:33:32 UTC 2007


Hello -

This is my first time posting to the list, so please let me know if I 
should expand on anything I mention here. I am working on the S4OS 
project for FreeBSD with a couple friends and we are currently trying to 
understand how to use the VM system in FreeBSD.

We have a process, (in this case it happens to be curproc or proc0), and 
we would like to create a new virtual address space and allocate, say N 
pages starting at address X. We have been reading the fork() code to try 
to see how this would work, but got lost in some of the COW stuff.

We have some kernel data that needs to be copied out to userland, but we 
can't seem to figure out how to actually set up that virtual address 
space. I would attach a code snippet of the code we wrote to accomplish 
this, but it is literally all guess work, and probably completely wrong. 
Anyone know how to do this or even where to look to see an example of 
this happening?

Thanks,
Joe


More information about the freebsd-hackers mailing list