On 10/27/24 6:08 PM, Sergey Bugaev wrote:
Sure, that makes sense. And it's a great property of the Hurd that you
can in fact develop out-of-tree translators with ease. Though in the
case of rtc, we'd probably want it in-tree eventually.
I didn't develop it in-tree because I haven't figure out how to write a Makefile for an in-tree server. I haven't found a reference or document for me to learn writing it. Any recommendations? Maybe I should write one based on the Makefile of lwip and add something in the top-level Makefile?
If so, it would make sense to me if you defined a type that represents
RTC's time representation right in your .defs file, and used that in
your RPCs. Perhaps like this:

type rtc_time_t = struct {
   int tm_sec;
   ...
};

with a matching definition in C.
I add it and it works now :).
/* TODO: adding other ioctl calls for /dev/rtc in mc146818rtc.h */
skip; skip; skip; skip; /* 0 1 2 3 */
skip; skip; skip; skip; /* 4 5 6 7 */
skip;                   /* 8 */

/* 9 RTC_RD_TIME */
routine pioctl_rtc_rd_time (
      reqport: io_t;
      inout time: tm_t);
Shouldn't this be 'out' rather than 'inout'?
I think my idea was that time should be a pointer. I think there may be two method to correct it now: 1) let time be a pointer (tm_p_t?) 2) using 'out' rather than 'inout'.
Maybe 1) is better? Because the message length will be shorter.
/* 10 RTC_SET_TIME */
routine pioctl_rtc_set_time (
      reqport: io_t;
      time: tm_t);
Do I understand it right that this would be more privileged than
reading the time?
Indeed[1]. How to make it more privileged. I didn't find information about it in [2][3] by searching 'privilged'.

reference:
[1]: https://www.man7.org/linux/man-pages/man4/rtc.4.html
[2]: http://shakthimaan.com/downloads/hurd/server_writer.pdf
[3]: http://shakthimaan.com/downloads/hurd/server_interface.pdf

Thank you

--
Zhaoming Luo <zhaoming1...@qq.com>


Reply via email to