mirror of
https://github.com/cowmonk/cowos.git
synced 2025-10-27 22:43:26 +00:00
framebuffer driver and a working gdt
This commit is contained in:
parent
49bf45abc8
commit
4a304f7b63
9 changed files with 761 additions and 40 deletions
29
kernel/include/drivers/video/framebuffer.h
Normal file
29
kernel/include/drivers/video/framebuffer.h
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#ifndef FRAMEBUFFER_H
|
||||
#define FRAMEBUFFER_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <limine.h>
|
||||
|
||||
#define FB_CHAR_WIDTH 8
|
||||
#define FB_CHAR_HEIGHT 16
|
||||
|
||||
typedef struct {
|
||||
uint32_t fg_color;
|
||||
uint32_t bg_color;
|
||||
uint32_t cursor_x;
|
||||
uint32_t cursor_y;
|
||||
uint32_t cols;
|
||||
uint32_t rows;
|
||||
struct limine_framebuffer *fb;
|
||||
} fb_console_t;
|
||||
|
||||
void fb_init(void);
|
||||
void fb_putchar(char c);
|
||||
void fb_puts(const char *str);
|
||||
void fb_clear(void);
|
||||
void fb_set_color(uint32_t fg, uint32_t bg);
|
||||
void fb_printf(const char *fmt, ...);
|
||||
void fb_draw_rect(uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint32_t color);
|
||||
|
||||
#endif /* FRAMEBUFFER_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue