Hi Thomas,
The RM is Cool........:D
I would like to suggest a idea about the issue of "speed of RM".
For this issue, We can do it in this way.
No one can construct a RM directly. Everyone need to get a instance of RM
so that they access DMA. So I put reserveDMA as a static method. If I need
a DMA 2 unshareable, RM will create a instance of itself for me that can
only access DMA 2. So only one got the instance of this RM can only access
DMA 2.
For this change, we don't need to check the classes each time and it will
speed up
a little bit.
RessourceManager rm = RessourceManager.reserveDMA(2, false);
rm.dma_xfer(address, (int) nosectors*512);
....................................
....................................
public static RessouceManager reserveDMA(int dma, boolean shareable) {
RessouceManager rm = new RessouceManager(dma, shareable);
return rm;
}
public void dma_xfer(int address, int size) {
....................................
....................................
}
....................................
....................................
>
>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.
>
>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);
>
>//2 -> channel
>//this -> only this class can access dma 2
>//false -> shareable -> if 2 or more drivers are allowed to acces the
>// same ressource
>
>//and the line
>
>dma_xfer(2,address,(int)nosectors*512,true,this);
>// has 1 more argument(this)
hm...........what's the meaning of the boolean argument in dma_xfer ?
>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?
>
Regards,
Hilary
_______________________________________________
Kernel maillist - [EMAIL PROTECTED]
http://jos.org/mailman/listinfo/kernel