Am 30.11.2010 um 21:41 schrieb Mark Cave-Ayland:
Andreas Färber wrote:
I noticed that Haiku uses the set-callback ciface method shortly before, but it appears that we only save the callback-function in forth/system/ciface.fs and - according to grep - never use it elsewhere. Shouldn't every ofmem function check if we have a non-zero callback- function (how? Cf. below) and then call that instead? variable callback-function : set-callback ( newfunc -- oldfunc ) callback-function @ swap callback-function ! ;
AIUI the callback function provides a way for open firmware to call a function within the client image, e.g. allow a Forth function to invoke a "named" C function within the kernel image. I don't believe it is related to OFMEM at all.
The callback function apparently provides a way for the OS to take over memory management from OpenFirmware. Thus the relation to ofmem.
Haiku sets up a new page table based on the one from OpenFirmware, calls set-callback and expects to be asked for future memory allocations etc.