9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] my /dev/time for Linux
@ 2009-03-01  4:57 Chris Brannon
  2009-03-02 19:02 ` J.R. Mauro
  2009-03-06 10:29 ` maht
  0 siblings, 2 replies; 6+ messages in thread
From: Chris Brannon @ 2009-03-01  4:57 UTC (permalink / raw)
  To: 9fans

I wrote a module that emulates Plan 9's /dev/time under Linux.
Reading /dev/time yields 4 decimal numbers: seconds since start of epoch,
nanoseconds since start of epoch, jiffies since boot, and jiffies per second.
As with Plan 9, one can set the clock by writing a decimal number to the
device.  The value represents the number of seconds
since the start of the epoch.
The interesting aspect is that users other than root can set the clock
if they have write access to /dev/time.

The code is here: http://members.cox.net/cmbrannon/devtime.tgz
It may have issues.  Read it before using.  Comments are welcome.

-- Chris



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] my /dev/time for Linux
  2009-03-01  4:57 [9fans] my /dev/time for Linux Chris Brannon
@ 2009-03-02 19:02 ` J.R. Mauro
  2009-03-03 14:42   ` Chris Brannon
  2009-03-06 10:29 ` maht
  1 sibling, 1 reply; 6+ messages in thread
From: J.R. Mauro @ 2009-03-02 19:02 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Two things. First, I had to include <linux/jiffies.h> to get this to
build on my machine with 2.6.28 and second, do you have any plans to
get this accepted upstream?

Thanks for putting the time into this!

On Sat, Feb 28, 2009 at 11:57 PM, Chris Brannon <cmbrannon@cox.net> wrote:
> I wrote a module that emulates Plan 9's /dev/time under Linux.
> Reading /dev/time yields 4 decimal numbers: seconds since start of epoch,
> nanoseconds since start of epoch, jiffies since boot, and jiffies per second.
> As with Plan 9, one can set the clock by writing a decimal number to the
> device.  The value represents the number of seconds
> since the start of the epoch.
> The interesting aspect is that users other than root can set the clock
> if they have write access to /dev/time.
>
> The code is here: http://members.cox.net/cmbrannon/devtime.tgz
> It may have issues.  Read it before using.  Comments are welcome.
>
> -- Chris
>
>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] my /dev/time for Linux
  2009-03-02 19:02 ` J.R. Mauro
@ 2009-03-03 14:42   ` Chris Brannon
  2009-03-03 16:21     ` J.R. Mauro
  0 siblings, 1 reply; 6+ messages in thread
From: Chris Brannon @ 2009-03-03 14:42 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

J.R. Mauro writes:
> > Two things. First, I had to include <linux/jiffies.h> to get this to
> > build on my machine with 2.6.28 and second, do you have any plans to
> > get this accepted upstream?

Thanks for the report.  This is fixed in the latest code, available from
the same URL: http://members.cox.net/cmbrannon/devtime.tgz
That's just a snapshot of whatever happens to be current.

I hadn't really thought about submitting it to the kernel developers, as I
don't know the process.  It needs some tidying as well.
Anant wants to include it in Glendix.

-- Chris



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] my /dev/time for Linux
  2009-03-03 14:42   ` Chris Brannon
@ 2009-03-03 16:21     ` J.R. Mauro
  0 siblings, 0 replies; 6+ messages in thread
From: J.R. Mauro @ 2009-03-03 16:21 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Tue, Mar 3, 2009 at 9:42 AM, Chris Brannon <cmbrannon@cox.net> wrote:
> J.R. Mauro writes:
>> > Two things. First, I had to include <linux/jiffies.h> to get this to
>> > build on my machine with 2.6.28 and second, do you have any plans to
>> > get this accepted upstream?
>
> Thanks for the report.  This is fixed in the latest code, available from
> the same URL: http://members.cox.net/cmbrannon/devtime.tgz
> That's just a snapshot of whatever happens to be current.

Cool

>
> I hadn't really thought about submitting it to the kernel developers, as I
> don't know the process.  It needs some tidying as well.
> Anant wants to include it in Glendix.

I can help with the tidying; should just be a matter of running
checkpatch.pl/Indent. I'll send you a patch personally if I get to it
in the next couple days.

As far as submitting it goes, I've been working with Anant at getting
the Glendix stuff in. I also spurred the developer of the Plan 9
authentication device to get that code included. I've been working
with Greg Kroah-Hartman for a while on the Staging tree, so I can get
things fast-tracked into the kernel if that's wanted. Ashwin's Plan 9
capability device will be available in 2.6.29 when it comes out as an
experimental option. If you want to post your code to LKML and see if
someone picks it up, that's a good route, but if no one looks
interested, just let me know and I can pretty much guarantee it will
get in, possibly even for 2.6.29.

>
> -- Chris
>
>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] my /dev/time for Linux
  2009-03-01  4:57 [9fans] my /dev/time for Linux Chris Brannon
  2009-03-02 19:02 ` J.R. Mauro
@ 2009-03-06 10:29 ` maht
  2009-03-12 18:24   ` J.R. Mauro
  1 sibling, 1 reply; 6+ messages in thread
From: maht @ 2009-03-06 10:29 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

nice one.

Getting it upstream would be great. Another "you know Y that's in Linux
now, it's from Plan9, but if you want Plan9 you know where to find it
(unless it's down today)".



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [9fans] my /dev/time for Linux
  2009-03-06 10:29 ` maht
@ 2009-03-12 18:24   ` J.R. Mauro
  0 siblings, 0 replies; 6+ messages in thread
From: J.R. Mauro @ 2009-03-12 18:24 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Fri, Mar 6, 2009 at 6:29 AM, maht <mattmobile@proweb.co.uk> wrote:
> nice one.
>
> Getting it upstream would be great. Another "you know Y that's in Linux now,
> it's from Plan9, but if you want Plan9 you know where to find it (unless
> it's down today)".
>
>

Actually, I got Ashwin Ganti's Plan 9 capability device accepted into
Greg K-H's staging tree. Should come with 2.6.29 as an experimental
option. I'm also working with the folks at glendix.org on getting
Linux to be binary compatible with Plan 9. We're always looking for
help, if you're interested.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-03-12 18:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-01  4:57 [9fans] my /dev/time for Linux Chris Brannon
2009-03-02 19:02 ` J.R. Mauro
2009-03-03 14:42   ` Chris Brannon
2009-03-03 16:21     ` J.R. Mauro
2009-03-06 10:29 ` maht
2009-03-12 18:24   ` J.R. Mauro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).