diff options
| author | Michal Idziorek <m.i@gmx.at> | 2014-11-13 00:35:06 +0100 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2014-11-13 00:35:06 +0100 |
| commit | b126d01e9687e6509c9d49b1b174c95aee603a89 (patch) | |
| tree | fe05187f4f9c28ef65bf530116c20c05f1a679b8 /kernel/vesa.c | |
| parent | e3c4f3b03aa77ea19ddf7d982d39871dbdc018c0 (diff) | |
fixing implicit functions!
Diffstat (limited to 'kernel/vesa.c')
| -rw-r--r-- | kernel/vesa.c | 84 |
1 files changed, 27 insertions, 57 deletions
diff --git a/kernel/vesa.c b/kernel/vesa.c index 25c92a1..be17623 100644 --- a/kernel/vesa.c +++ b/kernel/vesa.c @@ -2,53 +2,16 @@ #include <stdarg.h> #include "kernel.h" #include "config.h" +#include "mem.h" +#include "vesa.h" #include "lib/logger/log.h" // logger facilities #include "lib/int/stdint.h" +#include "lib/printf/printf.h" #define FOOLOS_MODULE_NAME "vesa" #define FOOLSOS_SHOW_VESAMODES -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; - -typedef struct foolfont_struct -{ - uint8_t line[10]; //every single fool font consists of 10 lines a 8 bit - -}foolfont; static foolfont *deffont; static vbemodeinfo *VbeModeInfoBlock; @@ -62,6 +25,28 @@ static int console_cols; static uint8_t* buffer; static uint8_t* physbase; +void PutConsoleNL(); +void PutPixel(int x,int y, int color); + +void vesa_switch_buffers() +{ + for(int i=0;i<800*600*2;i++)physbase[i]=buffer[i]; + +} + +void vesa_put_rect(int x, int y, int w , int h, int color) +{ + for(int i=x;i<x+w;i++) + for(int j=y;j<y+h;j++) + PutPixel(i,j,color); +} + +void vesa_clear_screen() +{ + vesa_put_rect(0,0,VbeModeInfoBlock->Xres, VbeModeInfoBlock->Yres, 0xffffff); +} + + void vesa_set_physbase(uint32_t addr) { VbeModeInfoBlock->physbase=addr; @@ -94,6 +79,7 @@ uint32_t vesa_init(vbeinfo *info,vbemodeinfo *mode,foolfont *rawfont) mode->Xres, mode->Yres, mode->banks, mode->attributes); log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"bpp: %d / physbase: 0x%x", mode->bpp,mode->physbase); +/* // vesa modes // todo: take segment from vbeinfo! #ifdef FOOLSOS_SHOW_VESAMODES @@ -106,6 +92,7 @@ uint32_t vesa_init(vbeinfo *info,vbemodeinfo *mode,foolfont *rawfont) modeptr++; } #endif +*/ return VbeModeInfoBlock->physbase; @@ -239,22 +226,5 @@ void vesa_init_doublebuff() VbeModeInfoBlock->physbase=buffer; } -void vesa_switch_buffers() -{ - for(int i=0;i<800*600*2;i++)physbase[i]=buffer[i]; - -} - -void vesa_clear_screen() -{ - vesa_put_rect(0,0,VbeModeInfoBlock->Xres, VbeModeInfoBlock->Yres, 0xffffff); -} - -void vesa_put_rect(int x, int y, int w , int h, int color) -{ - for(int i=x;i<x+w;i++) - for(int j=y;j<y+h;j++) - PutPixel(i,j,color); -} |
