Hello world :-)
On Mon, 27 Sep 1999, Matt Albrecht wrote:
> 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.
whoops have to change RessourceManager.java into ResourceManager.java.
thanks. (german: resources=ressourcen)
> > 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.
You can only access dma_xfer(x,...) if you have reserved the dma. The only
class which can access x is this (you have to reserve and access dma
within one class).
> 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.
I made a method called getFreeDMA, which gives me the next free DMA. I
think this should be enough for Plug'n'Pray. Pherhaps RM will need antoher
method called getFreeDMA(int[]) -> int[] the dma numbers that work with
the pnp-card.
I didn't find any good docu about pnp :-(
> > 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.
see below...
[cut-n-paste] Hilarys mail:
> 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) {
> ....................................
> ....................................
> }
> ....................................
> ....................................
Is it possible in Java to allow only one instance for one DMA? There could
be x (if not shareable 8) instances, but only one for dma 2. So your
public static RessouceManager reserveDMA needs to be extended. Does anyone
know a good solution?
[cut]
> > 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 ?
whether dma_xfer should read or write : true=read, false=write.
Thomas Bocek
_______________________________________________
Kernel maillist - [EMAIL PROTECTED]
http://jos.org/mailman/listinfo/kernel