← Documents Documentation/ABI/testing/sysfs-class-rtc GitHub 원문 ↗

Linux 6.18.37 · ABI / testing

RTC class sysfs ABI

RTC device identity, date/time 표현, boot clock source, interrupt limit, valid range, clock offset과 one-shot wakealarm을 설명합니다.

Source pathDocumentation/ABI/testing/sysfs-class-rtc
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

RTC class, devices, and date

sysfs-class-rtc:1-21

RTC subsystem class 아래 rtcX device를 만들고 hardware clock의 date를 YYYY-MM-DD 형식으로 제공합니다.

Boot source, user frequency, identity, and range

sysfs-class-rtc:23-52

Boot 때 system time을 제공했는지, unprivileged interrupt limit, RTC name과 epoch-second valid range를 제공합니다.

Time representations and clock offset

sysfs-class-rtc:54-79

Seconds-since-epoch와 24-hour time을 제공하고 firmware clock adjustment를 parts per billion 단위로 읽고 씁니다.

One-shot wake alarm

sysfs-class-rtc:81-91

Absolute epoch seconds, 현재 시점 기준 +seconds, 현재 alarm 기준 +=seconds 형식으로 one-shot system wake event를 설정합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 What: /sys/class/rtc/
2 Date: March 2006
3 KernelVersion: 2.6.17
5 Description:
6 The rtc/ class subdirectory belongs to the RTC subsystem.
7
8 What: /sys/class/rtc/rtcX/
9 Date: March 2006
10 KernelVersion: 2.6.17
12 Description:
13 The /sys/class/rtc/rtc{0,1,2,3,...} directories correspond
14 to each RTC device.
15
16 What: /sys/class/rtc/rtcX/date
17 Date: March 2006
18 KernelVersion: 2.6.17
20 Description:
21 (RO) RTC-provided date in YYYY-MM-DD format
22
23 What: /sys/class/rtc/rtcX/hctosys
24 Date: September 2009
25 KernelVersion: 2.6.32
27 Description:
28 (RO) 1 if the RTC provided the system time at boot via the
29 CONFIG_RTC_HCTOSYS kernel option, 0 otherwise
30
31 What: /sys/class/rtc/rtcX/max_user_freq
32 Date: October 2007
33 KernelVersion: 2.6.24
35 Description:
36 (RW) The maximum interrupt rate an unprivileged user may request
37 from this RTC.
38
39 What: /sys/class/rtc/rtcX/name
40 Date: March 2006
41 KernelVersion: 2.6.17
43 Description:
44 (RO) The name of the RTC corresponding to this sysfs directory
45
46 What: /sys/class/rtc/rtcX/range
47 Date: January 2018
48 KernelVersion: 4.16
50 Description:
51 Valid time range for the RTC, as seconds from epoch, formatted
52 as [min, max]
53
54 What: /sys/class/rtc/rtcX/since_epoch
55 Date: March 2006
56 KernelVersion: 2.6.17
58 Description:
59 (RO) RTC-provided time as the number of seconds since the epoch
60
61 What: /sys/class/rtc/rtcX/time
62 Date: March 2006
63 KernelVersion: 2.6.17
65 Description:
66 (RO) RTC-provided time in 24-hour notation (hh:mm:ss)
67
68 What: /sys/class/rtc/rtcX/offset
69 Date: February 2016
70 KernelVersion: 4.6
72 Description:
73 (RW) The amount which the rtc clock has been adjusted in
74 firmware. Visible only if the driver supports clock offset
75 adjustment. The unit is parts per billion, i.e. The number of
76 clock ticks which are added to or removed from the rtc's base
77 clock per billion ticks. A positive value makes a day pass more
78 slowly, longer, and a negative value makes a day pass more
79 quickly.
80
81 What: /sys/class/rtc/rtcX/wakealarm
82 Date: February 2007
83 KernelVersion: 2.6.20
85 Description:
86 (RW) The time at which the clock will generate a system wakeup
87 event. This is a one shot wakeup event, so must be reset after
88 wake if a daily wakeup is required. Format is seconds since the
89 epoch by default, or if there's a leading +, seconds in the
90 future, or if there is a leading +=, seconds ahead of the
91 current alarm.
92

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

RTC subsystem class

1-6
항목한국어 전문 번역
What/sys/class/rtc/
Date2006년 3월
KernelVersion2.6.17
Contact[email protected]
Descriptionrtc/ class subdirectory는 RTC subsystem에 속합니다.

RTC device directory

