collinge@uvicctr.UUCP (Doug Collinge) (01/08/87)
I am not a Unix guru but I think Henry has made a mistake saying that fork() can't be done without an MMU. Here's how: - parent calls fork() - copy data space of parent to a swapping buffer or device. - run parent until she blocks or you get sick of her. - when you want to run the child exchange the contents of the swapping buffer with the data space of the parent. - usually the child will diddle a bit with its data space then exec something else. When he does we exchange the data once more, throw away the swapping buffer, and start up the new process in a newly-allocated area. No more swapping. Of course, the swapping would be pretty tedious for our CPU but we wouldn't really be doing it very often, only when we start up a new process most of the time. So, assuming that we only have three or four processes in our ST I wouldn't expect it to be gross - we have to wait for the disks to spin anyway. Besides, isn't it remarkable how good a blitter the 68k makes? My friend David Harris (C/O me) suggested using the blitter to do the swapping - nice idea. I suggest that a little gizmo could be hooked onto the DMA port that would do the job but it would have to have a buffer in it I guess, probably too expensive. Anyway, I think this could be quite workable on a single user computer like the ST. But I probably have overlooked some guru-some fact of Unix daily life. How about it, Henry? -- Doug Collinge School of Music, University of Victoria, PO Box 1700, Victoria, B.C., Canada, V8W 2Y2 decvax!nrl-css!uvicctr!collinge decvax!uw-beaver!uvicctr!collinge ubc-vision!uvicctr!collinge
henry@utzoo.UUCP (Henry Spencer) (01/11/87)
> I am not a Unix guru but I think Henry has made a mistake saying > that fork() can't be done without an MMU. Here's how: I didn't say it was impossible, I said it was a problem. Not the same thing. What you outline is probably the most feasible approach to fork() on an ST, with the reservation that one would definitely want to use memory as the backing device. Swapping on floppies is no fun -- we tried it, in the dim distant past, with Mini-Unix. -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,decvax,pyramid}!utzoo!henry