From 6f997f0d114fbe2e75cf7c5488e030b17aa08a08 Mon Sep 17 00:00:00 2001 From: zhangyang03 Date: Fri, 10 Jul 2026 14:08:13 +0800 Subject: [PATCH] bsps/i386/pc386: Fix RTC diagnostic format The RTC driver used the unsupported BSD-style %b conversion with only the diagnostic register value. This did not provide the intended bitmask decoding. Print the diagnostic register as a two-digit hexadecimal value instead and remove the unused RTCDG_BITS definition. --- bsps/i386/pc386/clock/rtc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bsps/i386/pc386/clock/rtc.c b/bsps/i386/pc386/clock/rtc.c index 185248669c..9ffce4a75d 100644 --- a/bsps/i386/pc386/clock/rtc.c +++ b/bsps/i386/pc386/clock/rtc.c @@ -63,7 +63,6 @@ #define RTCSD_PWR 0x80 /* clock lost power */ #define RTC_DIAG 0x0e /* status register E - bios diagnostic */ -#define RTCDG_BITS "\020\010clock_battery\007ROM_cksum\006config_unit\005memory_size\004fixed_disk\003invalid_time" #define RTC_CENTURY 0x32 /* current century - increment in Dec99 */ @@ -163,10 +162,7 @@ init_rtc(void) outport_byte(IO_RTC, RTC_DIAG); inport_byte (IO_RTC+1, s); if (s) - printk("RTC BIOS diagnostic error %b\n", s); - - /* FIXME: This was last line's original version. How was it supposed to work? - printf("RTC BIOS diagnostic error %b\n", s, RTCDG_BITS); */ + printk("RTC BIOS diagnostic error 0x%02x\n", s); } /* init_rtc */ /*-------------------------------------------------------------------------+ -- Gitee