Page 1 of 1

fork() of the ring3

Posted: Sat Jan 24, 2004 7:33 am
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

Re:fork() of the ring3

Posted: Sun Jan 25, 2004 3:50 pm
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...