Преглед изворни кода

Remove all legacy text and 13h VGA mode code

Johannes Zellner пре 8 месеци
родитељ
комит
90d4eb28f9
7 измењених фајлова са 63 додато и 363 уклоњено
  1. 1 4
      boot.S
  2. 18 41
      clock.c
  3. 19 29
      display.c
  4. 2 16
      fbtext.c
  5. 20 72
      io.c
  6. 1 190
      vga.c
  7. 2 11
      vga.h

+ 1 - 4
boot.S

@@ -48,10 +48,7 @@ loader_start:
 	subw  $1, %cx		/* 0x11C -> 0x11B -> 0x118 -> 0x114 */
 	jmp   1b
 vesa_fail:
-	xorw  %ax, %ax
-	movw  $0x600, %bx
-	movb  %al, (%bx)	/* valid = 0 */
-	jmp   load_kernel
+	jmp   halt
 vesa_ok:
 	movw  $0x6000, %di	/* Reload: int 0x10/4F02 may trash DI */
 	movw  $0x600, %bx

+ 18 - 41
clock.c

@@ -1,11 +1,11 @@
-/* clock command: analog clock in VESA LFB (or mode 13h fallback). Press ESC to return. */
+/* clock command: analog clock in VESA LFB. Press ESC to return. */
 
 #include "io.h"
 #include "rtc.h"
 #include "timer.h"
 #include "vga.h"
 
-/* VGA palette index to RGB (for LFB). 0=black, 7=gray, 12=light red, 15=white */
+/* Palette index to RGB. 0=black, 7=gray, 12=light red, 15=white */
 static const unsigned int pal_r[16] = { 0, 0, 0, 0, 170, 170, 170, 170, 85, 85, 85, 85, 255, 255, 255, 255 };
 static const unsigned int pal_g[16] = { 0, 0, 170, 170, 0, 0, 85, 170, 85, 85, 255, 255, 85, 85, 255, 255 };
 static const unsigned int pal_b[16] = { 0, 170, 0, 170, 0, 170, 0, 170, 85, 255, 85, 255, 85, 255, 85, 255 };
@@ -38,24 +38,17 @@ static const signed char tab_y[60] = {
 	-47,-51,-55,-59,-62,-63
 };
 
-static int clock_use_vesa;
 static unsigned int clock_cx, clock_cy, clock_radius, clock_rad_hour, clock_rad_min, clock_rad_sec, clock_tick_len;
 
 static void put_pixel(int x, int y, unsigned char color)
 {
-	if (clock_use_vesa)
-		vga_put_pixel_rgb((unsigned int)x, (unsigned int)y,
-			pal_r[color], pal_g[color], pal_b[color]);
-	else
-		vga_put_pixel(x, y, color);
+	vga_put_pixel_rgb((unsigned int)x, (unsigned int)y,
+		pal_r[color], pal_g[color], pal_b[color]);
 }
 
 static void clear_screen(unsigned char color)
 {
-	if (clock_use_vesa)
-		vga_clear_rgb(pal_r[color], pal_g[color], pal_b[color]);
-	else
-		vga_clear(color);
+	vga_clear_rgb(pal_r[color], pal_g[color], pal_b[color]);
 }
 
 static void draw_line(int x0, int y0, int x1, int y1, unsigned char color)
@@ -162,31 +155,19 @@ void program_clock_main(void)
 	unsigned int tick;
 	unsigned int w, h_;
 
-	clock_use_vesa = vga_has_vesa();
-	if (clock_use_vesa) {
-		w = vga_fb_width();
-		h_ = vga_fb_height();
-		clock_cx = w / 2;
-		clock_cy = h_ / 2;
-		clock_radius = (w < h_) ? (w / 2) : (h_ / 2);
-		if (clock_radius > 200)
-			clock_radius = 200;
-		clock_rad_hour = clock_radius / 2;
-		clock_rad_min = clock_radius * 7 / 10;
-		clock_rad_sec = clock_radius * 9 / 10;
-		clock_tick_len = clock_radius / 13;
-		if (clock_tick_len < 2)
-			clock_tick_len = 2;
-	} else {
-		vga_set_mode_13();
-		clock_cx = 160;
-		clock_cy = 100;
-		clock_radius = 80;
-		clock_rad_hour = 40;
-		clock_rad_min = 56;
-		clock_rad_sec = 72;
-		clock_tick_len = 6;
-	}
+	w = vga_fb_width();
+	h_ = vga_fb_height();
+	clock_cx = w / 2;
+	clock_cy = h_ / 2;
+	clock_radius = (w < h_) ? (w / 2) : (h_ / 2);
+	if (clock_radius > 200)
+		clock_radius = 200;
+	clock_rad_hour = clock_radius / 2;
+	clock_rad_min = clock_radius * 7 / 10;
+	clock_rad_sec = clock_radius * 9 / 10;
+	clock_tick_len = clock_radius / 13;
+	if (clock_tick_len < 2)
+		clock_tick_len = 2;
 
 	clear_screen(COL_BG);
 	io_drain_keyboard();
