summaryrefslogtreecommitdiff
path: root/xxx/vesa.h
diff options
context:
space:
mode:
Diffstat (limited to 'xxx/vesa.h')
-rw-r--r--xxx/vesa.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/xxx/vesa.h b/xxx/vesa.h
new file mode 100644
index 0000000..63fbd55
--- /dev/null
+++ b/xxx/vesa.h
@@ -0,0 +1,57 @@
+//http://wiki.osdev.org/GUI
+
+#include <stdint.h>
+#include "lib/printf/printf.h"
+#include "multiboot.h"
+
+void vesa_update_cursor(uint32_t col,uint32_t row);
+void vesa_console_put_char(uint8_t c,uint8_t color_bg, uint8_t color_fg, uint32_t x, uint32_t y);
+
+typedef struct foolfont_struct
+{
+ uint8_t line[10]; //every single fool font consists of 10 lines a 8 bit
+
+}foolfont;
+
+typedef struct vbeinfo_struct{
+ char VbeSignature[4]; // == "VESA"
+ uint16_t VbeVersion; // == 0x0300 for VBE 3.0
+ uint16_t OemStringPtr[2]; // isa vbeFarPtr
+ uint8_t Capabilities[4];
+ uint16_t VideoModePtr[2]; // isa vbeFarPtr
+ uint16_t TotalMemory; // as # of 64KB blocks
+}vbeinfo;
+
+typedef struct ModeInfoBlock {
+ uint16_t attributes;
+ uint8_t winA,winB;
+ uint16_t granularity;
+ uint16_t winsize;
+ uint16_t segmentA, segmentB;
+ uint16_t realFctPtr[2];
+// VBE_FAR(realFctPtr);
+ uint16_t pitch; // bytes per scanline
+
+ uint16_t Xres, Yres;
+ uint8_t Wchar, Ychar, planes, bpp, banks;
+ uint8_t memory_model, bank_size, image_pages;
+ uint8_t reserved0;
+
+ uint8_t red_mask, red_position;
+ uint8_t green_mask, green_position;
+ uint8_t blue_mask, blue_position;
+ uint8_t rsv_mask, rsv_position;
+ uint8_t directcolor_attributes;
+
+ volatile uint32_t physbase; // your LFB (Linear Framebuffer) address ;)
+ uint32_t reserved1;
+ uint16_t reserved2;
+}vbemodeinfo;
+
+uint32_t vesa_init(multiboot_information *info,foolfont *);
+
+void PutConsoleChar(char c, int color);
+void PutConsole(char *str, int color);
+void vesa_put_rect(int x, int y, int w , int h, int color);
+void PutFont(char c, int x,int y, int color_fg,int color_bg);
+void PutString(char *str, int x,int y, int color, va_list va);