summaryrefslogtreecommitdiff
path: root/kernel/console.c
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2014-07-08 17:04:11 +0200
committerMichal Idziorek <m.i@gmx.at>2014-07-08 17:04:11 +0200
commitb800448bd50d97aeaa6c51303f7024c0046d77ec (patch)
treecaf7300263169d783c4d868403a3d320396fbea4 /kernel/console.c
parent24c2a30b304ac1285db71375e31f46f85b50b1bc (diff)
moved idt stuff to C successfully
Diffstat (limited to 'kernel/console.c')
-rw-r--r--kernel/console.c48
1 files changed, 47 insertions, 1 deletions
diff --git a/kernel/console.c b/kernel/console.c
index 48e5ee7..d5d4573 100644
--- a/kernel/console.c
+++ b/kernel/console.c
@@ -7,9 +7,27 @@ static int posy=0;
void print_nextline()
{
+ int i,x;
+
posx=0;
posy++;
- if(posy>SCR_HEIGHT-2)posy=0;
+
+ if(posy>SCR_HEIGHT-2)
+ {
+ for(i=1;i<SCR_HEIGHT-1;i++)
+ {
+
+ for(x=1;x<SCR_WIDTH;x++)
+ {
+ char* video_mem=(char *)SCR_VIDEOMEM+((x)+(i-1)*SCR_WIDTH)*2;
+ char* video_mem2=(char *)SCR_VIDEOMEM+((x)+i*SCR_WIDTH)*2;
+
+ *video_mem=*video_mem2;
+ }
+ }
+
+ posy--;
+ }
}
void print_hex(uint16_t val)
@@ -32,6 +50,34 @@ void print_hex(uint16_t val)
}
+void print_string(char *str)
+{
+
+ while(*str!=0)
+ {
+ print_char(posx++,posy,*(str++));
+ }
+}
+
+void console_clear_screen()
+{
+ int x,y;
+ for(x=0;x<SCR_WIDTH;x++)
+ for(y=0;y<SCR_WIDTH;y++)
+ {
+ print_char_col(x,y," ",SCR_BLACK);
+
+ }
+ posx=posy=0;
+
+}
+
+
+
+
+
+// helper_funcs
+
void print_single_hex(int i)
{
if(i<10)print_char_col(posx,posy,'0'+i,SCR_GREEN);