@@ -209,8 +190,4 @@ void program_clock_main(void)
 			__asm__ volatile ("hlt");
 	}
 
-	if (!clock_use_vesa) {
-		vga_set_mode_text();
-		io_clear_screen();
-	}
 }

+ 19 - 29
display.c

@@ -44,33 +44,23 @@ static void put_hex(unsigned int n)
 
 void program_display_main(void)
 {
-	if (vga_has_vesa()) {
-		io_putstr("resolution ");
-		put_uint(vga_fb_width());
-		io_putstr(" x ");
-		put_uint(vga_fb_height());
-		io_putchar('\n');
-		io_putstr("color depth ");
-		put_uint(vga_fb_bpp());
-		io_putstr(" bpp\n");
-		io_putstr("pitch ");
-		put_uint(vga_fb_pitch());
-		io_putstr(" bytes/line\n");
-		io_putstr("LFB ");
-		put_hex((unsigned int)(unsigned long)vga_fb_ptr());
-		io_putchar('\n');
-		if (fbtext_active()) {
-			io_putstr("text ");
-			put_uint(fbtext_get_cols());
-			io_putstr(" x ");
-			put_uint(fbtext_get_rows());
-			io_putstr(" chars\n");
-		}
-	} else {
-		io_putstr("VESA not available; VGA text ");
-		put_uint(io_get_cols());
-		io_putstr(" x ");
-		put_uint(io_get_rows());
-		io_putstr(" chars\n");
-	}
+	io_putstr("resolution ");
+	put_uint(vga_fb_width());
+	io_putstr(" x ");
+	put_uint(vga_fb_height());
+	io_putchar('\n');
+	io_putstr("color depth ");
+	put_uint(vga_fb_bpp());
+	io_putstr(" bpp\n");
+	io_putstr("pitch ");
+	put_uint(vga_fb_pitch());
+	io_putstr(" bytes/line\n");
+	io_putstr("LFB ");
+	put_hex((unsigned int)(unsigned long)vga_fb_ptr());
+	io_putchar('\n');
+	io_putstr("text ");
+	put_uint(fbtext_get_cols());
+	io_putstr(" x ");
+	put_uint(fbtext_get_rows());
+	io_putstr(" chars\n");
 }

+ 2 - 16
fbtext.c

