Files
RockOS/kernel/drivers/vga/vga.h

47 lines
947 B
C
Raw Normal View History

#ifndef DVGA_H
#define DVGA_H
2026-07-10 07:46:46 -05:00
#include <vfs.h>
2026-07-14 17:40:30 -05:00
#include <lib/font.h>
2026-07-15 08:07:06 -05:00
#define VGA_FRAMEBUFFER 0xF0000000
typedef struct {
uint8_t b;
uint8_t g;
uint8_t r;
uint8_t a;
} vga_color_t;
extern vga_color_t VGA_COLOR_BLACK;
extern vga_color_t VGA_COLOR_RED;
extern vga_color_t VGA_COLOR_GREEN;
extern vga_color_t VGA_COLOR_BLUE;
2026-07-10 07:46:46 -05:00
2026-07-14 00:07:50 -05:00
void vga_init(
2026-07-14 17:40:30 -05:00
uint32_t fb_paddr,
2026-07-14 00:07:50 -05:00
uint32_t fb_width,
uint32_t fb_height,
uint32_t fb_pitch,
2026-07-15 08:07:06 -05:00
uint8_t fb_bpp,
uint8_t red_mask_sz,
uint8_t red_field_pos,
uint8_t green_mask_sz,
uint8_t green_field_pos,
uint8_t blue_mask_sz,
uint8_t blue_field_pos
2026-07-14 00:07:50 -05:00
);
2026-07-15 08:07:06 -05:00
uint32_t vga_get_framebuffer();
uint32_t vga_get_width();
uint32_t vga_get_height();
2026-07-14 17:40:30 -05:00
uint32_t vga_get_pitch();
2026-07-15 08:07:06 -05:00
uint8_t vga_get_bpp();
2026-07-14 17:40:30 -05:00
2026-07-14 00:07:50 -05:00
void vga_clear_scrn(uint32_t color);
2026-07-10 07:46:46 -05:00
uint32_t vga_write(vfs_node_t* node, uint32_t offset, uint32_t size, uint8_t* buf);
2026-07-15 23:02:24 -05:00
void test_draw_vertical_line(uint32_t x, uint32_t y_start, uint32_t y_end, uint32_t color);
#endif