aboutsummaryrefslogtreecommitdiff
path: root/drivers/vga.c
diff options
context:
space:
mode:
authorFranklin Wei <frankhwei536@gmail.com>2015-02-07 16:56:02 -0500
committerFranklin Wei <frankhwei536@gmail.com>2015-02-07 16:56:02 -0500
commit2be70c3b7c3cb806614318858090c039bdfd4fc5 (patch)
tree61faa241e572d3241718b868ef9b32c20312ffc9 /drivers/vga.c
parentc0df0ee6437aa2786b1a92bc6af1284958d104c7 (diff)
downloadkappa-2be70c3b7c3cb806614318858090c039bdfd4fc5.zip
kappa-2be70c3b7c3cb806614318858090c039bdfd4fc5.tar.gz
kappa-2be70c3b7c3cb806614318858090c039bdfd4fc5.tar.bz2
kappa-2be70c3b7c3cb806614318858090c039bdfd4fc5.tar.xz
fix RNG with zero seed, rename VGA->GFX
Diffstat (limited to 'drivers/vga.c')
-rw-r--r--drivers/vga.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/drivers/vga.c b/drivers/vga.c
deleted file mode 100644
index ccf0949..0000000
--- a/drivers/vga.c
+++ /dev/null
@@ -1,42 +0,0 @@
-#include <stddef.h>
-#include <stdlib.h>
-#include "log.h"
-#include "multiboot.h"
-#include "panic.h"
-#include "vga.h"
-
-static uint8_t *framebuffer = NULL;
-static uint16_t fb_width;
-static uint16_t fb_height;
-/* this is BYTES per pixel */
-static uint8_t fb_bpp;
-
-const uint16_t *vga_width = &fb_width;
-const uint16_t *vga_height = &fb_height;
-
-void vga_drawpixel(int x, int y, uint32_t col)
-{
- ((uint32_t*)framebuffer)[y * fb_width + x] = col;
-}
-
-void vga_clear(uint32_t col)
-{
- uint8_t *p = framebuffer;
- uint8_t *stop = framebuffer + fb_width * fb_height * fb_bpp;
- while(p < stop)
- {
- *(uint32_t*)p = col;
- p += fb_bpp;
- }
-}
-
-void vga_init(struct vbe_info_t *vbe_mode_info)
-{
- framebuffer = (uint8_t*)vbe_mode_info->physbase;
- fb_width = vbe_mode_info->Xres;
- fb_height = vbe_mode_info->Yres;
- fb_bpp = vbe_mode_info->bpp / 8;
- if(fb_bpp != 4)
- panic("BPP *MUST* be 32!!!\n");
- vga_clear(VGA_RGBPACK(0, 0, 0));
-}