@@ -50,12 +50,6 @@ static void attr_to_rgb(unsigned char attr, int fg, unsigned int *r, unsigned in
 
 void fbtext_init(void)
 {
-	if (!vga_has_vesa()) {
-		fbtext_use_lfb = 0;
-		fbtext_cols = 80;
-		fbtext_rows = 25;
-		return;
-	}
 	fbtext_use_lfb = 1;
 	fbtext_cols = vga_fb_width() / 8;
 	{
@@ -86,8 +80,6 @@ unsigned int fbtext_get_rows(void)
 
 void fbtext_clear(void)
 {
-	if (!fbtext_use_lfb)
-		return;
 	vga_clear_rgb(0, 0, 0);
 }
 
@@ -118,8 +110,6 @@ static void draw_glyph(unsigned int col, unsigned int row, unsigned char c, unsi
 
 void fbtext_put_char_at(unsigned int col, unsigned int row, unsigned char c, unsigned char attr)
 {
-	if (!fbtext_use_lfb)
-		return;
 	if (col >= fbtext_cols || row >= fbtext_rows)
 		return;
 	draw_glyph(col, row, c, attr);
@@ -132,7 +122,7 @@ void fbtext_scroll_up_one_line(void)
 	volatile unsigned char *fb = (volatile unsigned char *)vga_fb_ptr();
 	unsigned int height = vga_fb_height();
 
-	if (!fbtext_use_lfb || !fb)
+	if (!fb)
 		return;
 	if (height <= CONTENT_TOP + ROW_HEIGHT)
 		return;
@@ -169,8 +159,6 @@ void fbtext_show_cursor(void)
 	unsigned int x, y;
 	unsigned int r, g, b;
 
-	if (!fbtext_use_lfb)
-		return;
 	fbtext_cursor_visible = 1;
 	attr_to_rgb(0x0F, 1, &r, &g, &b); /* white line */
 	for (y = 0; y < CURSOR_H; y++)
@@ -206,8 +194,6 @@ static void draw_glyph_cursor_region(unsigned int col, unsigned int row, unsigne
 
 void fbtext_hide_cursor(unsigned char c, unsigned char attr)
 {
-	if (!fbtext_use_lfb)
-		return;
 	if (fbtext_cursor_visible) {
 		fbtext_cursor_visible = 0;
 		draw_glyph_cursor_region(fbtext_cur_col, fbtext_cur_row, c, attr);
@@ -246,7 +232,7 @@ void fbtext_draw_rainbow_separator(void)
 	unsigned int x, y;
 	unsigned int r, g, b;
 
-	if (!fbtext_use_lfb || w == 0)
+	if (w == 0)
 		return;
 	for (y = 0; y < RAINBOW_LINE_HEIGHT; y++) {
 		unsigned int py = RAINBOW_TOP + y;

+ 20 - 72
io.c

@@ -1,9 +1,8 @@
-/* I/O library: VGA text output and PS/2 keyboard. */
+/* I/O library: framebuffer text output and PS/2 keyboard. */
 
 #include "io.h"
 #include "fbtext.h"
 
-#define VGA_BASE ((volatile unsigned short *)0xB8000)
 #define VGA_ATTR 0x0A
 
 static unsigned int io_cols = 80;
@@ -23,12 +22,6 @@ static inline void outb(unsigned short port, unsigned char v)
 	__asm__ volatile ("outb %0, %1" : : "a"(v), "Nd"(port));
 }
 
-static void disable_hw_cursor(void)
-{
-	outb(0x3D4, 0x0A);
-	outb(0x3D5, 0x20);
-}
-
 /* Scancode set 1 (XT) -> ASCII. 0 = ignore. */
 static const unsigned char scancode_to_ascii[256] __attribute__((section(".rodata"))) = {
 	[0x01] = 0x1B,  /* Escape */
@@ -95,14 +88,10 @@ static char apply_shift(char c)
 
 static void hide_cursor_at(unsigned int pos)
 {
-	if (fbtext_active()) {
-		unsigned int col = pos % io_cols;
-		unsigned int row = pos / io_cols;
-		fbtext_set_cursor(col, row);
-		fbtext_hide_cursor((unsigned char)(cursor_cell & 0xFF), (unsigned char)(cursor_cell >> 8));
-	} else {
-		VGA_BASE[pos] = cursor_cell;
-	}
+	unsigned int col = pos % io_cols;
+	unsigned int row = pos / io_cols;
+	fbtext_set_cursor(col, row);
+	fbtext_hide_cursor((unsigned char)(cursor_cell & 0xFF), (unsigned char)(cursor_cell >> 8));
 }
 
 unsigned int io_get_cols(void)
@@ -118,14 +107,8 @@ unsigned int io_get_rows(void)
 void io_init(void)
 {
 	fbtext_init();
-	if (fbtext_active()) {
-		io_cols = fbtext_get_cols();
-		io_rows = fbtext_get_rows();
-	} else {
-		io_cols = 80;
-		io_rows = 25;
-		disable_hw_cursor();
-	}
+	io_cols = fbtext_get_cols();
+	io_rows = fbtext_get_rows();
 	io_clear_screen();
 	cursor = IO_CONTENT_OFFSET;
 	cursor_cell = (unsigned short)(VGA_ATTR << 8);
@@ -134,15 +117,7 @@ void io_init(void)
 
 void io_clear_screen(void)
 {
-	if (fbtext_active()) {
-		fbtext_clear();
-		return;
-	}
-	{
-		unsigned int i;
-		for (i = 0; i < io_rows * io_cols; i++)
-			VGA_BASE[i] = (unsigned short)(VGA_ATTR << 8);
-	}
+	fbtext_clear();
 }
 
 int io_did_scroll(void)
@@ -163,16 +138,8 @@ void io_putchar(char c)
 		hide_cursor_at(cursor);
 		cursor = (cursor / ncols + 1) * ncols;
 		if (cursor >= content_off + content_size) {
-			if (fbtext_active()) {
-				fbtext_scroll_up_one_line();
-			} else {
-				unsigned int i;
-				for (i = 0; i < (io_rows - 2) * ncols; i++)
-					VGA_BASE[content_off + i] = VGA_BASE[content_off + i + ncols];
-				for (i = (io_rows - 2) * ncols; i < content_size; i++)
-					VGA_BASE[content_off + i] = (unsigned short)(VGA_ATTR << 8);
-			}
-			cursor = content_off + (io_rows - 2) * ncols; /* first cell of last content row */
+			fbtext_scroll_up_one_line();
+			cursor = content_off + (io_rows - 2) * ncols;
 			scroll_occurred = 1;
 		}
 		cursor_cell = (unsigned short)(VGA_ATTR << 8);
@@ -182,24 +149,20 @@ void io_putchar(char c)
 		if (cursor > content_off) {
 			hide_cursor_at(cursor);
 			cursor--;
-			if (fbtext_active()) {
+			{
 				unsigned int col = cursor % ncols;
 				unsigned int row = cursor / ncols;
 				fbtext_put_char_at(col, row, ' ', VGA_ATTR);
-			} else {
-				VGA_BASE[cursor] = (unsigned short)((VGA_ATTR << 8) | ' ');
 			}
 			cursor_cell = (unsigned short)((VGA_ATTR << 8) | ' ');
 		}
 		return;
 	}
 	if (cursor < content_off + content_size) {
-		if (fbtext_active()) {
+		{
 			unsigned int col = cursor % ncols;
 			unsigned int row = cursor / ncols;
 			fbtext_put_char_at(col, row, (unsigned char)c, VGA_ATTR);
-		} else {
-			VGA_BASE[cursor] = (unsigned short)((VGA_ATTR << 8) | (unsigned char)c);
 		}
 		cursor++;
 		cursor_cell = (unsigned short)(VGA_ATTR << 8);
@@ -222,41 +185,26 @@ void io_set_cursor(unsigned int pos)
 		return;
 	hide_cursor_at(cursor);
 	cursor = pos;
-	if (fbtext_active())
-		cursor_cell = (unsigned short)(VGA_ATTR << 8);
-	else
-		cursor_cell = VGA_BASE[cursor];
-	if (fbtext_active())
-		fbtext_set_cursor(cursor % io_cols, cursor / io_cols);
+	cursor_cell = (unsigned short)(VGA_ATTR << 8);
+	fbtext_set_cursor(cursor % io_cols, cursor / io_cols);
 }
 
 void io_cursor_show_block(void)
 {
-	if (fbtext_active()) {
-		fbtext_set_cursor(cursor % io_cols, cursor / io_cols);
-		fbtext_show_cursor();
-	} else {
-		VGA_BASE[cursor] = (unsigned short)((VGA_ATTR << 8) | 0xDB);
-	}
+	fbtext_set_cursor(cursor % io_cols, cursor / io_cols);
+	fbtext_show_cursor();
 }
 
 void io_cursor_hide_block(void)
 {
-	if (fbtext_active())
-		fbtext_hide_cursor((unsigned char)(cursor_cell & 0xFF), (unsigned char)(cursor_cell >> 8));
-	else
-		VGA_BASE[cursor] = cursor_cell;
+	fbtext_hide_cursor((unsigned char)(cursor_cell & 0xFF), (unsigned char)(cursor_cell >> 8));
 }
 
 void io_vga_write(unsigned int pos, unsigned short value)
 {
-	if (fbtext_active()) {
-		unsigned int col = pos % io_cols;
-		unsigned int row = pos / io_cols;
-		fbtext_put_char_at(col, row, (unsigned char)(value & 0xFF), (unsigned char)(value >> 8));
-	} else {
-		VGA_BASE[pos] = value;
-	}
+	unsigned int col = pos % io_cols;
+	unsigned int row = pos / io_cols;
+	fbtext_put_char_at(col, row, (unsigned char)(value & 0xFF), (unsigned char)(value >> 8));
 }
 
 void io_drain_keyboard(void)

+ 1 - 190
vga.c

@@ -1,9 +1,7 @@
-/* VGA: VESA LFB (from boot) or legacy mode 13h / mode 03h. */
+/* VGA: VESA LFB (from boot). */
 
 #include "vga.h"
 
-#define VGA_FB ((volatile unsigned char *)0xA0000)
-
 /* Cached boot framebuffer info (set once when vga_fb_* first used). */
 static unsigned int vga_fb_w, vga_fb_h, vga_fb_pitch_val, vga_fb_bpp_val;
 static volatile unsigned char *vga_fb_lfb;
@@ -48,193 +46,6 @@ static void vga_cache_boot_fb(void)
 	vga_fb_lfb = (volatile unsigned char *)(unsigned long)info->lfb_base;
 }
 
-static inline void outb(unsigned short port, unsigned char v)
-{
-	__asm__ volatile ("outb %0, %1" : : "a"(v), "Nd"(port));
-}
-
-static inline unsigned char inb(unsigned short port)
-{
-	unsigned char v;
-	__asm__ volatile ("inb %1, %0" : "=a"(v) : "Nd"(port));
-	return v;
-}
-
-/* ---- low-level register helpers ---- */
-
-static void write_seq(unsigned char idx, unsigned char val)
-{
-	outb(0x3C4, idx);
-	outb(0x3C5, val);
-}
-
-static void write_crtc(unsigned char idx, unsigned char val)
-{
-	outb(0x3D4, idx);
-	outb(0x3D5, val);
-}
-
-static void write_gc(unsigned char idx, unsigned char val)
-{
-	outb(0x3CE, idx);
-	outb(0x3CF, val);
-}
-
-static void crtc_unlock(void)
-{
-	outb(0x3D4, 0x11);
-	outb(0x3D5, inb(0x3D5) & 0x7F);
-}
-
-/* ---- register tables ---- */
-
-/* Mode 13h: 320x200, 256 colors, chain-4, framebuffer at 0xA0000 */
-static const unsigned char misc_13  = 0x63;
-static const unsigned char seq_13[]  = { 0x03, 0x01, 0x0F, 0x00, 0x0E };
-static const unsigned char crtc_13[] = {
-	0x5F, 0x4F, 0x50, 0x82, 0x54, 0x80, 0xBF, 0x1F,
-	0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-	0x9C, 0x0E, 0x8F, 0x28, 0x40, 0x96, 0xB9, 0xA3, 0xFF
-};
-static const unsigned char gc_13[]   = {
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0F, 0xFF
-};
-static const unsigned char ac_13[]   = {
-	0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
-	0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
-	0x41, 0x00, 0x0F, 0x00, 0x00
-};
-
-/* Mode 03h: 80x25, 16-color text, framebuffer at 0xB8000 */
-static const unsigned char misc_03  = 0x67;
-static const unsigned char seq_03[]  = { 0x03, 0x00, 0x03, 0x00, 0x02 };
-static const unsigned char crtc_03[] = {
-	0x5F, 0x4F, 0x50, 0x82, 0x55, 0x81, 0xBF, 0x1F,
-	0x00, 0x4F, 0x20, 0x0E, 0x00, 0x00, 0x00, 0x00,
-	0x9C, 0x0E, 0x8F, 0x28, 0x1F, 0x96, 0xB9, 0xA3, 0xFF
-};
-static const unsigned char gc_03[]   = {
-	0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0E, 0x00, 0xFF
-};
-static const unsigned char ac_03[]   = {
-	0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,
-	0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
-	0x0C, 0x00, 0x0F, 0x08, 0x00
-};
-
-/* ---- font buffer: 256 chars x 32 bytes/char ---- */
-#define FONT_SIZE 8192
-static unsigned char font_buf[FONT_SIZE];
-
-/* ---- set all VGA registers for a mode ---- */
-
-static void set_regs(unsigned char misc,
-	const unsigned char *seq, const unsigned char *crtc,
-	const unsigned char *gc, const unsigned char *ac)
-{
-	unsigned int i;
-
-	/* Misc Output */
-	outb(0x3C2, misc);
-
-	/* Sequencer: sync reset, write 1-4, release */
-	write_seq(0, 0x01);
-	for (i = 1; i < 5; i++)
-		write_seq((unsigned char)i, seq[i]);
-	write_seq(0, seq[0]);
-
-	/* CRTC: unlock then write all 25 */
-	crtc_unlock();
-	for (i = 0; i < 25; i++)
-		write_crtc((unsigned char)i, crtc[i]);
-
-	/* Graphics Controller */
-	for (i = 0; i < 9; i++)
-		write_gc((unsigned char)i, gc[i]);
-
-	/* Attribute Controller */
-	(void)inb(0x3DA);  /* reset flip-flop */
-	for (i = 0; i < 21; i++) {
-		outb(0x3C0, (unsigned char)i);
-		outb(0x3C0, ac[i]);
-	}
-	/* Re-enable display (PAS bit) */
-	(void)inb(0x3DA);
-	outb(0x3C0, 0x20);
-}
-
-/* ---- font save / restore via plane 2 ---- */
-
-static void font_plane_access(void)
-{
-	write_seq(0, 0x01);       /* sync reset */
-	write_seq(2, 0x04);       /* map mask: plane 2 only */
-	write_seq(4, 0x06);       /* sequential access, extended memory */
-	write_seq(0, 0x03);       /* release reset */
-	write_gc(4, 0x02);        /* read map select: plane 2 */
-	write_gc(5, 0x00);        /* mode: read/write mode 0 */
-	write_gc(6, 0x00);        /* misc: A0000, 128K window */
-}
-
-static void text_plane_access(void)
-{
-	write_seq(0, 0x01);       /* sync reset */
-	write_seq(2, 0x03);       /* map mask: planes 0 + 1 */
-	write_seq(4, 0x02);       /* odd/even, extended memory */
-	write_seq(0, 0x03);       /* release reset */
-	write_gc(4, 0x00);        /* read map select: plane 0 */
-	write_gc(5, 0x10);        /* odd/even mode */
-	write_gc(6, 0x0E);        /* B8000, 32K window */
-}
-
-static void save_font(void)
-{
-	unsigned int i;
-
-	font_plane_access();
-	for (i = 0; i < FONT_SIZE; i++)
-		font_buf[i] = VGA_FB[i];
-}
-
-static void restore_font(void)
-{
-	unsigned int i;
-
-	font_plane_access();
-	for (i = 0; i < FONT_SIZE; i++)
-		VGA_FB[i] = font_buf[i];
-	text_plane_access();
-}
-
-/* ---- public API ---- */
-
-void vga_set_mode_13(void)
-{
-	save_font();
-	set_regs(misc_13, seq_13, crtc_13, gc_13, ac_13);
-}
-
-void vga_set_mode_text(void)
-{
-	set_regs(misc_03, seq_03, crtc_03, gc_03, ac_03);
-	restore_font();
-}
-
-void vga_put_pixel(int x, int y, unsigned char color)
-{
-	if (x >= 0 && x < VGA_GFX_WIDTH && y >= 0 && y < VGA_GFX_HEIGHT)
-		VGA_FB[y * VGA_GFX_WIDTH + x] = color;
-}
-
-void vga_clear(unsigned char color)
-{
-	unsigned int i;
-	unsigned int n = VGA_GFX_WIDTH * VGA_GFX_HEIGHT;
-
-	for (i = 0; i < n; i++)
-		VGA_FB[i] = color;
-}
-
 /* ---- LFB API ---- */
 
 unsigned int vga_fb_width(void)

+ 2 - 11
vga.h

@@ -1,11 +1,7 @@
-/* VGA: VESA LFB (from boot) or legacy mode 13h / text mode 03h. */
+/* VGA: VESA LFB (from boot). */
 #ifndef VGA_H
 #define VGA_H
 
-/* Legacy mode 13h (320x200 256-color); used only when no VESA. */
-#define VGA_GFX_WIDTH   320
-#define VGA_GFX_HEIGHT  200
-
 /* Boot video info at 0x600 (written by boot.S in safe conventional memory).
    Layout: valid(1) width(2) height(2) pitch(2) bpp(1) lfb_base(4) = 12 bytes. */
 struct vga_boot_fb_info {
@@ -19,12 +15,7 @@ struct vga_boot_fb_info {
 
 #define VGA_BOOT_FB ((volatile struct vga_boot_fb_info *)0x600)
 
-void vga_set_mode_13(void);
-void vga_set_mode_text(void);
-void vga_put_pixel(int x, int y, unsigned char color);
-void vga_clear(unsigned char color);
-
-/* LFB API (use when VESA valid). RGB 0..255. */
+/* LFB API. RGB 0..255. */
 unsigned int vga_fb_width(void);
 unsigned int vga_fb_height(void);
 unsigned int vga_fb_pitch(void);