diff options
| author | Richard Qin <richard.qin.x@gmail.com> | 2026-11-10 01:16:40 +0800 |
|---|---|---|
| committer | Richard Qin <richard.qin.x@gmail.com> | 2026-11-10 01:16:40 +0800 |
| commit | 4a9624da0c7cf0c27a00e1ff497d13f2e4a0d03e (patch) | |
| tree | 91b95e736fa08a071e7814872fc822c2d3fcd682 /mubios/drivers/vga.c | |
| parent | 9f45c30789b6133d4b5fb4ef07f0818a3ea4de48 (diff) | |
| download | rcc-project-4a9624da0c7cf0c27a00e1ff497d13f2e4a0d03e.tar.gz rcc-project-4a9624da0c7cf0c27a00e1ff497d13f2e4a0d03e.tar.xz | |
[mubios] Implement serial input and BIOS console key handling
Implement UART receive, transmit timeouts, configuration and status reporting for INT 14h functions 00h-03h. Initialize the BDA serial timeout and expose the driver interfaces.
Translate terminal characters and CSI/SS3 escape sequences into BIOS keyboard events for INT 16h. Add blocking reads, non-consuming status queries, enhanced key reads and keyboard buffer insertion.
Diffstat (limited to 'mubios/drivers/vga.c')
| -rw-r--r-- | mubios/drivers/vga.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/mubios/drivers/vga.c b/mubios/drivers/vga.c index 57e1f8f..16f88e5 100644 --- a/mubios/drivers/vga.c +++ b/mubios/drivers/vga.c @@ -35,8 +35,7 @@ #define VGA_ATTR_INDEX_DATA 0x03C0u static void -vga_write_registers (u16 index_port, u16 data_port, const u8 *values, - u8 count) +vga_write_registers (u16 index_port, u16 data_port, const u8 *values, u8 count) { u8 index; @@ -50,19 +49,17 @@ vga_write_registers (u16 index_port, u16 data_port, const u8 *values, void vga_text_mode_init (void) { - static const u8 sequencer[] = {0x00u, 0x00u, 0x03u, 0x00u, 0x02u}; - static const u8 crtc[] = {0x5Fu, 0x4Fu, 0x50u, 0x82u, 0x55u, 0x81u, - 0xBFu, 0x1Fu, 0x00u, 0x4Fu, 0x0Du, 0x0Eu, - 0x00u, 0x00u, 0x00u, 0x00u, 0x9Cu, 0x8Eu, - 0x8Fu, 0x28u, 0x1Fu, 0x96u, 0xB9u, 0xA3u, - 0xFFu}; - static const u8 graphics[] = {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, - 0x10u, 0x0Fu, 0x00u, 0xFFu}; - static const u8 attributes[] = {0x00u, 0x01u, 0x02u, 0x03u, 0x04u, - 0x05u, 0x06u, 0x07u, 0x08u, 0x09u, - 0x0Au, 0x0Bu, 0x0Cu, 0x0Du, 0x0Eu, - 0x0Fu, 0x0Cu, 0x00u, 0x0Fu, 0x08u, - 0x00u}; + static const u8 sequencer[] = { 0x00u, 0x00u, 0x03u, 0x00u, 0x02u }; + static const u8 crtc[] + = { 0x5Fu, 0x4Fu, 0x50u, 0x82u, 0x55u, 0x81u, 0xBFu, 0x1Fu, 0x00u, + 0x4Fu, 0x0Du, 0x0Eu, 0x00u, 0x00u, 0x00u, 0x00u, 0x9Cu, 0x8Eu, + 0x8Fu, 0x28u, 0x1Fu, 0x96u, 0xB9u, 0xA3u, 0xFFu }; + static const u8 graphics[] + = { 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x10u, 0x0Fu, 0x00u, 0xFFu }; + static const u8 attributes[] + = { 0x00u, 0x01u, 0x02u, 0x03u, 0x04u, 0x05u, 0x06u, + 0x07u, 0x08u, 0x09u, 0x0Au, 0x0Bu, 0x0Cu, 0x0Du, + 0x0Eu, 0x0Fu, 0x0Cu, 0x00u, 0x0Fu, 0x08u, 0x00u }; volatile u16 *video; volatile u8 *bda; u16 cell; |
