The MC146818-compatible RTC and its BCD register layout you're reading here is the same hardware the Linux driver drivers/rtc/rtc-cmos.c talks to, and the `hwclock` utility on every Linux distro ultimately issues these same port 0x70/0x71 accesses. Getting BCD-to-decimal conversion wrong is a classic bug that makes a bootloader print a date like '0x59' instead of 59.