8-14
항목한국어 전문 번역
What/sys/class/rtc/rtcX/
Date2006년 3월
KernelVersion2.6.17
Contact[email protected]
Description/sys/class/rtc/rtc{0,1,2,3,...} directory는 각 RTC device에 대응합니다.
RTC class hierarchy
/sys/class/rtc/rtc0rtc1rtc2 ...

RTC subsystem class 아래 hardware clock별 rtcX instance가 배치됩니다.

RTC-provided date

16-21
항목한국어 전문 번역
What/sys/class/rtc/rtcX/date
Date2006년 3월
KernelVersion2.6.17
Contact[email protected]
Description(RO) RTC가 제공하는 date를 YYYY-MM-DD 형식으로 반환합니다.

RTC used for system time at boot

23-29
항목한국어 전문 번역
What/sys/class/rtc/rtcX/hctosys
Date2009년 9월
KernelVersion2.6.32
Contact[email protected]
Description(RO) CONFIG_RTC_HCTOSYS kernel option을 통해 이 RTC가 boot 때 system time을 제공했으면 1, 그렇지 않으면 0입니다.

Maximum unprivileged interrupt rate

31-37
항목한국어 전문 번역
What/sys/class/rtc/rtcX/max_user_freq
Date2007년 10월
KernelVersion2.6.24
Contact[email protected]
Description(RW) Unprivileged user가 이 RTC에 요청할 수 있는 maximum interrupt rate입니다.

RTC device name

39-44
항목한국어 전문 번역
What/sys/class/rtc/rtcX/name
Date2006년 3월
KernelVersion2.6.17
Contact[email protected]
Description(RO) 이 sysfs directory에 대응하는 RTC의 이름입니다.

Valid RTC time range

46-52
항목한국어 전문 번역
What/sys/class/rtc/rtcX/range
Date2018년 1월
KernelVersion4.16
Contact[email protected]
DescriptionRTC의 valid time range를 epoch부터의 seconds 단위 [min, max] 형식으로 제공합니다.

RTC time since the epoch

54-59
항목한국어 전문 번역
What/sys/class/rtc/rtcX/since_epoch
Date2006년 3월
KernelVersion2.6.17
Contact[email protected]
Description(RO) RTC가 제공하는 time을 epoch 이후 경과한 seconds 수로 반환합니다.

RTC 24-hour time

61-66
항목한국어 전문 번역
What/sys/class/rtc/rtcX/time
Date2006년 3월
KernelVersion2.6.17
Contact[email protected]
Description(RO) RTC가 제공하는 time을 24-hour notation인 hh:mm:ss 형식으로 반환합니다.
RTC time representations
Attribute형식
dateYYYY-MM-DD
timehh:mm:ss, 24-hour
since_epochEpoch 이후 seconds
range[minimum epoch seconds, maximum epoch seconds]

같은 hardware clock을 date, wall-clock time과 epoch seconds로 표현합니다.

Firmware RTC clock adjustment

68-79
항목한국어 전문 번역
What/sys/class/rtc/rtcX/offset
Date2016년 2월
KernelVersion4.6
Contact[email protected]
Description(RW) Firmware에서 RTC clock을 조정한 양입니다. Driver가 clock offset adjustment를 지원할 때만 보입니다. 단위는 parts per billion이며 RTC base clock의 10억 tick마다 더하거나 제거하는 clock tick 수를 뜻합니다. Positive value는 하루가 더 천천히, 더 길게 지나가게 하고 negative value는 하루가 더 빠르게 지나가게 합니다.
RTC offset sign
offsetClock/day effect
Positive하루가 더 천천히, 더 길게 진행
ZeroFirmware offset adjustment 없음
Negative하루가 더 빠르게 진행

Parts-per-billion adjustment의 부호가 clock 진행 속도에 미치는 효과입니다.

One-shot system wake alarm

81-91
항목한국어 전문 번역
What/sys/class/rtc/rtcX/wakealarm
Date2007년 2월
KernelVersion2.6.20
Contact[email protected]
Description(RW) Clock이 system wakeup event를 생성할 time입니다. One-shot wakeup event이므로 daily wakeup이 필요하면 wake 뒤 다시 설정해야 합니다. Default 형식은 epoch 이후 seconds이고, leading +가 있으면 현재 시점에서 future seconds, leading +=가 있으면 current alarm보다 앞선 future seconds를 뜻합니다.
RTC wakealarm input formats
Input기준
<seconds>Epoch 이후 absolute seconds
+<seconds>현재 시점에서 future seconds
+=<seconds>Current alarm에서 추가할 seconds

Prefix에 따라 absolute time 또는 두 종류의 relative offset으로 해석합니다.