From 7ecf4901b486693e525d3daafc7d6e9c3a4abcd0 Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Tue, 10 Nov 2026 02:29:20 +0800 Subject: [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 --- mubios/include/io.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'mubios/include/io.h') 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 -- cgit v1.2.3