summaryrefslogtreecommitdiff
path: root/kernel/vesa.c
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2014-10-20 18:54:18 +0200
committerMichal Idziorek <m.i@gmx.at>2014-10-20 18:54:18 +0200
commit813272cd88cc6c0a1dfbb121d2130fc849042c8a (patch)
tree61b8ede4a5c191c491621f0185d3a442ff5407dd /kernel/vesa.c
parent2f6fe94d436347c4d886407dbfd44b6ac1aa41fa (diff)
1st userspace programm and partial newlib support!
Diffstat (limited to 'kernel/vesa.c')
-rw-r--r--kernel/vesa.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/kernel/vesa.c b/kernel/vesa.c
index 0619f1a..7001e02 100644
--- a/kernel/vesa.c
+++ b/kernel/vesa.c
@@ -1,6 +1,7 @@
//http://wiki.osdev.org/GUI
#include <stdarg.h>
#include "kernel.h"
+#include "config.h"
#include "lib/logger/log.h" // logger facilities
#include "lib/int/stdint.h"
@@ -80,7 +81,7 @@ uint32_t vesa_init(vbeinfo *info,vbemodeinfo *mode,foolfont *rawfont)
console_cols=mode->Xres/col_width;
// vesa info
- log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"setup complete. vbe version: 0x%x / video mode ptr: 0x%x 0x%x",
+ log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"vbe version: 0x%x / video mode ptr: 0x%x 0x%x",
info->VbeVersion, info->VideoModePtr[1], info->VideoModePtr[0]);
// vesa info on selected mode:
@@ -89,8 +90,10 @@ uint32_t vesa_init(vbeinfo *info,vbemodeinfo *mode,foolfont *rawfont)
mode->green_position,mode->green_mask,
mode->blue_position,mode->blue_mask);
- log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"res: %d * %d / banks: %d / attr: 0x%x / bpp: %d / physbase: 0x%x",
- mode->Xres, mode->Yres, mode->banks, mode->attributes, mode->bpp,mode->physbase);
+ log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"res: %d * %d / banks: %d / attr: 0x%x",
+ 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
@@ -167,15 +170,23 @@ void PutString(char *str, int x,int y, int color, va_list va)
}
+void PutConsoleChar(char c, int color)
+{
+ PutFont(c, console_x*10,console_y*12, color);
+ console_x++;
+
+ #ifdef FOOLOS_CONSOLE_AUTOBREAK
+ if(console_x>console_cols)PutConsoleNL();
+ #endif
+}
+
void PutConsole(char *str, int color)
{
while((*str)!=0)
{
- PutFont(*str, console_x*10,console_y*12, color);
+ PutConsoleChar(*str,color);
str++;
- console_x++;
- if(console_x>console_cols);//PutConsoleNL();
}
}