aboutsummaryrefslogtreecommitdiff
path: root/mubios/drivers/cmos.c
diff options
context:
space:
mode:
Diffstat (limited to 'mubios/drivers/cmos.c')
-rw-r--r--mubios/drivers/cmos.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/mubios/drivers/cmos.c b/mubios/drivers/cmos.c
new file mode 100644
index 0000000..35148d8
--- /dev/null
+++ b/mubios/drivers/cmos.c
@@ -0,0 +1,20 @@
+/*
+ RCC-Project
+
+ Copyright (C) 2026 Richard Qin
+
+ This file is part of RCC-Project.
+ */
+
+#include "bios.h"
+#include "io.h"
+
+#define CMOS_INDEX_PORT 0x0070u
+#define CMOS_DATA_PORT 0x0071u
+
+u8
+cmos_read8 (u8 index)
+{
+ io_out8 (CMOS_INDEX_PORT, index);
+ return io_in8 (CMOS_DATA_PORT);
+}