Skip to content

Graphics System

NtinosTheGamer2324 edited this page Dec 11, 2025 · 2 revisions

Graphics System

ModuOS currently uses VGA text mode for display output.

VGA Text Mode

Resolution: 80 columns × 25 rows Character cells: 16 colors foreground + 8 colors background

VGA Driver

File: src/drivers/graphics/VGA.c

VGA Memory

Memory-mapped: 0xB8000

Character format (16-bit):

Bits 0-7:   ASCII character
Bits 8-11:  Foreground color
Bits 12-14: Background color
Bit 15:     Blink attribute

Color Codes

Code Color
0x0 Black
0x1 Blue
0x2 Green
0x3 Cyan
0x4 Red
0x5 Magenta
0x6 Brown
0x7 Light Gray
0x8 Dark Gray
0x9 Light Blue
0xA Light Green
0xB Light Cyan
0xC Light Red
0xD Light Magenta
0xE Yellow
0xF White

VGA API

// Initialize VGA
void VGA_init(void);

// Clear screen
void VGA_clear_screen(void);

// Print string
void VGA_print(const char *str);

// Print with color
void VGA_print_color(const char *str, uint8_t color);

// Set cursor position
void VGA_set_cursor(int x, int y);

// Get cursor position
void VGA_get_cursor(int *x, int *y);

Usage Example

#include "moduos/drivers/graphics/VGA.h"

VGA_init();
VGA_clear_screen();
VGA_print("Hello, ModuOS!\n");

// Print in color
uint8_t red_on_black = 0x04;  // Red foreground
VGA_print_color("Error message", red_on_black);

VBE (VESA BIOS Extensions)

Status: Partial implementation

Purpose: Support for higher resolution graphics modes

Planned features:

  • Framebuffer access
  • Multiple resolutions
  • Pixel-based graphics

Future Graphics

Planned enhancements:

  • Framebuffer console: Higher resolution text
  • GUI framework: Windows, buttons, etc.
  • Hardware acceleration: GPU support
  • Modern drivers: Intel/AMD/NVIDIA graphics

Next Steps

Clone this wiki locally