Re: [RFC PATCH] Add rtc server, rtc-read and rtc-set operations

2024-11-19 Thread Samuel Thibault
Sergey Bugaev, le mar. 19 nov. 2024 13:21:47 +0300, a ecrit: > On Tue, Nov 19, 2024 at 12:08 PM Samuel Thibault > wrote: > > Ah, yes. Since it's not a performance-critical service, you can as well > > use ports_manage_port_operations_one_thread instead, and get done with > > it :) > > This might

Re: [RFC PATCH] Add rtc server, rtc-read and rtc-set operations

2024-11-19 Thread Sergey Bugaev
On Tue, Nov 19, 2024 at 12:08 PM Samuel Thibault wrote: > Ah, yes. Since it's not a performance-critical service, you can as well > use ports_manage_port_operations_one_thread instead, and get done with > it :) This might be an issue once we implement the blocking read/select functionality; don't

Re: [RFC PATCH] Add rtc server, rtc-read and rtc-set operations

2024-11-19 Thread Zhaoming Luo
On 11/19/24 5:08 PM, Samuel Thibault wrote: Zhaoming Luo, le mar. 19 nov. 2024 16:54:38 +0800, a ecrit: On 11/17/24 9:04 PM, Sergey Bugaev wrote: I don't think I need to do anything before exit. However, maybe I need to ensure the rtc operations is thread-safe; I haven't done it. Ah, yes. Sinc

Re: [RFC PATCH] Add rtc server, rtc-read and rtc-set operations

2024-11-19 Thread Samuel Thibault
Zhaoming Luo, le mar. 19 nov. 2024 16:54:38 +0800, a ecrit: > On 11/17/24 9:04 PM, Sergey Bugaev wrote: > I don't think I need to do anything before exit. However, maybe I need to > ensure the rtc operations is thread-safe; I haven't done it. Ah, yes. Since it's not a performance-critical service,

Re: [RFC PATCH] Add rtc server, rtc-read and rtc-set operations

2024-11-19 Thread Zhaoming Luo
First of all, thanks for the code review. On 11/17/24 9:04 PM, Sergey Bugaev wrote: On Sun, Nov 17, 2024 at 3:34 PM Zhaoming Luo wrote: diff --git a/hurd/rtc.h b/hurd/rtc.h new file mode 100644 index ..6516e86c --- /dev/null +++ b/hurd/rtc.h +struct rtc_time { + int tm_sec; + int

Re: [RFC PATCH] Add rtc server, rtc-read and rtc-set operations

2024-11-18 Thread Zhaoming Luo
On 11/17/24 9:04 PM, Sergey Bugaev wrote: On Sun, Nov 17, 2024 at 3:34 PM Zhaoming Luo wrote: looks nice to me overall, thanks for working on this! I cannot judge the actual driver part, so here are some nitpicks about not following the GNU code style :D I will try to build and test it later. T

Re: [RFC PATCH] Add rtc server, rtc-read and rtc-set operations

2024-11-18 Thread Samuel Thibault
Hello, Zhaoming Luo, le dim. 17 nov. 2024 20:33:12 +0800, a ecrit: > I have tested the read and set operations, they seemd fine. Good :D > - Day of year is not stored in RTC[0], though we can calculate it when > we are reading RTC based on year, month, and day of month. Should we do it? Yes:

Re: [RFC PATCH] Add rtc server, rtc-read and rtc-set operations

2024-11-18 Thread Samuel Thibault
Hello, Sergey Bugaev, le dim. 17 nov. 2024 16:04:53 +0300, a ecrit: > By the way: apparently gnumach already has some sort of an rtc driver > (at i386/i386at/rtc.c). What do we do about that? We should make it stop updating the RTC on setting the time. That's supposed to be done at shutdown by /e

Re: [RFC PATCH] Add rtc server, rtc-read and rtc-set operations

2024-11-17 Thread Sergey Bugaev
On Sun, Nov 17, 2024 at 3:34 PM Zhaoming Luo wrote: > Hi, Hi, looks nice to me overall, thanks for working on this! I cannot judge the actual driver part, so here are some nitpicks about not following the GNU code style :D I will try to build and test it later. By the way: apparently gnumach al

[RFC PATCH] Add rtc server, rtc-read and rtc-set operations

2024-11-17 Thread Zhaoming Luo
Hi, I have tested the read and set operations, they seemd fine. RTC has automatic leap year compensation, it's quite fun to see the effect. I still have a few questions: - Day of year is not stored in RTC[0], though we can calculate it when we are reading RTC based on year, month, and day of mo