/** * @file framebuffer.h * @brief Framebuffer information from the bootloader. * * Stores the display mode and framebuffer address provided by GRUB * via the multiboot2 framebuffer tag. The VGA driver uses this to * decide between text-mode writes (0xB8000) and pixel rendering. */ #ifndef FRAMEBUFFER_H #define FRAMEBUFFER_H #include /** Framebuffer types (matches multiboot2 definitions). */ #define FB_TYPE_INDEXED 0 #define FB_TYPE_RGB 1 #define FB_TYPE_EGA_TEXT 2 /** * Framebuffer information structure. * Populated during boot from the multiboot2 framebuffer tag. */ typedef struct { uint32_t addr; /**< Physical address of the framebuffer. */ uint32_t pitch; /**< Bytes per scanline. */ uint32_t width; /**< Width in pixels (or columns for text). */ uint32_t height; /**< Height in pixels (or rows for text). */ uint8_t bpp; /**< Bits per pixel. */ uint8_t type; /**< FB_TYPE_RGB, FB_TYPE_EGA_TEXT, etc. */ /* RGB field positions (only valid when type == FB_TYPE_RGB). */ uint8_t red_pos; uint8_t red_size; uint8_t green_pos; uint8_t green_size; uint8_t blue_pos; uint8_t blue_size; } framebuffer_info_t; /** Global framebuffer info, filled by kernel_main. */ extern framebuffer_info_t fb_info; #endif /* FRAMEBUFFER_H */