LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   w/r RTC register (https://www.linuxquestions.org/questions/linux-newbie-8/w-r-rtc-register-4175613655/)

joris1973 09-12-2017 04:27 AM

w/r RTC register
 
Hello everybody,

I am fairly new with Linux programming and have a school assignment reading and writing the RTC

Only problem is that we have to do it in userspace and cannot use operations to devices like(/dev/rtc)
We must write a simple program to read RTC up counter using its adress.
This will fail but we have to describe what happens...
I cannot find a solution on the internet so any help will be greatly appreciated!!

thanks...

rtmistler 09-12-2017 07:37 AM

Hi and welcome to LQ.

A couple of suggestions are to look at sample projects for the Raspberry Pi related to a RTC. There is source code and helpful blog information which can help you down that direction.

No offense to your instructor, but somewhere along the line, .... It needs to talk to /dev/rtc! For instance there are userspace utilities to set time and save it to the RTC, and I believe that while you have a default, you can also specify the exact resource within the command argument, and technically speaking, you are accessing that resource. So their guidance is a minor amount confusing to their students. Perhaps what they ought to have said was that you should do this entirely within the userspace and left it at that.


All times are GMT -5. The time now is 09:42 PM.