fork() of the ring3

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Adek336

fork() of the ring3

Post by Adek336 »

It seems many of you have some kind of a call, namely fork(), and you use it everytime you create an adress space.

I was just curious what should a fork() implementation do. In panalix I keep a kernel process and I just memcopy() it to another location so I have a memory space for a user app. Is this a good way?

Cheers,
Adrian
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:fork() of the ring3

Post by Pype.Clicker »

in many implementations, fork() itself does not really copy the memory, but instead tags it as "copy-on-write" (making pages read-only and keeping in mind that a #PF for these addresses should be handled by allocating a new frame, copying the bits and then making the new frame writeable again). This saves time & memory ...

Another thing is that some internal structure will have to be duplicated on a fork(). The process structure is certainly one of them...
Post Reply