[SqNOS] Memory, ideas?

Gerardo Richarte gera at corest.com
Sun Jul 2 22:17:48 UTC 2006


ok, the time has come.

Hardware devices usually need to know some memory addresses, for
example, in this case, the network device I'm implementing (AMD Lance,
works on vmware) needs to know a pointer to a "configuartion block"
which in turns has a pointer to a "receive ring" and a "transmit ring",
which have pointers to several receive and transmit buffers.

Problem:

    If we use, lets say, ByteArrays for buffers, and a garbage collect
moves the buffer to a different memory position, the hardware may try to
incorrectly access it in the old memory address.


Ideas (3):
    . Use some kind of "Object Locking" to mark unmovable objects, so
the garbage collector doesn't move our buffers around. Is this possible?
How will this affect the performance of the garbage collector? what
special care should we have if we do this?

    . Create a a map of the external memory (including, for example,
where the Interrupt Descriptor Table and the Global Descriptor Table are
located, what memory is available (mapped), where's the video memory,
where in memory is loaded the interpreter (kernel), and where starts the
.image). Then create the ExternalMemoryManager class in Squeak and use
it to administer this external memory)

    . Probably the most interesting idea, collaborated by [uhm... shit,
forgot your name and can't find your emails, I'll fill this space asap]
Create a second ObjectMemory to take care of the biggest block of
external memory available. I like this idea, however we either need to
be able to lock some objects in this externalObjectMemory, or we seldom
(never?) do a garbage collect in it. How do we do this? Craig? :-)

    What do you think? this is what has me stoped right now. I have all
the information needed (and more) to implement simple networking
(ethernet) support (for a single NIC now). If too long passes without
solving this (1 week), I will implement it anyway, and latter see how we
solve this. But we seriously need to solve it.

    all ideas are more than welcome!
    thanks!
    gera


More information about the SqueakNOS mailing list