[okl4-developer] Device Core

Geoffrey Lee glee at ok-labs.com
Wed May 21 00:24:29 EST 2008


On Tue, May 20, 2008 at 02:55:19PM +0200, Lukas HANEL wrote:
> Hi
> 
> I am currently porting drivers to the iguana driver framework. During
> this I have yet some problems in understanding:
> 
>  * Driver servers take resource descriptions from the
> elfweaver/machines.py file. They request the resources and make use of
> the driver. However, there is also the device core, which seems to do
> similar stuff: Allocating/requesting resources, providing virtual
> devices. Is this a redundancy in e.g. the pxa platform, or is this a
> requirement?

Hi Lukas - 

Code will still be required to ask for the resources at run-time.
Having said that some code for the devicecore could be automatically
generated, so yes, there is some redundancy.

> 
>  * Can you document the interface for timer drivers? I have analysed the
> pxa platforms and think it might be the following interface:
>   * get_ticks() shall return the current time with the highest possible
> precision.
>   * timeout() shall program the timer to fire an interrupt at the
> specified time.
>   * device_interrupt_impl() shall return 1, when a timeout expired.
> Is this right?
> 

Yes, that looks right.  get_ticks() actually returns the number of ticks
elapsed, which may or may not be setup to provide the highest resolution
supported by the hardware.

>  * Are there any test cases for the vtimer, vserial, vrtc servers? I am
> currently using the drivers example. But this example expects all the 3
> servers to be already working. I would like to port and understand them
> one after the other. Is it the right way to start with the timer server?
> 

There are currently no test cases that test these on an individual
basis.  The next best thing right now may be to modify the drivers
example to enable these one by one.

>  * More a general understanding question: When I have several devices
> with the same functionality, would I use them with the same server, or
> one server per device?
> Example: A multiple timer unit with one interrupt for 4 timers?

That depends, or example, if you have 4 timers and all your
timers live on the same physical page in physical space, then
it does not make sense to separate them from a security point of view.

There are other considerations as well, for example, you only
associate one interrupt with one thread, so you may need to put
all your timers in the same device if they share one interrupt.  
Alternatively, you can write a server to mux the interrupt.

> 
>  * Bug: images and weaver.xml get not regenerated on
> plat/tools/machine.py changements of device resources.


thanks, we'll put that into our bug database.

> 
> Thanks for sharing your experience,
> Lukas Hänel

	-gl

> 
> _______________________________________________
> Developer mailing list
> Developer at okl4.org
> https://lists.okl4.org/mailman/listinfo/developer
> 

-- 




More information about the Developer mailing list