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
fork() of the ring3
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:fork() of the ring3
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...
Another thing is that some internal structure will have to be duplicated on a fork(). The process structure is certainly one of them...