Thanks for the review
On 11/25/24 8:57 AM, Samuel Thibault wrote:
This looks good. The last step is then to update util-linux to use
it. The code from sys-utils/hwclock-rtc.c (read_hardware_clock_rtc,
set_hardware_clock_rtc) can be moved out to another file, that a hurd
version could use (you'd add a "HURD =" line along the LINUX and BSD
ones in meson.build:130). And you should then be able to play with
hwclock to manipulate the RTC.
I will do it, but before it I still have a few questions (listing below
with the source code). I will change the name of the translator to
rtc-cmos because I just realised there are many other rtc drivers,
calling it 'rtc' is too generic.
diff --git a/sutils/MAKEDEV.sh b/sutils/MAKEDEV.sh
index c3d7d112..c1ef4f92 100644
--- a/sutils/MAKEDEV.sh
+++ b/sutils/MAKEDEV.sh
@@ -120,10 +120,12 @@ mkdev() {
;;
std)
- mkdev console tty random urandom null zero full fd time mem klog shm
+ mkdev console tty random urandom null zero full fd time mem klog shm rtc
;;
console|com[0-9])
st $I root 600 c /hurd/term ${DEVDIR}/$I device $I;;
+ rtc)
+ st $I root 644 c /hurd/rtc;;
vcs)
st $I root 600 d /hurd/console;;
tty[1-9][0-9]|tty[1-9])
- Should rtc-cmos be appended to std device list in MAKEDEV? (i.e. is
rtc-cmos a standard device?).
- Should we create /dev/rtc in MAKEDEV? I spent some time reading the
documentation about how old Linux (2.0.10) creates /dev/rtc.
Linux-2.0.10 has neither udev nor devfs. According to the following
part, it seems /dev/rtc was expected to be created by users using mknod
depending on their needs (I didn't find any direct evidence). Probably
we just need to provide the translator (/hurd/rtc-cmos) and users just
set up /dev/rtc using settrans depending on their needs?
``` Documentation/Configure.help
Enhanced Real Time Clock Support
CONFIG_RTC
If you enable this option and create a character special file
/dev/rtc with major number 10 and minor number 135 using mknod ("man
mknod"), you will get access to the real time clock built into your
...
```
- Should we consider (/dev/rtcN [0]) at this stage? Linux's /dev/rtcN
seems to depend on its file system[1].
[0]:https://www.kernel.org/doc/html/v6.12/admin-guide/rtc.html
[1]:https://github.com/torvalds/linux/blob/master/drivers/rtc/dev.c#L560-L567
--
Zhaoming Luo