[LinuxPPS] LinuxPPS for kernel 2.6.26

Rodolfo Giometti giometti at enneenne.com
Tue Jul 15 22:11:41 CEST 2008


On Tue, Jul 15, 2008 at 09:21:03PM +1000, Cirilo Bernardo wrote:

> Well, the previous version of LinuxPPS was more convenient in that
> respect, but the Linux kernel hackers made it clear they weren't happy
> with the design.  Basically, LinuxPPS must not interfere with the rest
> of the kernel or make parts of the kernel difficult to maintain.  The
> previous patches to the serial core were thought to disturb the kernel
> too much, so using a "line discipline" was suggested.  Now the kernel
> code looks more beautiful, but anyone who wants to use the PPS with
> the serial code has to suffer the horrible hacks.  The NTPD people
> have made it clear that they will not accept any patches which only
> serve a purpose for Linux and make the NTPD maintenance more
> difficult.  So both the kernel and ntp people are essentially saying
> "don't touch our code - do something else".

Correct! :D

> So the simplest solution is to run 'ppsldisc' from the ntp startup
> script (pretend it's another daemon) and also stop it from the ntp
> script.  The challenge here: how does 'ppsldisc' know which ports to
> open?  It's annoying to always edit the ntpd script.  Well, we can
> propose these sorts of changes to the ntpd script:
> 
> - check for a file /etc/pps/has_serial_ldisc
> - if the file exists, run 'ppsldisc'
> - ppsldisc should read the file /etc/pps/ppsldisc.conf (or alternative
> specified on command line) which contains a list of serial ports to
> open; ppsldisc can even create the 'gps*' symlink, for example:
> 
> #ppsldisc.conf
> ttyS3
> ttyS0

Let me suggest something like:

#ppsldisc.conf
/dev/gps0 = /dev/ttyS3
/dev/gps1 = /dev/ttyS0

> The response of ppsldisc:
> 1. open ttyS3, set the pps line discipline, create the symlink gps0->ttyS3
> 2. open ttyS0, set the pps line discipline, create the symlink gps1->ttyS0

1. open /dev/ttyS3, set the pps line discipline, create the symlink /dev/gps0->/dev/ttyS3
2. open /dev/ttyS0, set the pps line discipline, create the symlink /dev/gps1->/dev/ttyS0

> Of course if there are other non-ttyS* GPS devices or other PPS
> devices, things can get weird - but that's the exception rather than
> the rule, and in such cases the admin can always arrange for those
> strange PPS or GPS devices to have their drivers loaded later so that
> the relation of gpsN to ppsN remains sensible.

I agree. Even if the ppsldisc fails there should be no problems at
all!

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail: giometti at enneenne.com
Linux Device Driver                          giometti at linux.it
Embedded Systems                     phone:  +39 349 2432127
UNIX programming                     skype:  rodolfo.giometti



More information about the LinuxPPS mailing list