From: Jeff Dike <jdike@ka...> - 2001-10-26 02:31:06
> One of them is 16MB and I assume that is the physical memory. What are
> the other ones?
Those are the UML text and data segments, plus whatever heap UML has managed
to allocate. The original data mapped in from the binary are thrown out and
replaced by these so that the kernel text and data are shared, and not COWed,
by all the UML threads.
> It seems strange to me that a function called by the
> main function runs more than one time (and it's not in a loop)
> There are 3 things I need to virtualize now:
> 1) DMAs
Like you said, this is easy.
> 2) interrupts
> 3) register mappings
These two depend on how exactly your simulator works. You seem to be
able to export a file to do DMA into. Can you export a file which the
UML driver can open and receive SIGIOs on whenever there's a device
interrupt? If so, then your driver can just plug into the UML IRQ system.
The same is true of registers. If you can export them as a file somehow,
then they can be another iomem region. If you can't, then another possibility
is to ioremap them into UML memory from a little stub driver in the host
kernel. But this also depends highly on the details of your hardware.
> PD: my boss wants to do this also for freebsd. Does anyone know of a
> similar project on that os?
No. NetBSD would be the most likely possibility, since it's the one that
tries to be most portable. Someone brought it up on a netbsd newsgroup
late last year and basically got laughed at. More recently, there's a
forlorn little thread that consists of one post asking if it was possible,
and no replies.