summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
Diffstat (limited to 'driver')
-rw-r--r--driver/keyboard.c4
-rw-r--r--driver/keyboard.h3
-rw-r--r--driver/mouse.c5
-rw-r--r--driver/mouse.h1
-rw-r--r--driver/screen.c3
-rw-r--r--driver/serial.c1
-rw-r--r--driver/terminal.c36
-rw-r--r--driver/terminal.h2
-rw-r--r--driver/timer.c1
-rw-r--r--driver/vesa.c2
-rw-r--r--driver/vesa.h2
11 files changed, 49 insertions, 11 deletions
diff --git a/driver/keyboard.c b/driver/keyboard.c
index 7cc93ec..f188cfc 100644
--- a/driver/keyboard.c
+++ b/driver/keyboard.c
@@ -3,6 +3,8 @@
#include "asm_x86.h"
+#include "keyboard.h"
+#include "syscalls.h"
#include <stdbool.h>
@@ -15,7 +17,7 @@ static uint32_t kb_stream;
static void put(uint8_t c)
{
- syscall_write(kb_stream,&c,1);
+ syscall_write(kb_stream,(char *)&c,1);
}
void keyboard_init(uint32_t s)
diff --git a/driver/keyboard.h b/driver/keyboard.h
index 8b13789..03462f3 100644
--- a/driver/keyboard.h
+++ b/driver/keyboard.h
@@ -1 +1,2 @@
-
+void keyboard_init(uint32_t s);
+void keyboard_handle(uint8_t in);
diff --git a/driver/mouse.c b/driver/mouse.c
index ab7ec58..b9e0079 100644
--- a/driver/mouse.c
+++ b/driver/mouse.c
@@ -1,5 +1,6 @@
#include "kernel/kernel.h"
-
+#include "mouse.h"
+#include "driver/vesa.h"
//http://forum.osdev.org/viewtopic.php?t=10247
//based on Mouse.inc by SANiK
@@ -130,7 +131,7 @@ void mouse_log()
//klog("%d / %d / %02x ",mouse_x, mouse_y,mouse_byte[2]);
if (mouse_byte[0] & 1)vesa_put_rect(mouse_x,600-mouse_y,10,10,0x00ffff);
//else vesa_put_rect(mouse_x,600-mouse_y,10,10,0x0000ff);
- PutFont('X', mouse_x,600-mouse_y, 0xff0000);
+ PutFont('X', mouse_x,600-mouse_y, 0xff0000,0);
}
diff --git a/driver/mouse.h b/driver/mouse.h
index dbf7393..95bf088 100644
--- a/driver/mouse.h
+++ b/driver/mouse.h
@@ -1 +1,2 @@
void mouse_handler();
+void mouse_init();
diff --git a/driver/screen.c b/driver/screen.c
index f095a15..4d39b77 100644
--- a/driver/screen.c
+++ b/driver/screen.c
@@ -1,12 +1,13 @@
#include "screen.h"
#include "kernel/kernel.h"
+#include "asm_x86.h"
//#define FOOLOS_CONSOLE
static int posx=0;
static int posy=0;
-static void scr_nextline();
+//static void scr_nextline();
void update_cursor(uint32_t col,uint32_t row)
{
diff --git a/driver/serial.c b/driver/serial.c
index 4e43251..0088868 100644
--- a/driver/serial.c
+++ b/driver/serial.c
@@ -1,6 +1,7 @@
#include "serial.h"
#include "asm_x86.h" // provides x86_inb() and x86_outb()
+
/** COM1 Port */
static const PORT=0x3f8;
diff --git a/driver/terminal.c b/driver/terminal.c
index 6ac1533..978a7be 100644
--- a/driver/terminal.c
+++ b/driver/terminal.c
@@ -38,8 +38,8 @@ typedef enum {
ecma48_fg_magenta,
ecma48_fg_cyan,
ecma48_fg_white,
- ecma48_undersore_on, // set def color
- ecma48_undersore_off, // set def color
+ ecma48_underscore_on, // set def color
+ ecma48_underscore_off, // set def color
ecma48_bg_black,
ecma48_bg_red,
@@ -78,6 +78,32 @@ static void process_graphic_npar(terminal_tty *tty, terminal_settings s)
switch(s)
{
+ case ecma48_null_mapping_2:
+ break;
+ case ecma48_null_mapping_1:
+ break;
+ case ecma48_reset_mapping:
+ break;
+ case ecma48_blinkoff:
+ break;
+ case ecma48_blink:
+ break;
+ case ecma48_nounderline:
+ break;
+ case ecma48_underscore_on:
+ break;
+ case ecma48_underscore_off:
+ break;
+ case ecma48_underscore:
+ break;
+ case ecma48_halfbright:
+ break;
+ case ecma48_normalbright_1:
+ break;
+ case ecma48_normalbright_2:
+ break;
+ case ecma48_bold:
+ break;
case ecma48_reset:
tty->fg=SCR_WHITE;
tty->bg=SCR_BLACK;
@@ -285,7 +311,7 @@ void terminal_kb(terminal_tty *tty, uint8_t c)
*/
// send one ASCII character to the terminal
-bool terminal_put(terminal_tty *tty, uint8_t c)
+void terminal_put(terminal_tty *tty, uint8_t c)
{
// CONTROL CHARACTERS
@@ -316,7 +342,7 @@ bool terminal_put(terminal_tty *tty, uint8_t c)
if(c==0x08) //BACKSPACE
{
- if(tty->x>0&&tty->command_l>0||!tty->set_echo)
+ if((tty->x>0&&tty->command_l>0)||!tty->set_echo)
{
set_char(tty,tty->x-1,tty->y,' ',tty->fg,tty->bg);
tty->x--;
@@ -525,6 +551,6 @@ bool terminal_put(terminal_tty *tty, uint8_t c)
//cusor pos
tty->screen->update_cursor(tty->x,tty->y);
- return true;
+ return;
}
diff --git a/driver/terminal.h b/driver/terminal.h
index be711f5..fac513d 100644
--- a/driver/terminal.h
+++ b/driver/terminal.h
@@ -71,7 +71,7 @@ typedef struct terminal_tty_struct
terminal_tty terminal_init(term_out *screen,term_in *input);
-bool terminal_put(terminal_tty *tty, uint8_t c);
+void terminal_put(terminal_tty *tty, uint8_t c);
void terminal_kb(terminal_tty *tty, uint8_t c);
#endif
diff --git a/driver/timer.c b/driver/timer.c
index d30a299..1ceebc5 100644
--- a/driver/timer.c
+++ b/driver/timer.c
@@ -1,6 +1,7 @@
#include "timer.h"
#include "asm_x86.h"
+#include "asm_pit.h"
static volatile uint64_t task_system_clock_start=0;
diff --git a/driver/vesa.c b/driver/vesa.c
index 090596c..bdf1c9a 100644
--- a/driver/vesa.c
+++ b/driver/vesa.c
@@ -34,12 +34,14 @@ void vesa_update_cursor(uint32_t col,uint32_t row)
}
// helper_funcs
+/*
static void vesa_print_char_col(int x, int y, char c, char col_fg, char col_bg)
{
// uint16_t attrib = (col_bg << 4) | (col_fg & 0x0F);
// uint16_t* video_mem=(uint16_t *)SCR_VIDEOMEM+(x+y*SCR_REAL_WIDTH);
// *video_mem=c | (attrib << 8) ;
}
+*/
// same colors as in screen.h
static uint32_t cols[] = {
diff --git a/driver/vesa.h b/driver/vesa.h
index ec98e84..7122d68 100644
--- a/driver/vesa.h
+++ b/driver/vesa.h
@@ -48,3 +48,5 @@ uint32_t vesa_init(vbeinfo *info,vbemodeinfo *mode,foolfont *rawfont);
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);