gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Diagnosed]: Timeservice not running on Ubuntu 16.04


From: Dan Williams
Subject: Re: [Diagnosed]: Timeservice not running on Ubuntu 16.04
Date: Sat, 6 Jun 2020 12:29:33 -0400

Hey Ray,

Thanks for the succinct explanation :)

For anyone who needs to debug PPS issues later, we were combining the two concepts (kernel- vs user-space) and (unprivileged/user vs privileged/root permissions) because:
1. Running gpsd with privileged permissions will access the kernel-space PPS mechanism
2. Running gpsd with only normal (unprivileged) permissions may only access the user-space PPS mechanism (i.e. ioctl)

I don't understand all the ins and outs of the two PPS methods, but that's why it can be easier to just combine the parallel concepts.

Mind you, I never could find any deeper documentation of the Kernel PPS implementation of RFC 2783, beyond https://www.kernel.org/doc/html/latest/driver-api/pps.html ( written by Rodolfo Giometti,  also the author of the actual kernel code )
That first article talks about implementing RFC 2783, but only for GPIO lines, not serial ports. Apparently Kernel-space PPS _also_ applies to the usual serial port situation, but I couldn't find any documentation / discussion of that.

Afaict,
The ioctl mechanism is just a callback handler from a system call when a specific hardware line changes state?   So how is that different from the KPPS version?

Cheers,
-DMW

p.s. All my experience with the above are on Ubuntu / Linux systems.  YMMV.
p.p.s. I've figured out my gpsd-chrony deployment -- this discussion is purely for curiosity / understanding at this point.

Daniel Williams  |  Software Engineer


On Sat, Jun 6, 2020 at 5:12 AM Sanktwo <sanktwo@shay-mwa.com> wrote:
On 05/06/2020 14:34, Dan Williams wrote:
> Yo Gary,
>
> Summary:
> I think I've diagnosed what the problems are, but not the fix.
> - User-space (plain) pps is not working, (reasons not clear)
> - root-space (kernel) ppps is not working, due to something on our side.

You need to separate in your mind the difference between "kernel space versus user space" from "normal users versus root user".

Programs run by "root" all run in user space just like any other user programs. The difference is that they have greater privileges
offered by the kernel i.e. can trash a lot more than just things owned by the user "root"

"kernel space" is reserved solely for the Linux kernel and some (most?) device drivers. Ignoring virtualisation at the moment, the
only program running in kernel space is called Linux and is not a program run on behalf of a user,  root or otherwise.

For most processors kernel space is protected by hardware mechanisms where the protection between users in user space is protected
by the Kernel (with hardware help of course).

gpsd is not part of the kernel and therefore can never run in Kernel space. It can, and does, run with root privileges in user space.

I hope that helps.

Ray - gpsd amateur



reply via email to

[Prev in Thread] Current Thread [Next in Thread]