aboutsummaryrefslogtreecommitdiff
path: root/mubios/include/io.h
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-11-10 02:29:20 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-11-10 02:29:20 +0800
commit7ecf4901b486693e525d3daafc7d6e9c3a4abcd0 (patch)
tree722ed5d7919170cedef44bdb22bc87ab98a47682 /mubios/include/io.h
parent03c2c766aad0746ca3e71b44756b443ae8742e95 (diff)
downloadrcc-project-7ecf4901b486693e525d3daafc7d6e9c3a4abcd0.tar.gz
rcc-project-7ecf4901b486693e525d3daafc7d6e9c3a4abcd0.tar.xz
[mubios] Complete VGA text initialization and add VBE graphics services
Load the 8x16 font and VGA palette, restore text memory mapping, and synchronize BIOS cursor and page state with the hardware. Allocate QEMU standard VGA PCI memory resources and expose VBE controller information, mode queries and switching, logical scanline lengths, and display start control. Signed-off-by: Richard Qin <richard.qin.x@gmail.com>
Diffstat (limited to 'mubios/include/io.h')
-rw-r--r--mubios/include/io.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/mubios/include/io.h b/mubios/include/io.h
index cedd1c1..a056c13 100644
--- a/mubios/include/io.h
+++ b/mubios/include/io.h
@@ -50,4 +50,25 @@ io_in16 (u16 port)
return value;
}
+static inline void
+io_out16 (u16 port, u16 value)
+{
+ __asm__ volatile ("outw %0, %1" : : "a"(value), "Nd"(port));
+}
+
+static inline u32
+io_in32 (u16 port)
+{
+ u32 value;
+
+ __asm__ volatile ("inl %1, %0" : "=a"(value) : "Nd"(port));
+ return value;
+}
+
+static inline void
+io_out32 (u16 port, u32 value)
+{
+ __asm__ volatile ("outl %0, %1" : : "a"(value), "Nd"(port));
+}
+
#endif // MUBIOS_IO_H