[okl4-developer] OKL4 : How can I get time?
Nelson Tam
nelson at ok-labs.com
Tue Apr 29 22:53:29 EST 2008
Hi Martin and all,
Thanks for the response, you pretty much nailed it right on.
I just wanted to add that for the 2.1 release, we have implemented a
Real Time Clock (RTC) driver for all supported architectures, so that
may help you with getting a clock that corresponds to real world time,
albeit at a lower resolution.
Nelson.
On 25/04/2008, at 6:33 PM, Martin P. Lawitzky wrote:
>
> inside the kernel the scheduler has a current time. Outside the kernel
> without using the Iguana vtimer, you will have to map the timer
> interrupt register and timer match registers to the space where you
> want
> to implement you own timer. The roottask can do this.
> This is what the Iguana vtimer does.
>
> Depending on the architecture you might need to be careful here, not
> to
> overwrite the timer settings used by the scheduler. If you
> accidentally
> remove the timer interrupt of the scheduler, your tasks will never be
> preempted anymore. So this is a potential security issue and these
> registers shouldn't be mapped to arbitrary tasks.
>
> Using cycle counters works only in privileged mode on some
> architectures, so you would need to implement a syscall for this which
> likely screws up your timing anyway.
>
> So, do you need the time inside the kernel or in userland?
--
(nt)
Nelson Tam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1560 bytes
Desc: not available
Url : http://lists.okl4.org/pipermail/developer/attachments/20080429/a86a6ace/attachment-0001.bin
More information about the Developer
mailing list