Hey, all.
Thomas Bocek <[EMAIL PROTECTED]> wrote:
> The RessourceManager is still unfinished, but today I added the
> DMA/PORT/IRQ reserve method. The RM is hooked into the dma class, so that
> the dma-driver works now with the RessourceManager.
Just a really minor point. "RessourceManager" is a type-o. "Resource" is
the correct spelling, unless you're wanting to differentiate it from
something else... I'm lucky that I know that spelling, kaws eye'm knot two
gud at spelng, meyesalph.
>
> As a consequence of the new RM, the drivers need slightly to be updated.
> e.g. the fdc driver contains 2 more lines:
>
> RessourceManager rm=new RessourceManager();
> boolean reserved=rm.reserveDMA(2,this,false);
>
> file://2 -> channel
> file://this -> only this class can access dma 2
> file://false -> shareable -> if 2 or more drivers are allowed to acces the
> // same ressource
>
> file://and the line
>
> dma_xfer(2,address,(int)nosectors*512,true,this);
> // has 1 more argument(this)
Just my 2 cents. Should DMA for channel be an instance (created by
rm.reserveDMA(...) ), where all DMA requests are filtered, or should it be
accessed directly like you have above? Since DMA is a highly time-sensitive
hardware piece (well, all direct low-level hardware is timing sensitive), we
need the fastest method to use it. But, then, having a spiffy
object-oriented interface is handy, too, especially for porting purposes.
On another point, what should we do with Plug-n-prey devices that have the
option of using one of two DMA devices? Should we force the device driver
developer to write out the long-hand of testing each DMA port, and reserving
the most appropriate one (if both are available), or should this be a
built-in function? This all comes down to the speed and size of the kernel,
of which I can't properly answer.
>
> Now I thought about the speed of the RM: every call (DMA/PORT/IRQ) has to
> be verified. The dma method checks every call if the caller is the
> right owner. Isn't that slow? How do other OSes handle ressources?
>
This check could be eliminated by forcing all dedicated hardware resources
to be passed through specific instances of a class, which can be
constructed/divied up only by a special resource manager factory.
>
> Thomas Bocek
>
-Matt
_______________________________________________
Kernel maillist - [EMAIL PROTECTED]
http://jos.org/mailman/listinfo/kernel